summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorBrandt Bucher <brandtbucher@microsoft.com>2024-06-24 15:35:10 (GMT)
committerGitHub <noreply@github.com>2024-06-24 15:35:10 (GMT)
commita47abdb45d4f1c3195c324812c33b6ef1d9147da (patch)
treef0629d55ee374ee0ab7a5bfe621a9515c24722a0 /Python
parentce1064e4c9bcfd673323ad690e60f86e1ab907bb (diff)
downloadcpython-a47abdb45d4f1c3195c324812c33b6ef1d9147da.zip
cpython-a47abdb45d4f1c3195c324812c33b6ef1d9147da.tar.gz
cpython-a47abdb45d4f1c3195c324812c33b6ef1d9147da.tar.bz2
GH-117062: Make _JUMP_TO_TOP a general absolute jump (GH-120854)
Diffstat (limited to 'Python')
-rw-r--r--Python/bytecodes.c4
-rw-r--r--Python/executor_cases.c.h4
-rw-r--r--Python/optimizer.c5
3 files changed, 7 insertions, 6 deletions
diff --git a/Python/bytecodes.c b/Python/bytecodes.c
index a6fb862..c00de88 100644
--- a/Python/bytecodes.c
+++ b/Python/bytecodes.c
@@ -4149,9 +4149,7 @@ dummy_func(
}
op(_JUMP_TO_TOP, (--)) {
-#ifndef _Py_JIT
- next_uop = &current_executor->trace[1];
-#endif
+ JUMP_TO_JUMP_TARGET();
}
tier2 op(_SET_IP, (instr_ptr/4 --)) {
diff --git a/Python/executor_cases.c.h b/Python/executor_cases.c.h
index cdfffcd..8de0309 100644
--- a/Python/executor_cases.c.h
+++ b/Python/executor_cases.c.h
@@ -4302,9 +4302,7 @@
}
case _JUMP_TO_TOP: {
- #ifndef _Py_JIT
- next_uop = &current_executor->trace[1];
- #endif
+ JUMP_TO_JUMP_TARGET();
break;
}
diff --git a/Python/optimizer.c b/Python/optimizer.c
index c9b187d..0d7118c 100644
--- a/Python/optimizer.c
+++ b/Python/optimizer.c
@@ -1059,6 +1059,11 @@ prepare_for_execution(_PyUOpInstruction *buffer, int length)
buffer[i].jump_target = 0;
}
}
+ if (opcode == _JUMP_TO_TOP) {
+ assert(buffer[0].opcode == _START_EXECUTOR);
+ buffer[i].format = UOP_FORMAT_JUMP;
+ buffer[i].jump_target = 1;
+ }
}
return next_spare;
}