Skip to content

Commit 914f1ff

Browse files
Fix changes from upstream (no more casts)
1 parent 673d5c8 commit 914f1ff

File tree

3 files changed

+20
-23
lines changed

3 files changed

+20
-23
lines changed

Include/internal/pycore_optimizer.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,6 @@ bool _Py_uop_symbol_is_immortal(JitOptSymbol *sym);
242242
static inline JitOptRef
243243
PyJitRef_Wrap(JitOptSymbol *sym)
244244
{
245-
if (sym == NULL || _Py_uop_symbol_is_immortal(sym)) {
246-
return (JitOptRef){.bits=(uintptr_t)sym | REF_IS_BORROWED};
247-
}
248245
return (JitOptRef){.bits=(uintptr_t)sym};
249246
}
250247

Python/optimizer_bytecodes.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ dummy_func(void) {
341341
}
342342

343343
op(_BINARY_OP_SUBSCR_INIT_CALL, (container, sub, getitem -- new_frame)) {
344-
new_frame = NULL;
344+
new_frame = PyJitRef_NULL;
345345
ctx->done = true;
346346
}
347347

@@ -666,7 +666,7 @@ dummy_func(void) {
666666

667667
op(_LOAD_ATTR_PROPERTY_FRAME, (fget/4, owner -- new_frame)) {
668668
(void)fget;
669-
new_frame = NULL;
669+
new_frame = PyJitRef_NULL;
670670
ctx->done = true;
671671
}
672672

@@ -733,9 +733,9 @@ dummy_func(void) {
733733
}
734734

735735
if (sym_is_null(self_or_null) || sym_is_not_null(self_or_null)) {
736-
new_frame = (JitOptSymbol *)frame_new(ctx, co, 0, args, argcount);
736+
new_frame = PyJitRef_Wrap((JitOptSymbol *)frame_new(ctx, co, 0, args, argcount));
737737
} else {
738-
new_frame = (JitOptSymbol *)frame_new(ctx, co, 0, NULL, 0);
738+
new_frame = PyJitRef_Wrap((JitOptSymbol *)frame_new(ctx, co, 0, NULL, 0));
739739
}
740740
}
741741

@@ -754,11 +754,11 @@ dummy_func(void) {
754754
break;
755755
}
756756

757-
new_frame = (JitOptSymbol *)frame_new(ctx, co, 0, NULL, 0);
757+
new_frame = PyJitRef_Wrap((JitOptSymbol *)frame_new(ctx, co, 0, NULL, 0));
758758
}
759759

760760
op(_PY_FRAME_KW, (callable, self_or_null, args[oparg], kwnames -- new_frame)) {
761-
new_frame = NULL;
761+
new_frame = PyJitRef_NULL;
762762
ctx->done = true;
763763
}
764764

@@ -770,7 +770,7 @@ dummy_func(void) {
770770
}
771771

772772
op(_CREATE_INIT_FRAME, (init, self, args[oparg] -- init_frame)) {
773-
init_frame = NULL;
773+
init_frame = PyJitRef_NULL;
774774
ctx->done = true;
775775
}
776776

@@ -837,13 +837,13 @@ dummy_func(void) {
837837
}
838838

839839
op(_FOR_ITER_GEN_FRAME, (unused, unused -- unused, unused, gen_frame)) {
840-
gen_frame = NULL;
840+
gen_frame = PyJitRef_NULL;
841841
/* We are about to hit the end of the trace */
842842
ctx->done = true;
843843
}
844844

845845
op(_SEND_GEN_FRAME, (unused, unused -- unused, gen_frame)) {
846-
gen_frame = NULL;
846+
gen_frame = PyJitRef_NULL;
847847
// We are about to hit the end of the trace:
848848
ctx->done = true;
849849
}
@@ -863,7 +863,7 @@ dummy_func(void) {
863863
op(_PUSH_FRAME, (new_frame -- )) {
864864
SYNC_SP();
865865
ctx->frame->stack_pointer = stack_pointer;
866-
ctx->frame = (_Py_UOpsAbstractFrame *)new_frame;
866+
ctx->frame = (_Py_UOpsAbstractFrame *)PyJitRef_Unwrap(new_frame);
867867
ctx->curr_frame_depth++;
868868
stack_pointer = ctx->frame->stack_pointer;
869869
co = get_code(this_instr);

Python/optimizer_cases.c.h

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

0 commit comments

Comments
 (0)