summaryrefslogtreecommitdiffstats
path: root/Python/optimizer.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2023-08-16 23:26:43 (GMT)
committerGitHub <noreply@github.com>2023-08-16 23:26:43 (GMT)
commitdc8fdf5fd5f572e87152883f15f35c354fa4b4bf (patch)
tree8b4c01a4f29113416bda04ebecc1da7126400bb5 /Python/optimizer.c
parent665a4391e10167dad1c854fb604c86f336fcd331 (diff)
downloadcpython-dc8fdf5fd5f572e87152883f15f35c354fa4b4bf.zip
cpython-dc8fdf5fd5f572e87152883f15f35c354fa4b4bf.tar.gz
cpython-dc8fdf5fd5f572e87152883f15f35c354fa4b4bf.tar.bz2
gh-106581: Split `CALL_PY_EXACT_ARGS` into uops (#107760)
* Split `CALL_PY_EXACT_ARGS` into uops This is only the first step for doing `CALL` in Tier 2. The next step involves tracing into the called code object and back. After that we'll have to do the remaining `CALL` specialization. Finally we'll have to deal with `KW_NAMES`. Note: this moves setting `frame->return_offset` directly in front of `DISPATCH_INLINED()`, to make it easier to move it into `_PUSH_FRAME`.
Diffstat (limited to 'Python/optimizer.c')
-rw-r--r--Python/optimizer.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/Python/optimizer.c b/Python/optimizer.c
index d3ac242..559c4ae 100644
--- a/Python/optimizer.c
+++ b/Python/optimizer.c
@@ -606,6 +606,10 @@ pop_jump_if_bool:
case OPARG_BOTTOM: // Second half of super-instr
oparg = orig_oparg & 0xF;
break;
+ case OPARG_SAVE_IP: // op==SAVE_IP; oparg=next instr
+ oparg = INSTR_IP(instr + offset, code);
+ break;
+
default:
fprintf(stderr,
"opcode=%d, oparg=%d; nuops=%d, i=%d; size=%d, offset=%d\n",
@@ -615,6 +619,11 @@ pop_jump_if_bool:
Py_FatalError("garbled expansion");
}
ADD_TO_TRACE(expansion->uops[i].uop, oparg, operand);
+ if (expansion->uops[i].uop == _PUSH_FRAME) {
+ assert(i + 1 == nuops);
+ ADD_TO_TRACE(SAVE_IP, 0, 0);
+ goto done;
+ }
}
break;
}