Skip to content

Commit f5a3a71

Browse files
committed
gh-149238: avoid bool objects when branching on int/str in JIT
1 parent 12a20da commit f5a3a71

13 files changed

Lines changed: 2254 additions & 1465 deletions

Include/internal/pycore_opcode_metadata.h

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

Include/internal/pycore_stackref.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,13 @@ static const _PyStackRef PyStackRef_ERROR = { .index = (1 << Py_TAGGED_SHIFT) };
7373
#define PyStackRef_None ((_PyStackRef){ .index = (2 << Py_TAGGED_SHIFT) } )
7474
#define _Py_STACKREF_FALSE_INDEX (3 << Py_TAGGED_SHIFT)
7575
#define _Py_STACKREF_TRUE_INDEX (4 << Py_TAGGED_SHIFT)
76+
/* Tier-2 transient bit values (gh-149238). */
77+
#define _Py_STACKREF_BIT_0_INDEX (5 << Py_TAGGED_SHIFT)
78+
#define _Py_STACKREF_BIT_1_INDEX (6 << Py_TAGGED_SHIFT)
7679
#define PyStackRef_False ((_PyStackRef){ .index = _Py_STACKREF_FALSE_INDEX })
7780
#define PyStackRef_True ((_PyStackRef){ .index = _Py_STACKREF_TRUE_INDEX })
7881

79-
#define INITIAL_STACKREF_INDEX (5 << Py_TAGGED_SHIFT)
82+
#define INITIAL_STACKREF_INDEX (7 << Py_TAGGED_SHIFT)
8083

8184
#define PyStackRef_ZERO_BITS PyStackRef_NULL
8285

0 commit comments

Comments
 (0)