Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address review
  • Loading branch information
Fidget-Spinner committed Mar 19, 2026
commit 1ae5bbd6fa22bb4e3a10a9499d746b5c21fff479
3 changes: 2 additions & 1 deletion Python/optimizer_bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1771,7 +1771,8 @@ dummy_func(void) {
PyCodeObject *co = get_current_code_object(ctx);
if (co->co_version == version) {
_Py_BloomFilter_Add(dependencies, co);
if (sym_get_func_version(ctx->frame->callable) != 0) {
// Functions derive their version from code objects.
if (sym_get_func_version(ctx->frame->callable) == version) {
REPLACE_OP(this_instr, _NOP, 0, 0);
}
}
Expand Down
2 changes: 1 addition & 1 deletion Python/optimizer_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions Python/optimizer_symbols.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ NULL | | RECORDED_VALUE*
| KNOWN_CLASS--+ | | |
| | | | | | PREDICATE RECORDED_VALUE(known type)
| | | INT* | | | |
| | | | FUNC_VERSION | | | <- Anything below this level has a known truthiness.
| | | | | | | | <- Anything below this level has a known truthiness.
| | | | FUNC_VERSION | | |
| TUPLE | | | TRUTHINESS | |
| | | | | | | | <- Anything below this level is a known constant.
| KNOWN_VALUE--+-------+----+------+
Expand Down Expand Up @@ -100,7 +101,7 @@ _PyUOpSymPrint(JitOptRef ref)
printf("<v%u at %p>", sym->version.version, (void *)sym);
break;
case JIT_SYM_FUNC_VERSION_TAG:
printf("<fv%u at %p>", sym->func_version.func_version, (void *)sym);
printf("<function version=%u>", sym->func_version.func_version);
break;
case JIT_SYM_KNOWN_CLASS_TAG:
printf("<%s at %p>", sym->cls.type->tp_name, (void *)sym);
Expand Down Expand Up @@ -527,7 +528,7 @@ _Py_uop_sym_set_func_version(JitOptContext *ctx, JitOptRef ref, uint32_t version
((PyFunctionObject *)sym->recorded_value.value)->func_version != version) {
sym_set_bottom(ctx, sym);
return false;
}
}
// Promote to known value, as we have guarded/checked on it.
sym->tag = JIT_SYM_KNOWN_VALUE_TAG;
// New ownership. We need to NewRef here, as
Expand Down
Loading