-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
gh-111610: Split up tier 2 opcode into opcode and target #111611
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
Conversation
This is fine, but don't you want to add the code that fills in the target and the code that uses it as well? I don't know what having just this one-line addition to the struct does to help you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Um, executor.c just disappeared. It got merged into ceval.c.
out.write_raw(f"{space}DEOPT_IF({cond}, {target});\n") | ||
if tier == TIER_TWO: | ||
out.write_raw(f"{space}TIER2_DEOPT_IF({cond}, {target});\n") | ||
else: | ||
out.write_raw(f"{space}DEOPT_IF({cond}, {target});\n") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this the wrong place to fix this? There's already a redefined DEOPT_IF() in ceval.c around L959.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I resolved the other conversation, but I'm still curious about this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I have some changes on my end that I havent pushed yet. This fixes it.
@@ -457,8 +457,9 @@ translate_bytecode_to_trace( | |||
assert(reserved > 0); \ | |||
reserved--; \ | |||
trace[trace_length].opcode = (OPCODE); \ | |||
trace[trace_length].oparg = (OPARG); \ | |||
trace[trace_length].oparg = (OPARG); \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trace[trace_length].oparg = (OPARG); \ | |
trace[trace_length].oparg = (OPARG); \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing here is generating the code for the target stub yet. I'm putting this PR in Draft mode for now; hope you're okay with that.
Sorry I've been caught up with school. Will resume work on this next week. |
I'm happy to add another field to The semantics of a guard is that it resumes execution of the base instruction at the same location. |
Basically the current flow is: tier 2 trace --- deopt + exit trace-----> tier 1 I want to change it to tier 2 trace ----deopt---> tier 2 trace cleanup/restoration to tier 1 state ----exit trace---> tier 1 |
That's not possible when there are deopts embedded within instructions. As not all instructions have deopts separated out, e.g. _LOBAL_GLOBAL_BUILTIN. I think we should change the semantics of deopts for tier 2. This PR only affects deopts for tier 2 not tier 1. All tier 2 deopts need to jump once we start truly inlining and re-materializing frames. I think we should standardise them and make all deopts jump. BTW, there was a previous version of this reply, where I said the same thing as above but in the form of asking questions. After re-reading that comment a few times, I decided the tone it was putting across could be interpreted as uncooperative (sorry if anyone felt it was like that, my intention was inquisitive). I have since deleted that comment and amended it to produce this version. I'm deeply sorry that the comment did not meet my own standards for communication. |
I've decided to defer this until we get frame inlining working - it adds additional complexity without any added benefits, and is only required for when we sink frame creation into exit code. |
Uh oh!
There was an error while loading. Please reload this page.