Skip to content

Commit 39c8d51

Browse files
Disable over-aggressive optimization for _GUARD_CODE_VERSION
1 parent 79b91e7 commit 39c8d51

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

Python/optimizer_bytecodes.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1747,9 +1747,10 @@ dummy_func(void) {
17471747

17481748
op(_GUARD_CODE_VERSION, (version/2 -- )) {
17491749
PyCodeObject *co = get_current_code_object(ctx);
1750-
if (co->co_version == version) {
1751-
_Py_BloomFilter_Add(dependencies, co);
1752-
REPLACE_OP(this_instr, _NOP, 0, 0);
1750+
if (co->co_version != version) {
1751+
// TODO:
1752+
// If we've previously guarded on this code version in a trace, we
1753+
// can avoid guarding it again.
17531754
}
17541755
else {
17551756
ctx->done = true;

Python/optimizer_cases.c.h

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

0 commit comments

Comments
 (0)