-
-
Notifications
You must be signed in to change notification settings - Fork 32k
gh-105775: Convert LOAD_CLOSURE to a pseudo-op #106059
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
21d086e
6921930
b111d10
bbdbb99
93b3138
32c1a70
4103b9a
269933e
a069593
988189d
968601d
46fa9d5
2b677b6
ab8ce45
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
:opcode:`LOAD_CLOSURE` is now a pseudo-op. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -175,12 +175,9 @@ dummy_func( | |
} | ||
} | ||
|
||
inst(LOAD_CLOSURE, (-- value)) { | ||
/* We keep LOAD_CLOSURE so that the bytecode stays more readable. */ | ||
value = GETLOCAL(oparg); | ||
ERROR_IF(value == NULL, unbound_local_error); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I note that we are implicitly eliminating this NULL check by converting There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @markshannon What do you think? We could replace it with LOAD_CLOSURE_CHECK instead to preserve this. There might be a way for a debugger to delete the variable. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I don't believe there is, unless the debugger is doing something unsupported and poking directly at the fastlocals array on a |
||
Py_INCREF(value); | ||
} | ||
pseudo(LOAD_CLOSURE) = { | ||
LOAD_FAST, | ||
}; | ||
|
||
inst(LOAD_FAST_CHECK, (-- value)) { | ||
value = GETLOCAL(oparg); | ||
|
Uh oh!
There was an error while loading. Please reload this page.