mirror of
https://github.com/python/cpython.git
synced 2025-10-20 08:23:47 +00:00
GH-118093: Add tier two support to several instructions (GH-121884)
This commit is contained in:
parent
7dd52b63ce
commit
7b36b67b1e
11 changed files with 372 additions and 108 deletions
|
@ -797,6 +797,13 @@ translate_bytecode_to_trace(
|
|||
|
||||
if (uop == _PUSH_FRAME) {
|
||||
assert(i + 1 == nuops);
|
||||
if (opcode == FOR_ITER_GEN || opcode == SEND_GEN) {
|
||||
DPRINTF(2, "Bailing due to dynamic target\n");
|
||||
ADD_TO_TRACE(uop, oparg, 0, target);
|
||||
ADD_TO_TRACE(_DYNAMIC_EXIT, 0, 0, 0);
|
||||
goto done;
|
||||
}
|
||||
assert(_PyOpcode_Deopt[opcode] == CALL);
|
||||
int func_version_offset =
|
||||
offsetof(_PyCallCache, func_version)/sizeof(_Py_CODEUNIT)
|
||||
// Add one to account for the actual opcode/oparg pair:
|
||||
|
@ -828,12 +835,6 @@ translate_bytecode_to_trace(
|
|||
ADD_TO_TRACE(_EXIT_TRACE, 0, 0, 0);
|
||||
goto done;
|
||||
}
|
||||
if (opcode == FOR_ITER_GEN) {
|
||||
DPRINTF(2, "Bailing due to dynamic target\n");
|
||||
ADD_TO_TRACE(uop, oparg, 0, target);
|
||||
ADD_TO_TRACE(_DYNAMIC_EXIT, 0, 0, 0);
|
||||
goto done;
|
||||
}
|
||||
// Increment IP to the return address
|
||||
instr += _PyOpcode_Caches[_PyOpcode_Deopt[opcode]] + 1;
|
||||
TRACE_STACK_PUSH();
|
||||
|
@ -886,6 +887,11 @@ translate_bytecode_to_trace(
|
|||
instr++;
|
||||
// Add cache size for opcode
|
||||
instr += _PyOpcode_Caches[_PyOpcode_Deopt[opcode]];
|
||||
|
||||
if (opcode == CALL_LIST_APPEND) {
|
||||
assert(instr->op.code == POP_TOP);
|
||||
instr++;
|
||||
}
|
||||
} // End for (;;)
|
||||
|
||||
done:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue