diff options
author | Guido van Rossum <guido@python.org> | 2023-06-27 21:17:41 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-27 21:17:41 (GMT) |
commit | 6b5166fb12c4744544da4ee26ef437d025eb762a (patch) | |
tree | cfa4fcb750ef895be8598c1b8b27f6cb41fff9f4 /Python/ceval.c | |
parent | 529088100952b31797a29ef7e0f5716613b32d66 (diff) | |
download | cpython-6b5166fb12c4744544da4ee26ef437d025eb762a.zip cpython-6b5166fb12c4744544da4ee26ef437d025eb762a.tar.gz cpython-6b5166fb12c4744544da4ee26ef437d025eb762a.tar.bz2 |
gh-104584: Change DEOPT_IF in uops executor (#106146)
This effectively reverts bb578a0, restoring the original DEOPT_IF() macro in ceval_macros.h, and redefining it in the Tier 2 interpreter. We can get rid of the PREDICTED() macros there as well!
Diffstat (limited to 'Python/ceval.c')
-rw-r--r-- | Python/ceval.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index 3e0dcf8..e19860d 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -2767,10 +2767,11 @@ void Py_LeaveRecursiveCall(void) ///////////////////// Experimental UOp Interpreter ///////////////////// -// UPDATE_MISS_STATS (called by DEOPT_IF) uses next_instr -// TODO: Make it do something useful -#undef UPDATE_MISS_STATS -#define UPDATE_MISS_STATS(INSTNAME) ((void)0) +#undef DEOPT_IF +#define DEOPT_IF(COND, INSTNAME) \ + if ((COND)) { \ + goto deoptimize; \ + } _PyInterpreterFrame * _PyUopExecute(_PyExecutorObject *executor, _PyInterpreterFrame *frame, PyObject **stack_pointer) @@ -2875,12 +2876,7 @@ error: Py_DECREF(self); return NULL; -PREDICTED(UNPACK_SEQUENCE) -PREDICTED(COMPARE_OP) -PREDICTED(LOAD_SUPER_ATTR) -PREDICTED(STORE_SUBSCR) -PREDICTED(BINARY_SUBSCR) -PREDICTED(BINARY_OP) +deoptimize: // On DEOPT_IF we just repeat the last instruction. // This presumes nothing was popped from the stack (nor pushed). #ifdef LLTRACE |