-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
bpo-45923: Add RESUME_QUICK
#31244
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
bpo-45923: Add RESUME_QUICK
#31244
Changes from all commits
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.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add a quickened form of :opcode:`RESUME` that skips quickening checks. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1732,9 +1732,6 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr | |
} | ||
|
||
TARGET(RESUME) { | ||
assert(tstate->cframe == &cframe); | ||
assert(frame == cframe.current_frame); | ||
|
||
int err = _Py_IncrementCountAndMaybeQuicken(frame->f_code); | ||
if (err) { | ||
if (err < 0) { | ||
|
@@ -1745,6 +1742,13 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr | |
first_instr = frame->f_code->co_firstinstr; | ||
next_instr = first_instr + nexti; | ||
} | ||
JUMP_TO_INSTRUCTION(RESUME_QUICK); | ||
} | ||
|
||
TARGET(RESUME_QUICK) { | ||
PREDICTED(RESUME_QUICK); | ||
assert(tstate->cframe == &cframe); | ||
assert(frame == cframe.current_frame); | ||
frame->f_state = FRAME_EXECUTING; | ||
if (_Py_atomic_load_relaxed(eval_breaker) && oparg < 2) { | ||
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. The specializer should handle the |
||
goto handle_eval_breaker; | ||
|
@@ -4002,7 +4006,6 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr | |
|
||
TARGET(JUMP_ABSOLUTE) { | ||
PREDICTED(JUMP_ABSOLUTE); | ||
assert(oparg < INSTR_OFFSET()); | ||
int err = _Py_IncrementCountAndMaybeQuicken(frame->f_code); | ||
if (err) { | ||
if (err < 0) { | ||
|
@@ -4013,9 +4016,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr | |
first_instr = frame->f_code->co_firstinstr; | ||
next_instr = first_instr + nexti; | ||
} | ||
JUMPTO(oparg); | ||
CHECK_EVAL_BREAKER(); | ||
DISPATCH(); | ||
JUMP_TO_INSTRUCTION(JUMP_ABSOLUTE_QUICK); | ||
} | ||
|
||
TARGET(JUMP_NO_INTERRUPT) { | ||
|
@@ -4030,6 +4031,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr | |
} | ||
|
||
TARGET(JUMP_ABSOLUTE_QUICK) { | ||
PREDICTED(JUMP_ABSOLUTE_QUICK); | ||
assert(oparg < INSTR_OFFSET()); | ||
JUMPTO(oparg); | ||
CHECK_EVAL_BREAKER(); | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.