mirror of
https://github.com/python/cpython.git
synced 2025-07-09 20:35:26 +00:00
gh-101632: Add the new RETURN_CONST opcode (#101633)
This commit is contained in:
parent
0d3d5007b1
commit
753fc8a5d6
19 changed files with 186 additions and 154 deletions
|
@ -555,6 +555,23 @@ dummy_func(
|
|||
goto resume_frame;
|
||||
}
|
||||
|
||||
inst(RETURN_CONST, (--)) {
|
||||
PyObject *retval = GETITEM(consts, oparg);
|
||||
Py_INCREF(retval);
|
||||
assert(EMPTY());
|
||||
_PyFrame_SetStackPointer(frame, stack_pointer);
|
||||
TRACE_FUNCTION_EXIT();
|
||||
DTRACE_FUNCTION_EXIT();
|
||||
_Py_LeaveRecursiveCallPy(tstate);
|
||||
assert(frame != &entry_frame);
|
||||
// GH-99729: We need to unlink the frame *before* clearing it:
|
||||
_PyInterpreterFrame *dying = frame;
|
||||
frame = cframe.current_frame = dying->previous;
|
||||
_PyEvalFrameClearAndPop(tstate, dying);
|
||||
_PyFrame_StackPush(frame, retval);
|
||||
goto resume_frame;
|
||||
}
|
||||
|
||||
inst(GET_AITER, (obj -- iter)) {
|
||||
unaryfunc getter = NULL;
|
||||
PyTypeObject *type = Py_TYPE(obj);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue