summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2022-03-31 13:14:15 (GMT)
committerGitHub <noreply@github.com>2022-03-31 13:14:15 (GMT)
commita00518d9ad9a8f408a9699191019d75dd8406c32 (patch)
treecd66e7a9fd60f08e92fd56a183e1996623123da8 /Python/ceval.c
parentb36d222110d0d6d84dc8e973ca87d976c2423f5d (diff)
downloadcpython-a00518d9ad9a8f408a9699191019d75dd8406c32.zip
cpython-a00518d9ad9a8f408a9699191019d75dd8406c32.tar.gz
cpython-a00518d9ad9a8f408a9699191019d75dd8406c32.tar.bz2
bpo-47120: Replace the JUMP_ABSOLUTE opcode by the relative JUMP_BACKWARD (GH-32115)
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index a7b3777..8f73ea1 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -2218,7 +2218,7 @@ handle_eval_breaker:
Py_DECREF(v);
if (err != 0)
goto error;
- PREDICT(JUMP_ABSOLUTE);
+ PREDICT(JUMP_BACKWARD_QUICK);
DISPATCH();
}
@@ -2230,7 +2230,7 @@ handle_eval_breaker:
Py_DECREF(v);
if (err != 0)
goto error;
- PREDICT(JUMP_ABSOLUTE);
+ PREDICT(JUMP_BACKWARD_QUICK);
DISPATCH();
}
@@ -3396,7 +3396,7 @@ handle_eval_breaker:
if (_PyDict_SetItem_Take2((PyDictObject *)map, key, value) != 0) {
goto error;
}
- PREDICT(JUMP_ABSOLUTE);
+ PREDICT(JUMP_BACKWARD_QUICK);
DISPATCH();
}
@@ -3926,6 +3926,11 @@ handle_eval_breaker:
DISPATCH();
}
+ TARGET(JUMP_BACKWARD) {
+ _PyCode_Warmup(frame->f_code);
+ JUMP_TO_INSTRUCTION(JUMP_BACKWARD_QUICK);
+ }
+
TARGET(POP_JUMP_IF_FALSE) {
PREDICTED(POP_JUMP_IF_FALSE);
PyObject *cond = POP();
@@ -4053,12 +4058,6 @@ handle_eval_breaker:
DISPATCH();
}
- TARGET(JUMP_ABSOLUTE) {
- PREDICTED(JUMP_ABSOLUTE);
- _PyCode_Warmup(frame->f_code);
- JUMP_TO_INSTRUCTION(JUMP_ABSOLUTE_QUICK);
- }
-
TARGET(JUMP_NO_INTERRUPT) {
/* This bytecode is used in the `yield from` or `await` loop.
* If there is an interrupt, we want it handled in the innermost
@@ -4069,10 +4068,10 @@ handle_eval_breaker:
DISPATCH();
}
- TARGET(JUMP_ABSOLUTE_QUICK) {
- PREDICTED(JUMP_ABSOLUTE_QUICK);
+ TARGET(JUMP_BACKWARD_QUICK) {
+ PREDICTED(JUMP_BACKWARD_QUICK);
assert(oparg < INSTR_OFFSET());
- JUMPTO(oparg);
+ JUMPBY(-oparg);
CHECK_EVAL_BREAKER();
DISPATCH();
}