Skip to content

Commit c59b71f

Browse files
committed
Clean up
1 parent 7b24811 commit c59b71f

File tree

3 files changed

+24
-23
lines changed

3 files changed

+24
-23
lines changed

Include/internal/pycore_stackref.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,11 +619,12 @@ PyStackRef_FromPyObjectBorrow(PyObject *obj)
619619
Used by _LOAD_CONST_INLINE_BORROW variants where the operand is
620620
tagged at trace creation time to avoid tagging on every execution. */
621621
static inline _PyStackRef
622-
PyStackRef_FromPreTagged(uintptr_t tagged)
622+
_PyStackRef_FromPreTagged(uintptr_t tagged)
623623
{
624624
assert(tagged & Py_TAG_REFCNT);
625625
return (_PyStackRef){ .bits = tagged };
626626
}
627+
#define PyStackRef_FromPreTagged(ptr) _PyStackRef_FromPreTagged((uintptr_t)(ptr))
627628

628629
/* Tag a PyObject pointer as a borrowed operand for BORROW variants. */
629630
#define PyStackRef_TagBorrow(ptr) \

Python/bytecodes.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5874,7 +5874,7 @@ dummy_func(
58745874
}
58755875

58765876
tier2 pure op(_LOAD_CONST_INLINE_BORROW, (ptr/4 -- value)) {
5877-
value = PyStackRef_FromPreTagged((uintptr_t)ptr);
5877+
value = PyStackRef_FromPreTagged(ptr);
58785878
}
58795879

58805880
tier2 op(_POP_CALL, (callable, null --)) {
@@ -5900,28 +5900,28 @@ dummy_func(
59005900

59015901
tier2 op(_POP_TOP_LOAD_CONST_INLINE_BORROW, (ptr/4, pop -- value)) {
59025902
PyStackRef_CLOSE(pop);
5903-
value = PyStackRef_FromPreTagged((uintptr_t)ptr);
5903+
value = PyStackRef_FromPreTagged(ptr);
59045904
}
59055905

59065906
tier2 op(_POP_TWO_LOAD_CONST_INLINE_BORROW, (ptr/4, pop1, pop2 -- value)) {
59075907
PyStackRef_CLOSE(pop2);
59085908
PyStackRef_CLOSE(pop1);
5909-
value = PyStackRef_FromPreTagged((uintptr_t)ptr);
5909+
value = PyStackRef_FromPreTagged(ptr);
59105910
}
59115911

59125912
tier2 op(_POP_CALL_LOAD_CONST_INLINE_BORROW, (ptr/4, callable, null -- value)) {
59135913
(void)null; // Silence compiler warnings about unused variables
59145914
DEAD(null);
59155915
PyStackRef_CLOSE(callable);
5916-
value = PyStackRef_FromPreTagged((uintptr_t)ptr);
5916+
value = PyStackRef_FromPreTagged(ptr);
59175917
}
59185918

59195919
tier2 op(_POP_CALL_ONE_LOAD_CONST_INLINE_BORROW, (ptr/4, callable, null, pop -- value)) {
59205920
PyStackRef_CLOSE(pop);
59215921
(void)null; // Silence compiler warnings about unused variables
59225922
DEAD(null);
59235923
PyStackRef_CLOSE(callable);
5924-
value = PyStackRef_FromPreTagged((uintptr_t)ptr);
5924+
value = PyStackRef_FromPreTagged(ptr);
59255925
}
59265926

59275927
tier2 op(_INSERT_1_LOAD_CONST_INLINE, (ptr/4, left -- res, l)) {
@@ -5931,26 +5931,26 @@ dummy_func(
59315931
}
59325932

59335933
tier2 op(_INSERT_1_LOAD_CONST_INLINE_BORROW, (ptr/4, left -- res, l)) {
5934-
res = PyStackRef_FromPreTagged((uintptr_t)ptr);
5934+
res = PyStackRef_FromPreTagged(ptr);
59355935
l = left;
59365936
INPUTS_DEAD();
59375937
}
59385938

59395939
tier2 op(_INSERT_2_LOAD_CONST_INLINE_BORROW, (ptr/4, left, right -- res, l, r)) {
5940-
res = PyStackRef_FromPreTagged((uintptr_t)ptr);
5940+
res = PyStackRef_FromPreTagged(ptr);
59415941
l = left;
59425942
r = right;
59435943
INPUTS_DEAD();
59445944
}
59455945

59465946
tier2 op(_SHUFFLE_2_LOAD_CONST_INLINE_BORROW, (ptr/4, callable, null, arg -- res, a)) {
5947-
res = PyStackRef_FromPreTagged((uintptr_t)ptr);
5947+
res = PyStackRef_FromPreTagged(ptr);
59485948
a = arg;
59495949
INPUTS_DEAD();
59505950
}
59515951

59525952
tier2 op(_SHUFFLE_3_LOAD_CONST_INLINE_BORROW, (ptr/4, callable, null, arg -- res, a, c)) {
5953-
res = PyStackRef_FromPreTagged((uintptr_t)ptr);
5953+
res = PyStackRef_FromPreTagged(ptr);
59545954
a = arg;
59555955
c = callable;
59565956
INPUTS_DEAD();
@@ -5962,7 +5962,7 @@ dummy_func(
59625962
(void)null; // Silence compiler warnings about unused variables
59635963
DEAD(null);
59645964
PyStackRef_CLOSE(callable);
5965-
value = PyStackRef_FromPreTagged((uintptr_t)ptr);
5965+
value = PyStackRef_FromPreTagged(ptr);
59665966
}
59675967

59685968
tier2 op(_LOAD_CONST_UNDER_INLINE, (ptr/4, old -- value, new)) {
@@ -5974,7 +5974,7 @@ dummy_func(
59745974
tier2 op(_LOAD_CONST_UNDER_INLINE_BORROW, (ptr/4, old -- value, new)) {
59755975
new = old;
59765976
DEAD(old);
5977-
value = PyStackRef_FromPreTagged((uintptr_t)ptr);
5977+
value = PyStackRef_FromPreTagged(ptr);
59785978
}
59795979

59805980
tier2 op(_START_EXECUTOR, (executor/4 --)) {

Python/executor_cases.c.h

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)