You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
teach dis how to interpret the oparg of ENTER_EXECUTOR #112383
Hm... I think it's not that simple. The oparg of ENTER_EXECUTOR is unrelated to the oparg of the JUMP_BACKWARD it overwrites. It is an index in the table of executors associated (optionally) with the code object. The executor saves the origin opcode (currently always JUMP_BACKWARD, but that may change) and oparg (low byte only) in its vmdata field. Note that if there are EXTENDED_ARG prefixes those are unchanged and unaffected -- the executor index must fit in one byte and only the low byte of the full oparg is saved.
I expect that in order to handle ENTER_EXECUTOR correctly in dis and other things that inspect the "adaptive" (read: specialized) bytecode, we need an API on the code object to retrieve the executors, or at least the original vmdata for the executors.
changed the title [-]Make the oparg of ENTER_EXECUTOR mean the same as that of JUMP_BACKWARD[/-][+]teach dis how to interpret the oparg of ENTER_EXECUTOR [/+]on Nov 28, 2023
If you can import _testinternalcapi, you can get a hold of the executor (ex = _testinternalcapi.get_executor(co, offset)) and the executor object now has methods get_opcode() and get_oparg() that return those fields (only the lower byte of oparg).
Activity
gvanrossum commentedon Nov 24, 2023
Hm... I think it's not that simple. The oparg of
ENTER_EXECUTORis unrelated to the oparg of theJUMP_BACKWARDit overwrites. It is an index in the table of executors associated (optionally) with the code object. The executor saves the origin opcode (currently alwaysJUMP_BACKWARD, but that may change) and oparg (low byte only) in itsvmdatafield. Note that if there areEXTENDED_ARGprefixes those are unchanged and unaffected -- the executor index must fit in one byte and only the low byte of the full oparg is saved.I expect that in order to handle
ENTER_EXECUTORcorrectly indisand other things that inspect the "adaptive" (read: specialized) bytecode, we need an API on the code object to retrieve the executors, or at least the original vmdata for the executors.[-]Make the oparg of ENTER_EXECUTOR mean the same as that of JUMP_BACKWARD[/-][+]teach dis how to interpret the oparg of ENTER_EXECUTOR [/+]GH-112383: Fix test_loop_quicken when an executor is installed (GH-11…
pythonGH-112383: Fix test_loop_quicken when an executor is installed (p…
hugovk commentedon Mar 15, 2024
Triage: can this be closed or is there more to do?
iritkatriel commentedon Mar 15, 2024
I don't think we know what to do here.
gvanrossum commentedon Mar 15, 2024
If you can import
_testinternalcapi, you can get a hold of the executor (ex = _testinternalcapi.get_executor(co, offset)) and the executor object now has methodsget_opcode()andget_oparg()that return those fields (only the lower byte ofoparg).pythongh-112383: teach dis how to interpret ENTER_EXECUTOR
gh-112383: teach dis how to interpret ENTER_EXECUTOR (#117171)
pythongh-112383: teach dis how to interpret ENTER_EXECUTOR (python#11…
Squashed commit of the following:
Squashed commit of the following:
pythongh-112383: teach dis how to interpret ENTER_EXECUTOR (python#11…
pythonGH-112383: Fix test_loop_quicken when an executor is installed (p…