| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
LG, but could you add a test for this? You could add it to test_capi/test_misc.py in TestOptimizerAPI.
Sorry, something went wrong.
Thanks, I added the test, and if I understand the intention correctly. Please let me know if I understand wrongly. |
Sorry, something went wrong.
|
pydoc test failure is unrelated to this PR, I checked it locally and asked to Discord too |
Sorry, something went wrong.
There was a problem hiding this comment.
Yes, the arg must also be restored, since it is overwritten (with the index of the executor to be used in this code object's array of executors). So it looks like writing the test was useful!
Sorry, something went wrong.
| if (co_instr.op.code == ENTER_EXECUTOR) { | ||
| const int exec_index = co_instr.op.arg; | ||
| _PyExecutorObject *exec = co->co_executors->executors[exec_index]; | ||
| co_instr.op.code = exec->vm_data.opcode; |
There was a problem hiding this comment.
Comparing two code objects must not modify the code object.
The interaction between executor, the specializer and instrumentation is subtle and likely to break without care.
This will leak executors, as it flip-flops between JUMP_BACKWARDS and ENTER_EXECUTOR, or worse if an optimizer assumes that a single instruction will only be seen once.
Sorry, something went wrong.
| if (cp_instr.op.code == ENTER_EXECUTOR) { | ||
| const int exec_index = cp_instr.op.arg; | ||
| _PyExecutorObject *exec = cp->co_executors->executors[exec_index]; | ||
| cp_instr.op.code = exec->vm_data.opcode; |
There was a problem hiding this comment.
Likewise
Sorry, something went wrong.
|
Please revert this. It will leak, and may not be safe. |
Sorry, something went wrong.
Sorry, something went wrong.
|
@corona10 We can fix this in the hash PR you are working on. |
Sorry, something went wrong.
Okay got it. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.