]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Cleanup
authorKen Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Sat, 18 Oct 2025 21:28:24 +0000 (22:28 +0100)
committerKen Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Sat, 18 Oct 2025 21:28:24 +0000 (22:28 +0100)
13 files changed:
Include/internal/pycore_opcode_metadata.h
Include/internal/pycore_uop_metadata.h
Objects/frameobject.c
Python/bytecodes.c
Python/ceval.c
Python/ceval_macros.h
Python/executor_cases.c.h
Python/generated_cases.c.h
Python/generated_tracer_cases.c.h
Python/instrumentation.c
Python/optimizer.c
Python/optimizer_cases.c.h
Tools/cases_generator/tier2_generator.py

index 477553e2563f8ce3e382a390830dcd22e7d24501..5d642604515e464ecd1bca16d861109a42abd1d7 100644 (file)
@@ -1406,8 +1406,8 @@ _PyOpcode_macro_expansion[256] = {
     [IMPORT_FROM] = { .nuops = 1, .uops = { { _IMPORT_FROM, OPARG_SIMPLE, 0 } } },
     [IMPORT_NAME] = { .nuops = 1, .uops = { { _IMPORT_NAME, OPARG_SIMPLE, 0 } } },
     [IS_OP] = { .nuops = 1, .uops = { { _IS_OP, OPARG_SIMPLE, 0 } } },
-    [JUMP_BACKWARD_NO_INTERRUPT] = { .nuops = 1, .uops = { { _JUMP_BACKWARD_NO_INTERRUPT, OPARG_SIMPLE, 0 } } },
-    [JUMP_BACKWARD_NO_JIT] = { .nuops = 2, .uops = { { _CHECK_PERIODIC, OPARG_SIMPLE, 1 }, { _JUMP_BACKWARD_NO_INTERRUPT, OPARG_SIMPLE, 1 } } },
+    [JUMP_BACKWARD_NO_INTERRUPT] = { .nuops = 1, .uops = { { _JUMP_BACKWARD_NO_INTERRUPT, OPARG_REPLACED, 0 } } },
+    [JUMP_BACKWARD_NO_JIT] = { .nuops = 2, .uops = { { _CHECK_PERIODIC, OPARG_SIMPLE, 1 }, { _JUMP_BACKWARD_NO_INTERRUPT, OPARG_REPLACED, 1 } } },
     [LIST_APPEND] = { .nuops = 1, .uops = { { _LIST_APPEND, OPARG_SIMPLE, 0 } } },
     [LIST_EXTEND] = { .nuops = 1, .uops = { { _LIST_EXTEND, OPARG_SIMPLE, 0 } } },
     [LOAD_ATTR] = { .nuops = 1, .uops = { { _LOAD_ATTR, OPARG_SIMPLE, 8 } } },
index 79f0b7a68d1f4462e6d54fd8fb3db8882788bb69..82a0fa92652524ddbef1dafbe8e32b7529e0056a 100644 (file)
@@ -206,7 +206,6 @@ const uint16_t _PyUop_Flags[MAX_UOP_ID+1] = {
     [_IMPORT_NAME] = HAS_ARG_FLAG | HAS_NAME_FLAG | HAS_ERROR_FLAG | HAS_ESCAPES_FLAG,
     [_IMPORT_FROM] = HAS_ARG_FLAG | HAS_NAME_FLAG | HAS_ERROR_FLAG | HAS_ESCAPES_FLAG,
     [_IS_NONE] = HAS_ESCAPES_FLAG,
-    [_JUMP_BACKWARD_NO_INTERRUPT] = HAS_ARG_FLAG | HAS_JUMP_FLAG,
     [_GET_LEN] = HAS_ERROR_FLAG | HAS_ESCAPES_FLAG,
     [_MATCH_CLASS] = HAS_ARG_FLAG | HAS_ERROR_FLAG | HAS_ESCAPES_FLAG,
     [_MATCH_MAPPING] = 0,
@@ -524,7 +523,6 @@ const char *const _PyOpcode_uop_name[MAX_UOP_ID+1] = {
     [_ITER_NEXT_LIST_TIER_TWO] = "_ITER_NEXT_LIST_TIER_TWO",
     [_ITER_NEXT_RANGE] = "_ITER_NEXT_RANGE",
     [_ITER_NEXT_TUPLE] = "_ITER_NEXT_TUPLE",
-    [_JUMP_BACKWARD_NO_INTERRUPT] = "_JUMP_BACKWARD_NO_INTERRUPT",
     [_JUMP_TO_TOP] = "_JUMP_TO_TOP",
     [_LIST_APPEND] = "_LIST_APPEND",
     [_LIST_EXTEND] = "_LIST_EXTEND",
@@ -1049,8 +1047,6 @@ int _PyUop_num_popped(int opcode, int oparg)
             return 0;
         case _IS_NONE:
             return 1;
-        case _JUMP_BACKWARD_NO_INTERRUPT:
-            return 0;
         case _GET_LEN:
             return 0;
         case _MATCH_CLASS:
index 33e57fbfc245b2eea235eaf192155ea51e5c9f35..156daef7f9c6ad1ade4dbb3a1c0a95364e4e0a8c 100644 (file)
@@ -18,7 +18,7 @@
 #include "frameobject.h"          // PyFrameLocalsProxyObject
 #include "opcode.h"               // EXTENDED_ARG
 #include "../Include/pytypedefs.h"
-#include "../Include/internal/pycore_optimizer.h"
+#include "pycore_optimizer.h"
 
 #include "clinic/frameobject.c.h"
 
index e9ced8297c3375cd0633f24aa0da8e3f449a97d1..4c3a595a57d2d896d9ebef2a970ab6d87987dfab 100644 (file)
@@ -1251,10 +1251,12 @@ dummy_func(
             frame = tstate->current_frame = dying->previous;
             _PyEval_FrameClearAndPop(tstate, dying);
             RELOAD_STACK();
+            #if TIER_ONE
             LOAD_IP(frame->return_offset);
-#if TIER_TWO
-            frame->instr_ptr += frame->return_offset;
-#endif
+            #endif
+            #if TIER_TWO
+            TIER2_STORE_IP(frame->return_offset);
+            #endif
             res = temp;
             LLTRACE_RESUME_FRAME();
         }
@@ -1441,10 +1443,12 @@ dummy_func(
                    _PyOpcode_Deopt[frame->instr_ptr->op.code] == ENTER_EXECUTOR);
             #endif
             RELOAD_STACK();
+            #if TIER_ONE
             LOAD_IP(1 + INLINE_CACHE_ENTRIES_SEND);
-#if TIER_TWO
-            frame->instr_ptr += (1 + INLINE_CACHE_ENTRIES_SEND);
-#endif
+            #endif
+            #if TIER_TWO
+            TIER2_STORE_IP(1 + INLINE_CACHE_ENTRIES_SEND);
+            #endif
             value = PyStackRef_MakeHeapSafe(temp);
             LLTRACE_RESUME_FRAME();
         }
@@ -3084,15 +3088,13 @@ dummy_func(
 
         macro(POP_JUMP_IF_NOT_NONE) = unused/1 + _IS_NONE + _POP_JUMP_IF_FALSE;
 
-        inst(JUMP_BACKWARD_NO_INTERRUPT, (--)) {
+        replaced inst(JUMP_BACKWARD_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
              * generator or coroutine, so we deliberately do not check it here.
              * (see bpo-30039).
              */
-#if TIER_ONE
             assert(oparg <= INSTR_OFFSET());
-#endif
             JUMPBY(-oparg);
         }
 
@@ -3233,15 +3235,15 @@ dummy_func(
         }
 
         op(_FOR_ITER_TIER_TWO, (iter, null_or_index -- iter, null_or_index, next)) {
-            TIER2_JUMPBY(1 + INLINE_CACHE_ENTRIES_FOR_ITER);
+            TIER2_STORE_IP(1 + INLINE_CACHE_ENTRIES_FOR_ITER);
             _PyStackRef item = _PyForIter_VirtualIteratorNext(tstate, frame, iter, &null_or_index);
             if (!PyStackRef_IsValid(item)) {
                 if (PyStackRef_IsError(item)) {
                     ERROR_NO_POP();
                 }
                 /* iterator ended normally */
-                // Jump forward by oparg and skip the following END_FOR
-                TIER2_JUMPBY(oparg + 1);
+                /* This just sets the IP to what it expects */
+                TIER2_STORE_IP(oparg + 1);
                 EXIT_IF(true);
             }
             next = item;
@@ -4992,10 +4994,12 @@ dummy_func(
             _PyInterpreterFrame *prev = frame->previous;
             _PyThreadState_PopFrame(tstate, frame);
             frame = tstate->current_frame = prev;
+            #if TIER_ONE
             LOAD_IP(frame->return_offset);
-#if TIER_TWO
+            #endif
+            #if TIER_TWO
             frame->instr_ptr += (frame->return_offset);
-#endif
+            #endif
             RELOAD_STACK();
             res = PyStackRef_FromPyObjectStealMortal((PyObject *)gen);
             LLTRACE_RESUME_FRAME();
index 55e86f81b01a39cc1282bb1d163e4f0cc9044445..c16d26b5411921fd3ceed33713c4bf9a1d4d6f3b 100644 (file)
@@ -1194,26 +1194,26 @@ tier2_dispatch:
     for (;;) {
         uopcode = next_uop->opcode;
 #ifdef Py_DEBUG
-        if (frame->lltrace >= 2) {
+        if (frame->lltrace >= 4) {
             if (next_uop->opcode != _YIELD_VALUE &&
             next_uop->opcode != _FOR_ITER_GEN_FRAME &&
             next_uop->opcode != _PUSH_FRAME &&
             next_uop->opcode != _PY_FRAME_KW &&
             next_uop->opcode != _SAVE_RETURN_OFFSET &&
             next_uop->opcode != _SAVE_RETURN_OFFSET) {
-                // if (next_uop->opcode != _START_EXECUTOR) {
-                //     if (next_uop->format == UOP_FORMAT_TARGET) {
-                //         _Py_CODEUNIT *aim = _PyFrame_GetBytecode(frame) + next_uop->target;
-                //         printf("    aim=[%s]\n", _PyOpcode_OpName[aim->op.code]);
-                //     }
-                //     else if (next_uop->format == UOP_FORMAT_JUMP) {
-                //         _PyUOpInstruction *aim_uop =  current_executor->trace + next_uop->jump_target;
-                //         if (aim_uop->format == UOP_FORMAT_TARGET) {
-                //             _Py_CODEUNIT *aim = _PyFrame_GetBytecode(frame) + aim_uop->target;
-                //             printf("    aim=[%s]\n", _PyOpcode_OpName[aim->op.code]);
-                //         }
-                //     }
-                // }
+                if (next_uop->opcode != _START_EXECUTOR) {
+                    if (next_uop->format == UOP_FORMAT_TARGET) {
+                        _Py_CODEUNIT *aim = _PyFrame_GetBytecode(frame) + next_uop->target;
+                        printf("    aim=[%s]\n", _PyOpcode_OpName[aim->op.code]);
+                    }
+                    else if (next_uop->format == UOP_FORMAT_JUMP) {
+                        _PyUOpInstruction *aim_uop =  current_executor->trace + next_uop->jump_target;
+                        if (aim_uop->format == UOP_FORMAT_TARGET) {
+                            _Py_CODEUNIT *aim = _PyFrame_GetBytecode(frame) + aim_uop->target;
+                            printf("    aim=[%s]\n", _PyOpcode_OpName[aim->op.code]);
+                        }
+                    }
+                }
                 dump_stack(frame, stack_pointer);
             }
             if (next_uop->opcode == _START_EXECUTOR) {
index 086abfc0535b1a7aa996940d3a4414d0eb2f5d8e..dab0ff33c9ae039a40041cf96e748296b8ee585e 100644 (file)
@@ -78,7 +78,6 @@
 #   define TAIL_CALL_ARGS frame, stack_pointer, tstate, next_instr, instruction_funcptr_table, oparg
 #endif
 
-
 #if _Py_TAIL_CALL_INTERP
     // Note: [[clang::musttail]] works for GCC 15, but not __attribute__((musttail)) at the moment.
 #   define Py_MUSTTAIL [[clang::musttail]]
@@ -267,7 +266,7 @@ GETITEM(PyObject *v, Py_ssize_t i) {
  * and skipped instructions.
  */
 #define JUMPBY(x)       (next_instr += (x))
-#define TIER2_JUMPBY(x) (frame->instr_ptr += (x))
+#define TIER2_STORE_IP(x) (frame->instr_ptr += (x))
 #define SKIP_OVER(x)    (next_instr += (x))
 
 #define STACK_LEVEL()     ((int)(stack_pointer - _PyFrame_Stackbase(frame)))
index 0a664209830f1fb4549f632e6e1db5a75c198db7..ade852159afb42bdf288df3f6eb7c1fac35eaf24 100644 (file)
             frame = tstate->current_frame = dying->previous;
             _PyEval_FrameClearAndPop(tstate, dying);
             stack_pointer = _PyFrame_GetStackPointer(frame);
+            #if TIER_ONE
             LOAD_IP(frame->return_offset);
+            #endif
             #if TIER_TWO
-            frame->instr_ptr += frame->return_offset;
+            TIER2_STORE_IP(frame->return_offset);
             #endif
             res = temp;
             LLTRACE_RESUME_FRAME();
                   _PyOpcode_Deopt[frame->instr_ptr->op.code] == ENTER_EXECUTOR);
             #endif
             stack_pointer = _PyFrame_GetStackPointer(frame);
+            #if TIER_ONE
             LOAD_IP(1 + INLINE_CACHE_ENTRIES_SEND);
+            #endif
             #if TIER_TWO
-            frame->instr_ptr += (1 + INLINE_CACHE_ENTRIES_SEND);
+            TIER2_STORE_IP(1 + INLINE_CACHE_ENTRIES_SEND);
             #endif
             value = PyStackRef_MakeHeapSafe(temp);
             LLTRACE_RESUME_FRAME();
             break;
         }
 
-        case _JUMP_BACKWARD_NO_INTERRUPT: {
-            oparg = CURRENT_OPARG();
-            #if TIER_ONE
-            assert(oparg <= INSTR_OFFSET());
-            #endif
-            TIER2_JUMPBY(-oparg);
-            break;
-        }
+        /* _JUMP_BACKWARD_NO_INTERRUPT is not a viable micro-op for tier 2 because it is replaced */
 
         case _GET_LEN: {
             _PyStackRef obj;
             oparg = CURRENT_OPARG();
             null_or_index = stack_pointer[-1];
             iter = stack_pointer[-2];
-            TIER2_JUMPBY(1 + INLINE_CACHE_ENTRIES_FOR_ITER);
+            TIER2_STORE_IP(1 + INLINE_CACHE_ENTRIES_FOR_ITER);
             _PyFrame_SetStackPointer(frame, stack_pointer);
             _PyStackRef item = _PyForIter_VirtualIteratorNext(tstate, frame, iter, &null_or_index);
             stack_pointer = _PyFrame_GetStackPointer(frame);
                 if (PyStackRef_IsError(item)) {
                     JUMP_TO_ERROR();
                 }
-                TIER2_JUMPBY(oparg + 1);
+                TIER2_STORE_IP(oparg + 1);
                 if (true) {
                     UOP_STAT_INC(uopcode, miss);
                     JUMP_TO_JUMP_TARGET();
             _PyInterpreterFrame *prev = frame->previous;
             _PyThreadState_PopFrame(tstate, frame);
             frame = tstate->current_frame = prev;
+            #if TIER_ONE
             LOAD_IP(frame->return_offset);
+            #endif
             #if TIER_TWO
             frame->instr_ptr += (frame->return_offset);
             #endif
index f8230170a25e8fbd30e96d349c3b35cbc94d0ade..9c9eaa29ed8141e731dce0df7596964f0e041676 100644 (file)
                 frame = tstate->current_frame = dying->previous;
                 _PyEval_FrameClearAndPop(tstate, dying);
                 stack_pointer = _PyFrame_GetStackPointer(frame);
+                #if TIER_ONE
                 LOAD_IP(frame->return_offset);
+                #endif
                 #if TIER_TWO
-                frame->instr_ptr += frame->return_offset;
+                TIER2_STORE_IP(frame->return_offset);
                 #endif
                 res = temp;
                 LLTRACE_RESUME_FRAME();
                   _PyOpcode_Deopt[frame->instr_ptr->op.code] == ENTER_EXECUTOR);
                 #endif
                 stack_pointer = _PyFrame_GetStackPointer(frame);
+                #if TIER_ONE
                 LOAD_IP(1 + INLINE_CACHE_ENTRIES_SEND);
+                #endif
                 #if TIER_TWO
-                frame->instr_ptr += (1 + INLINE_CACHE_ENTRIES_SEND);
+                TIER2_STORE_IP(1 + INLINE_CACHE_ENTRIES_SEND);
                 #endif
                 value = PyStackRef_MakeHeapSafe(temp);
                 LLTRACE_RESUME_FRAME();
             }
             // _JUMP_BACKWARD_NO_INTERRUPT
             {
-                #if TIER_ONE
                 assert(oparg <= INSTR_OFFSET());
-                #endif
                 JUMPBY(-oparg);
             }
             DISPATCH();
             }
             // _JUMP_BACKWARD_NO_INTERRUPT
             {
-                #if TIER_ONE
                 assert(oparg <= INSTR_OFFSET());
-                #endif
                 JUMPBY(-oparg);
             }
             // _JIT
             frame->instr_ptr = next_instr;
             next_instr += 1;
             INSTRUCTION_STATS(JUMP_BACKWARD_NO_INTERRUPT);
-            #if TIER_ONE
             assert(oparg <= INSTR_OFFSET());
-            #endif
             JUMPBY(-oparg);
             DISPATCH();
         }
             }
             // _JUMP_BACKWARD_NO_INTERRUPT
             {
-                #if TIER_ONE
                 assert(oparg <= INSTR_OFFSET());
-                #endif
                 JUMPBY(-oparg);
             }
             DISPATCH();
             _PyInterpreterFrame *prev = frame->previous;
             _PyThreadState_PopFrame(tstate, frame);
             frame = tstate->current_frame = prev;
+            #if TIER_ONE
             LOAD_IP(frame->return_offset);
+            #endif
             #if TIER_TWO
             frame->instr_ptr += (frame->return_offset);
             #endif
             frame = tstate->current_frame = dying->previous;
             _PyEval_FrameClearAndPop(tstate, dying);
             stack_pointer = _PyFrame_GetStackPointer(frame);
+            #if TIER_ONE
             LOAD_IP(frame->return_offset);
+            #endif
             #if TIER_TWO
-            frame->instr_ptr += frame->return_offset;
+            TIER2_STORE_IP(frame->return_offset);
             #endif
             res = temp;
             LLTRACE_RESUME_FRAME();
                   _PyOpcode_Deopt[frame->instr_ptr->op.code] == ENTER_EXECUTOR);
             #endif
             stack_pointer = _PyFrame_GetStackPointer(frame);
+            #if TIER_ONE
             LOAD_IP(1 + INLINE_CACHE_ENTRIES_SEND);
+            #endif
             #if TIER_TWO
-            frame->instr_ptr += (1 + INLINE_CACHE_ENTRIES_SEND);
+            TIER2_STORE_IP(1 + INLINE_CACHE_ENTRIES_SEND);
             #endif
             value = PyStackRef_MakeHeapSafe(temp);
             LLTRACE_RESUME_FRAME();
index 52364a8743b35c575b87327408b14149ddaa9360..48e71c54c7a55ac049265cbd9efdb5ff3519c63a 100644 (file)
                 frame = tstate->current_frame = dying->previous;
                 _PyEval_FrameClearAndPop(tstate, dying);
                 stack_pointer = _PyFrame_GetStackPointer(frame);
+                #if TIER_ONE
                 LOAD_IP(frame->return_offset);
+                #endif
                 #if TIER_TWO
-                frame->instr_ptr += frame->return_offset;
+                TIER2_STORE_IP(frame->return_offset);
                 #endif
                 res = temp;
                 LLTRACE_RESUME_FRAME();
                   _PyOpcode_Deopt[frame->instr_ptr->op.code] == ENTER_EXECUTOR);
                 #endif
                 stack_pointer = _PyFrame_GetStackPointer(frame);
+                #if TIER_ONE
                 LOAD_IP(1 + INLINE_CACHE_ENTRIES_SEND);
+                #endif
                 #if TIER_TWO
-                frame->instr_ptr += (1 + INLINE_CACHE_ENTRIES_SEND);
+                TIER2_STORE_IP(1 + INLINE_CACHE_ENTRIES_SEND);
                 #endif
                 value = PyStackRef_MakeHeapSafe(temp);
                 LLTRACE_RESUME_FRAME();
             }
             // _JUMP_BACKWARD_NO_INTERRUPT
             {
-                #if TIER_ONE
                 assert(oparg <= INSTR_OFFSET());
-                #endif
                 JUMPBY(-oparg);
             }
             TRACING_DISPATCH();
             }
             // _JUMP_BACKWARD_NO_INTERRUPT
             {
-                #if TIER_ONE
                 assert(oparg <= INSTR_OFFSET());
-                #endif
                 JUMPBY(-oparg);
             }
             // _JIT
             (void)old_func;
             int _jump_taken = false;
             (void)_jump_taken;
-            #if TIER_ONE
             assert(oparg <= INSTR_OFFSET());
-            #endif
             JUMPBY(-oparg);
             TRACING_DISPATCH();
         }
             }
             // _JUMP_BACKWARD_NO_INTERRUPT
             {
-                #if TIER_ONE
                 assert(oparg <= INSTR_OFFSET());
-                #endif
                 JUMPBY(-oparg);
             }
             TRACING_DISPATCH();
             _PyInterpreterFrame *prev = frame->previous;
             _PyThreadState_PopFrame(tstate, frame);
             frame = tstate->current_frame = prev;
+            #if TIER_ONE
             LOAD_IP(frame->return_offset);
+            #endif
             #if TIER_TWO
             frame->instr_ptr += (frame->return_offset);
             #endif
             frame = tstate->current_frame = dying->previous;
             _PyEval_FrameClearAndPop(tstate, dying);
             stack_pointer = _PyFrame_GetStackPointer(frame);
+            #if TIER_ONE
             LOAD_IP(frame->return_offset);
+            #endif
             #if TIER_TWO
-            frame->instr_ptr += frame->return_offset;
+            TIER2_STORE_IP(frame->return_offset);
             #endif
             res = temp;
             LLTRACE_RESUME_FRAME();
                   _PyOpcode_Deopt[frame->instr_ptr->op.code] == ENTER_EXECUTOR);
             #endif
             stack_pointer = _PyFrame_GetStackPointer(frame);
+            #if TIER_ONE
             LOAD_IP(1 + INLINE_CACHE_ENTRIES_SEND);
+            #endif
             #if TIER_TWO
-            frame->instr_ptr += (1 + INLINE_CACHE_ENTRIES_SEND);
+            TIER2_STORE_IP(1 + INLINE_CACHE_ENTRIES_SEND);
             #endif
             value = PyStackRef_MakeHeapSafe(temp);
             LLTRACE_RESUME_FRAME();
index 325acc34a1b5eeeb8ea9d39418bba92d9f392140..85fb73aaf098ee2e973c4ed64b4e251e0bf9b7c9 100644 (file)
@@ -18,7 +18,7 @@
 #include "pycore_tuple.h"         // _PyTuple_FromArraySteal()
 
 #include "opcode_ids.h"
-#include "../Include/internal/pycore_optimizer.h"
+#include "pycore_optimizer.h"
 
 
 /* Uncomment this to dump debugging output when assertions fail */
index bb3154dd0f2ca0d02c3e450c2595c6d1221ae004..824f67d0a126ed9d541ed6fcbbab879234d47c47 100644 (file)
@@ -701,6 +701,20 @@ _PyJIT_translate_single_bytecode_to_trace(
             break;
         }
         case JUMP_BACKWARD_JIT:
+            // This is possible as the JIT might have re-activated after it was disabled.                // if (next_uop->opcode != _START_EXECUTOR) {
+            //     if (next_uop->format == UOP_FORMAT_TARGET) {
+            //         _Py_CODEUNIT *aim = _PyFrame_GetBytecode(frame) + next_uop->target;
+            //         printf("    aim=[%s]\n", _PyOpcode_OpName[aim->op.code]);
+            //     }
+            //     else if (next_uop->format == UOP_FORMAT_JUMP) {
+            //         _PyUOpInstruction *aim_uop =  current_executor->trace + next_uop->jump_target;
+            //         if (aim_uop->format == UOP_FORMAT_TARGET) {
+            //             _Py_CODEUNIT *aim = _PyFrame_GetBytecode(frame) + aim_uop->target;
+            //             printf("    aim=[%s]\n", _PyOpcode_OpName[aim->op.code]);
+            //         }
+            //     }
+            // }
+        case JUMP_BACKWARD_NO_JIT:
         case JUMP_BACKWARD:
             ADD_TO_TRACE(_CHECK_PERIODIC, 0, 0, target);
             _Py_FALLTHROUGH;
index f5bb8a5585af938db27403818cb1dd8c342c1be1..99d8d8ae33397d736a6569524f2f84750a47b645 100644 (file)
             break;
         }
 
-        case _JUMP_BACKWARD_NO_INTERRUPT: {
-            break;
-        }
+        /* _JUMP_BACKWARD_NO_INTERRUPT is not a viable micro-op for tier 2 */
 
         case _GET_LEN: {
             JitOptRef obj;
index 28adb132874d7a05166887653c87cb81877a7b9f..87b26b1c732599c1311e8a4a9dec635bec788cb8 100644 (file)
@@ -147,7 +147,7 @@ class Tier2Emitter(Emitter):
         if storage.spilled:
             raise analysis_error("stack_pointer needs reloading before dispatch", tkn)
         storage.stack.flush(self.out)
-        self.emit("TIER2_JUMPBY")
+        self.emit("TIER2_STORE_IP")
         emit_to(self.out, tkn_iter, "SEMI")
         self.emit(";\n")
         return True