Skip to content

Commit 210275a

Browse files
committed
add INVALID_TAG for abstract frame
1 parent b52ce1e commit 210275a

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

Include/internal/pycore_optimizer_types.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ typedef enum _JitSymType {
3939
JIT_SYM_TUPLE_TAG = 8,
4040
JIT_SYM_TRUTHINESS_TAG = 9,
4141
JIT_SYM_COMPACT_INT = 10,
42+
43+
JIT_SYM_INVALID_TAG = 255, // for non-symbol values on abstract stack
4244
} JitSymType;
4345

4446
typedef struct _jit_opt_known_class {
@@ -91,6 +93,7 @@ typedef union {
9193
} JitOptRef;
9294

9395
typedef struct _Py_UOpsAbstractFrame {
96+
uint8_t tag;
9497
bool globals_watched;
9598
// The version number of the globals dicts, once checked. 0 if unchecked.
9699
uint32_t globals_checked_version;

Python/optimizer_symbols.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ _PyUOpSymPrint(JitOptRef ref)
109109
case JIT_SYM_COMPACT_INT:
110110
printf("<compact_int at %p>", (void *)sym);
111111
break;
112+
case JIT_SYM_INVALID_TAG:
113+
printf("<INVALID frame at %p>", (void *)sym);
114+
break;
112115
default:
113116
printf("<tag=%d at %p>", sym->tag, (void *)sym);
114117
break;
@@ -871,6 +874,7 @@ _Py_uop_frame_new(
871874
return NULL;
872875
}
873876
_Py_UOpsAbstractFrame *frame = &ctx->frames[ctx->curr_frame_depth];
877+
frame->tag = JIT_SYM_INVALID_TAG;
874878
frame->code = co;
875879
frame->stack_len = co->co_stacksize;
876880
frame->locals_len = co->co_nlocalsplus;

0 commit comments

Comments
 (0)