mirror of
https://github.com/python/cpython.git
synced 2025-07-10 04:45:36 +00:00
GH-120619: Clean up RETURN_VALUE
instruction (GH-120624)
* Rename _POP_FRAME to _RETURN_VALUE as it returns a value as well as popping a frame. * Remove remaining _POP_FRAMEs
This commit is contained in:
parent
79e09e60d8
commit
274f844830
11 changed files with 67 additions and 61 deletions
|
@ -265,7 +265,7 @@ remove_globals(_PyInterpreterFrame *frame, _PyUOpInstruction *buffer,
|
|||
}
|
||||
break;
|
||||
}
|
||||
case _POP_FRAME:
|
||||
case _RETURN_VALUE:
|
||||
{
|
||||
builtins_watched >>= 1;
|
||||
globals_watched >>= 1;
|
||||
|
@ -365,13 +365,13 @@ eliminate_pop_guard(_PyUOpInstruction *this_instr, bool exit)
|
|||
}
|
||||
}
|
||||
|
||||
/* _PUSH_FRAME/_POP_FRAME's operand can be 0, a PyFunctionObject *, or a
|
||||
/* _PUSH_FRAME/_RETURN_VALUE's operand can be 0, a PyFunctionObject *, or a
|
||||
* PyCodeObject *. Retrieve the code object if possible.
|
||||
*/
|
||||
static PyCodeObject *
|
||||
get_code(_PyUOpInstruction *op)
|
||||
{
|
||||
assert(op->opcode == _PUSH_FRAME || op->opcode == _POP_FRAME || op->opcode == _RETURN_GENERATOR);
|
||||
assert(op->opcode == _PUSH_FRAME || op->opcode == _RETURN_VALUE || op->opcode == _RETURN_GENERATOR);
|
||||
PyCodeObject *co = NULL;
|
||||
uint64_t operand = op->operand;
|
||||
if (operand == 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue