summaryrefslogtreecommitdiffstats
path: root/Python/optimizer.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2024-06-17 13:40:11 (GMT)
committerGitHub <noreply@github.com>2024-06-17 13:40:11 (GMT)
commit274f844830898355f14d6edb6e71894a2f37e53c (patch)
tree0f6ef2d7e7fd30f42fe83bbc05859314ac1c230a /Python/optimizer.c
parent79e09e60d865b7b3fcde9ccee86a502da82bb2b3 (diff)
downloadcpython-274f844830898355f14d6edb6e71894a2f37e53c.zip
cpython-274f844830898355f14d6edb6e71894a2f37e53c.tar.gz
cpython-274f844830898355f14d6edb6e71894a2f37e53c.tar.bz2
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
Diffstat (limited to 'Python/optimizer.c')
-rw-r--r--Python/optimizer.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Python/optimizer.c b/Python/optimizer.c
index 4dc3438..c9b187d 100644
--- a/Python/optimizer.c
+++ b/Python/optimizer.c
@@ -537,7 +537,7 @@ add_to_trace(
// Reserve space for N uops, plus 3 for _SET_IP, _CHECK_VALIDITY and _EXIT_TRACE
#define RESERVE(needed) RESERVE_RAW((needed) + 3, _PyUOpName(opcode))
-// Trace stack operations (used by _PUSH_FRAME, _POP_FRAME)
+// Trace stack operations (used by _PUSH_FRAME, _RETURN_VALUE)
#define TRACE_STACK_PUSH() \
if (trace_stack_depth >= TRACE_STACK_SIZE) { \
DPRINTF(2, "Trace stack overflow\n"); \
@@ -748,10 +748,10 @@ top: // Jump here after _PUSH_FRAME or likely branches
int nuops = expansion->nuops;
RESERVE(nuops + 1); /* One extra for exit */
int16_t last_op = expansion->uops[nuops-1].uop;
- if (last_op == _POP_FRAME || last_op == _RETURN_GENERATOR || last_op == _YIELD_VALUE) {
+ if (last_op == _RETURN_VALUE || last_op == _RETURN_GENERATOR || last_op == _YIELD_VALUE) {
// Check for trace stack underflow now:
// We can't bail e.g. in the middle of
- // LOAD_CONST + _POP_FRAME.
+ // LOAD_CONST + _RETURN_VALUE.
if (trace_stack_depth == 0) {
DPRINTF(2, "Trace stack underflow\n");
OPT_STAT_INC(trace_stack_underflow);
@@ -810,7 +810,7 @@ top: // Jump here after _PUSH_FRAME or likely branches
Py_FatalError("garbled expansion");
}
- if (uop == _POP_FRAME || uop == _RETURN_GENERATOR || uop == _YIELD_VALUE) {
+ if (uop == _RETURN_VALUE || uop == _RETURN_GENERATOR || uop == _YIELD_VALUE) {
TRACE_STACK_POP();
/* Set the operand to the function or code object returned to,
* to assist optimization passes. (See _PUSH_FRAME below.)