]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
remove dynamic tracing for now
authorKen Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Wed, 5 Nov 2025 21:54:05 +0000 (21:54 +0000)
committerKen Jin <28750310+Fidget-Spinner@users.noreply.github.com>
Wed, 5 Nov 2025 21:54:05 +0000 (21:54 +0000)
Include/internal/pycore_optimizer.h
Include/internal/pycore_uop_ids.h
Include/internal/pycore_uop_metadata.h
Python/bytecodes.c
Python/ceval.c
Python/executor_cases.c.h
Python/generated_cases.c.h
Python/optimizer.c
Python/optimizer_cases.c.h

index 3ea62eab1f4693a9949d27130df199418f7c5b49..d50e7ccfdd42c6f9a3898e9b748bb403590bcff6 100644 (file)
@@ -368,7 +368,7 @@ int
 _PyJit_TryInitializeTracing(PyThreadState *tstate, _PyInterpreterFrame *frame,
     _Py_CODEUNIT *curr_instr, _Py_CODEUNIT *insert_exec_instr,
     _Py_CODEUNIT *close_loop_instr, int curr_stackdepth, int chain_depth, _PyExitData *exit,
-    _PyExecutorObject *prev_exec, int oparg, bool is_dynamic_target);
+    _PyExecutorObject *prev_exec, int oparg);
 
 void _PyJit_FinalizeTracing(PyThreadState *tstate);
 
index a390be53e4337954eef44e53852fc0522646158b..071edfaa7a52be51b76eb252a858937b9c1e2d7b 100644 (file)
@@ -138,52 +138,51 @@ extern "C" {
 #define _GUARD_CALLABLE_TYPE_1 393
 #define _GUARD_DORV_NO_DICT 394
 #define _GUARD_DORV_VALUES_INST_ATTR_FROM_DICT 395
-#define _GUARD_EXECUTOR_IP 396
-#define _GUARD_GLOBALS_VERSION 397
-#define _GUARD_IP_RETURN_GENERATOR 398
-#define _GUARD_IP_RETURN_VALUE 399
-#define _GUARD_IP_YIELD_VALUE 400
-#define _GUARD_IP__PUSH_FRAME 401
-#define _GUARD_IS_FALSE_POP 402
-#define _GUARD_IS_NONE_POP 403
-#define _GUARD_IS_NOT_NONE_POP 404
-#define _GUARD_IS_TRUE_POP 405
-#define _GUARD_KEYS_VERSION 406
-#define _GUARD_NOS_DICT 407
-#define _GUARD_NOS_FLOAT 408
-#define _GUARD_NOS_INT 409
-#define _GUARD_NOS_LIST 410
-#define _GUARD_NOS_NOT_NULL 411
-#define _GUARD_NOS_NULL 412
-#define _GUARD_NOS_OVERFLOWED 413
-#define _GUARD_NOS_TUPLE 414
-#define _GUARD_NOS_UNICODE 415
-#define _GUARD_NOT_EXHAUSTED_LIST 416
-#define _GUARD_NOT_EXHAUSTED_RANGE 417
-#define _GUARD_NOT_EXHAUSTED_TUPLE 418
-#define _GUARD_THIRD_NULL 419
-#define _GUARD_TOS_ANY_SET 420
-#define _GUARD_TOS_DICT 421
-#define _GUARD_TOS_FLOAT 422
-#define _GUARD_TOS_INT 423
-#define _GUARD_TOS_LIST 424
-#define _GUARD_TOS_OVERFLOWED 425
-#define _GUARD_TOS_SLICE 426
-#define _GUARD_TOS_TUPLE 427
-#define _GUARD_TOS_UNICODE 428
-#define _GUARD_TYPE_VERSION 429
-#define _GUARD_TYPE_VERSION_AND_LOCK 430
-#define _HANDLE_PENDING_AND_DEOPT 431
+#define _GUARD_GLOBALS_VERSION 396
+#define _GUARD_IP_RETURN_GENERATOR 397
+#define _GUARD_IP_RETURN_VALUE 398
+#define _GUARD_IP_YIELD_VALUE 399
+#define _GUARD_IP__PUSH_FRAME 400
+#define _GUARD_IS_FALSE_POP 401
+#define _GUARD_IS_NONE_POP 402
+#define _GUARD_IS_NOT_NONE_POP 403
+#define _GUARD_IS_TRUE_POP 404
+#define _GUARD_KEYS_VERSION 405
+#define _GUARD_NOS_DICT 406
+#define _GUARD_NOS_FLOAT 407
+#define _GUARD_NOS_INT 408
+#define _GUARD_NOS_LIST 409
+#define _GUARD_NOS_NOT_NULL 410
+#define _GUARD_NOS_NULL 411
+#define _GUARD_NOS_OVERFLOWED 412
+#define _GUARD_NOS_TUPLE 413
+#define _GUARD_NOS_UNICODE 414
+#define _GUARD_NOT_EXHAUSTED_LIST 415
+#define _GUARD_NOT_EXHAUSTED_RANGE 416
+#define _GUARD_NOT_EXHAUSTED_TUPLE 417
+#define _GUARD_THIRD_NULL 418
+#define _GUARD_TOS_ANY_SET 419
+#define _GUARD_TOS_DICT 420
+#define _GUARD_TOS_FLOAT 421
+#define _GUARD_TOS_INT 422
+#define _GUARD_TOS_LIST 423
+#define _GUARD_TOS_OVERFLOWED 424
+#define _GUARD_TOS_SLICE 425
+#define _GUARD_TOS_TUPLE 426
+#define _GUARD_TOS_UNICODE 427
+#define _GUARD_TYPE_VERSION 428
+#define _GUARD_TYPE_VERSION_AND_LOCK 429
+#define _HANDLE_PENDING_AND_DEOPT 430
 #define _IMPORT_FROM IMPORT_FROM
 #define _IMPORT_NAME IMPORT_NAME
-#define _INIT_CALL_BOUND_METHOD_EXACT_ARGS 432
-#define _INIT_CALL_PY_EXACT_ARGS 433
-#define _INIT_CALL_PY_EXACT_ARGS_0 434
-#define _INIT_CALL_PY_EXACT_ARGS_1 435
-#define _INIT_CALL_PY_EXACT_ARGS_2 436
-#define _INIT_CALL_PY_EXACT_ARGS_3 437
-#define _INIT_CALL_PY_EXACT_ARGS_4 438
-#define _INSERT_NULL 439
+#define _INIT_CALL_BOUND_METHOD_EXACT_ARGS 431
+#define _INIT_CALL_PY_EXACT_ARGS 432
+#define _INIT_CALL_PY_EXACT_ARGS_0 433
+#define _INIT_CALL_PY_EXACT_ARGS_1 434
+#define _INIT_CALL_PY_EXACT_ARGS_2 435
+#define _INIT_CALL_PY_EXACT_ARGS_3 436
+#define _INIT_CALL_PY_EXACT_ARGS_4 437
+#define _INSERT_NULL 438
 #define _INSTRUMENTED_FOR_ITER INSTRUMENTED_FOR_ITER
 #define _INSTRUMENTED_INSTRUCTION INSTRUMENTED_INSTRUCTION
 #define _INSTRUMENTED_JUMP_FORWARD INSTRUMENTED_JUMP_FORWARD
@@ -193,179 +192,179 @@ extern "C" {
 #define _INSTRUMENTED_POP_JUMP_IF_NONE INSTRUMENTED_POP_JUMP_IF_NONE
 #define _INSTRUMENTED_POP_JUMP_IF_NOT_NONE INSTRUMENTED_POP_JUMP_IF_NOT_NONE
 #define _INSTRUMENTED_POP_JUMP_IF_TRUE INSTRUMENTED_POP_JUMP_IF_TRUE
-#define _IS_NONE 440
+#define _IS_NONE 439
 #define _IS_OP IS_OP
-#define _ITER_CHECK_LIST 441
-#define _ITER_CHECK_RANGE 442
-#define _ITER_CHECK_TUPLE 443
-#define _ITER_JUMP_LIST 444
-#define _ITER_JUMP_RANGE 445
-#define _ITER_JUMP_TUPLE 446
-#define _ITER_NEXT_LIST 447
-#define _ITER_NEXT_LIST_TIER_TWO 448
-#define _ITER_NEXT_RANGE 449
-#define _ITER_NEXT_TUPLE 450
+#define _ITER_CHECK_LIST 440
+#define _ITER_CHECK_RANGE 441
+#define _ITER_CHECK_TUPLE 442
+#define _ITER_JUMP_LIST 443
+#define _ITER_JUMP_RANGE 444
+#define _ITER_JUMP_TUPLE 445
+#define _ITER_NEXT_LIST 446
+#define _ITER_NEXT_LIST_TIER_TWO 447
+#define _ITER_NEXT_RANGE 448
+#define _ITER_NEXT_TUPLE 449
 #define _JUMP_BACKWARD_NO_INTERRUPT JUMP_BACKWARD_NO_INTERRUPT
-#define _JUMP_TO_TOP 451
+#define _JUMP_TO_TOP 450
 #define _LIST_APPEND LIST_APPEND
 #define _LIST_EXTEND LIST_EXTEND
-#define _LOAD_ATTR 452
-#define _LOAD_ATTR_CLASS 453
+#define _LOAD_ATTR 451
+#define _LOAD_ATTR_CLASS 452
 #define _LOAD_ATTR_GETATTRIBUTE_OVERRIDDEN LOAD_ATTR_GETATTRIBUTE_OVERRIDDEN
-#define _LOAD_ATTR_INSTANCE_VALUE 454
-#define _LOAD_ATTR_METHOD_LAZY_DICT 455
-#define _LOAD_ATTR_METHOD_NO_DICT 456
-#define _LOAD_ATTR_METHOD_WITH_VALUES 457
-#define _LOAD_ATTR_MODULE 458
-#define _LOAD_ATTR_NONDESCRIPTOR_NO_DICT 459
-#define _LOAD_ATTR_NONDESCRIPTOR_WITH_VALUES 460
-#define _LOAD_ATTR_PROPERTY_FRAME 461
-#define _LOAD_ATTR_SLOT 462
-#define _LOAD_ATTR_WITH_HINT 463
+#define _LOAD_ATTR_INSTANCE_VALUE 453
+#define _LOAD_ATTR_METHOD_LAZY_DICT 454
+#define _LOAD_ATTR_METHOD_NO_DICT 455
+#define _LOAD_ATTR_METHOD_WITH_VALUES 456
+#define _LOAD_ATTR_MODULE 457
+#define _LOAD_ATTR_NONDESCRIPTOR_NO_DICT 458
+#define _LOAD_ATTR_NONDESCRIPTOR_WITH_VALUES 459
+#define _LOAD_ATTR_PROPERTY_FRAME 460
+#define _LOAD_ATTR_SLOT 461
+#define _LOAD_ATTR_WITH_HINT 462
 #define _LOAD_BUILD_CLASS LOAD_BUILD_CLASS
-#define _LOAD_BYTECODE 464
+#define _LOAD_BYTECODE 463
 #define _LOAD_COMMON_CONSTANT LOAD_COMMON_CONSTANT
 #define _LOAD_CONST LOAD_CONST
-#define _LOAD_CONST_INLINE 465
-#define _LOAD_CONST_INLINE_BORROW 466
-#define _LOAD_CONST_UNDER_INLINE 467
-#define _LOAD_CONST_UNDER_INLINE_BORROW 468
+#define _LOAD_CONST_INLINE 464
+#define _LOAD_CONST_INLINE_BORROW 465
+#define _LOAD_CONST_UNDER_INLINE 466
+#define _LOAD_CONST_UNDER_INLINE_BORROW 467
 #define _LOAD_DEREF LOAD_DEREF
-#define _LOAD_FAST 469
-#define _LOAD_FAST_0 470
-#define _LOAD_FAST_1 471
-#define _LOAD_FAST_2 472
-#define _LOAD_FAST_3 473
-#define _LOAD_FAST_4 474
-#define _LOAD_FAST_5 475
-#define _LOAD_FAST_6 476
-#define _LOAD_FAST_7 477
+#define _LOAD_FAST 468
+#define _LOAD_FAST_0 469
+#define _LOAD_FAST_1 470
+#define _LOAD_FAST_2 471
+#define _LOAD_FAST_3 472
+#define _LOAD_FAST_4 473
+#define _LOAD_FAST_5 474
+#define _LOAD_FAST_6 475
+#define _LOAD_FAST_7 476
 #define _LOAD_FAST_AND_CLEAR LOAD_FAST_AND_CLEAR
-#define _LOAD_FAST_BORROW 478
-#define _LOAD_FAST_BORROW_0 479
-#define _LOAD_FAST_BORROW_1 480
-#define _LOAD_FAST_BORROW_2 481
-#define _LOAD_FAST_BORROW_3 482
-#define _LOAD_FAST_BORROW_4 483
-#define _LOAD_FAST_BORROW_5 484
-#define _LOAD_FAST_BORROW_6 485
-#define _LOAD_FAST_BORROW_7 486
+#define _LOAD_FAST_BORROW 477
+#define _LOAD_FAST_BORROW_0 478
+#define _LOAD_FAST_BORROW_1 479
+#define _LOAD_FAST_BORROW_2 480
+#define _LOAD_FAST_BORROW_3 481
+#define _LOAD_FAST_BORROW_4 482
+#define _LOAD_FAST_BORROW_5 483
+#define _LOAD_FAST_BORROW_6 484
+#define _LOAD_FAST_BORROW_7 485
 #define _LOAD_FAST_BORROW_LOAD_FAST_BORROW LOAD_FAST_BORROW_LOAD_FAST_BORROW
 #define _LOAD_FAST_CHECK LOAD_FAST_CHECK
 #define _LOAD_FAST_LOAD_FAST LOAD_FAST_LOAD_FAST
 #define _LOAD_FROM_DICT_OR_DEREF LOAD_FROM_DICT_OR_DEREF
 #define _LOAD_FROM_DICT_OR_GLOBALS LOAD_FROM_DICT_OR_GLOBALS
-#define _LOAD_GLOBAL 487
-#define _LOAD_GLOBAL_BUILTINS 488
-#define _LOAD_GLOBAL_MODULE 489
+#define _LOAD_GLOBAL 486
+#define _LOAD_GLOBAL_BUILTINS 487
+#define _LOAD_GLOBAL_MODULE 488
 #define _LOAD_LOCALS LOAD_LOCALS
 #define _LOAD_NAME LOAD_NAME
-#define _LOAD_SMALL_INT 490
-#define _LOAD_SMALL_INT_0 491
-#define _LOAD_SMALL_INT_1 492
-#define _LOAD_SMALL_INT_2 493
-#define _LOAD_SMALL_INT_3 494
-#define _LOAD_SPECIAL 495
+#define _LOAD_SMALL_INT 489
+#define _LOAD_SMALL_INT_0 490
+#define _LOAD_SMALL_INT_1 491
+#define _LOAD_SMALL_INT_2 492
+#define _LOAD_SMALL_INT_3 493
+#define _LOAD_SPECIAL 494
 #define _LOAD_SUPER_ATTR_ATTR LOAD_SUPER_ATTR_ATTR
 #define _LOAD_SUPER_ATTR_METHOD LOAD_SUPER_ATTR_METHOD
-#define _MAKE_CALLARGS_A_TUPLE 496
+#define _MAKE_CALLARGS_A_TUPLE 495
 #define _MAKE_CELL MAKE_CELL
 #define _MAKE_FUNCTION MAKE_FUNCTION
-#define _MAKE_WARM 497
+#define _MAKE_WARM 496
 #define _MAP_ADD MAP_ADD
 #define _MATCH_CLASS MATCH_CLASS
 #define _MATCH_KEYS MATCH_KEYS
 #define _MATCH_MAPPING MATCH_MAPPING
 #define _MATCH_SEQUENCE MATCH_SEQUENCE
-#define _MAYBE_EXPAND_METHOD 498
-#define _MAYBE_EXPAND_METHOD_KW 499
-#define _MONITOR_CALL 500
-#define _MONITOR_CALL_KW 501
-#define _MONITOR_JUMP_BACKWARD 502
-#define _MONITOR_RESUME 503
+#define _MAYBE_EXPAND_METHOD 497
+#define _MAYBE_EXPAND_METHOD_KW 498
+#define _MONITOR_CALL 499
+#define _MONITOR_CALL_KW 500
+#define _MONITOR_JUMP_BACKWARD 501
+#define _MONITOR_RESUME 502
 #define _NOP NOP
-#define _POP_CALL 504
-#define _POP_CALL_LOAD_CONST_INLINE_BORROW 505
-#define _POP_CALL_ONE 506
-#define _POP_CALL_ONE_LOAD_CONST_INLINE_BORROW 507
-#define _POP_CALL_TWO 508
-#define _POP_CALL_TWO_LOAD_CONST_INLINE_BORROW 509
+#define _POP_CALL 503
+#define _POP_CALL_LOAD_CONST_INLINE_BORROW 504
+#define _POP_CALL_ONE 505
+#define _POP_CALL_ONE_LOAD_CONST_INLINE_BORROW 506
+#define _POP_CALL_TWO 507
+#define _POP_CALL_TWO_LOAD_CONST_INLINE_BORROW 508
 #define _POP_EXCEPT POP_EXCEPT
 #define _POP_ITER POP_ITER
-#define _POP_JUMP_IF_FALSE 510
-#define _POP_JUMP_IF_TRUE 511
+#define _POP_JUMP_IF_FALSE 509
+#define _POP_JUMP_IF_TRUE 510
 #define _POP_TOP POP_TOP
-#define _POP_TOP_FLOAT 512
-#define _POP_TOP_INT 513
-#define _POP_TOP_LOAD_CONST_INLINE 514
-#define _POP_TOP_LOAD_CONST_INLINE_BORROW 515
-#define _POP_TOP_NOP 516
-#define _POP_TOP_UNICODE 517
-#define _POP_TWO 518
-#define _POP_TWO_LOAD_CONST_INLINE_BORROW 519
+#define _POP_TOP_FLOAT 511
+#define _POP_TOP_INT 512
+#define _POP_TOP_LOAD_CONST_INLINE 513
+#define _POP_TOP_LOAD_CONST_INLINE_BORROW 514
+#define _POP_TOP_NOP 515
+#define _POP_TOP_UNICODE 516
+#define _POP_TWO 517
+#define _POP_TWO_LOAD_CONST_INLINE_BORROW 518
 #define _PUSH_EXC_INFO PUSH_EXC_INFO
-#define _PUSH_FRAME 520
+#define _PUSH_FRAME 519
 #define _PUSH_NULL PUSH_NULL
-#define _PUSH_NULL_CONDITIONAL 521
-#define _PY_FRAME_GENERAL 522
-#define _PY_FRAME_KW 523
-#define _QUICKEN_RESUME 524
-#define _REPLACE_WITH_TRUE 525
+#define _PUSH_NULL_CONDITIONAL 520
+#define _PY_FRAME_GENERAL 521
+#define _PY_FRAME_KW 522
+#define _QUICKEN_RESUME 523
+#define _REPLACE_WITH_TRUE 524
 #define _RESUME_CHECK RESUME_CHECK
 #define _RETURN_GENERATOR RETURN_GENERATOR
 #define _RETURN_VALUE RETURN_VALUE
-#define _SAVE_RETURN_OFFSET 526
-#define _SEND 527
-#define _SEND_GEN_FRAME 528
+#define _SAVE_RETURN_OFFSET 525
+#define _SEND 526
+#define _SEND_GEN_FRAME 527
 #define _SETUP_ANNOTATIONS SETUP_ANNOTATIONS
 #define _SET_ADD SET_ADD
 #define _SET_FUNCTION_ATTRIBUTE SET_FUNCTION_ATTRIBUTE
 #define _SET_UPDATE SET_UPDATE
-#define _START_DYNAMIC_EXECUTOR 529
-#define _START_EXECUTOR 530
-#define _STORE_ATTR 531
-#define _STORE_ATTR_INSTANCE_VALUE 532
-#define _STORE_ATTR_SLOT 533
-#define _STORE_ATTR_WITH_HINT 534
+#define _START_DYNAMIC_EXECUTOR 528
+#define _START_EXECUTOR 529
+#define _STORE_ATTR 530
+#define _STORE_ATTR_INSTANCE_VALUE 531
+#define _STORE_ATTR_SLOT 532
+#define _STORE_ATTR_WITH_HINT 533
 #define _STORE_DEREF STORE_DEREF
-#define _STORE_FAST 535
-#define _STORE_FAST_0 536
-#define _STORE_FAST_1 537
-#define _STORE_FAST_2 538
-#define _STORE_FAST_3 539
-#define _STORE_FAST_4 540
-#define _STORE_FAST_5 541
-#define _STORE_FAST_6 542
-#define _STORE_FAST_7 543
+#define _STORE_FAST 534
+#define _STORE_FAST_0 535
+#define _STORE_FAST_1 536
+#define _STORE_FAST_2 537
+#define _STORE_FAST_3 538
+#define _STORE_FAST_4 539
+#define _STORE_FAST_5 540
+#define _STORE_FAST_6 541
+#define _STORE_FAST_7 542
 #define _STORE_FAST_LOAD_FAST STORE_FAST_LOAD_FAST
 #define _STORE_FAST_STORE_FAST STORE_FAST_STORE_FAST
 #define _STORE_GLOBAL STORE_GLOBAL
 #define _STORE_NAME STORE_NAME
-#define _STORE_SLICE 544
-#define _STORE_SUBSCR 545
-#define _STORE_SUBSCR_DICT 546
-#define _STORE_SUBSCR_LIST_INT 547
-#define _SWAP 548
-#define _SWAP_2 549
-#define _SWAP_3 550
-#define _TIER2_RESUME_CHECK 551
-#define _TO_BOOL 552
+#define _STORE_SLICE 543
+#define _STORE_SUBSCR 544
+#define _STORE_SUBSCR_DICT 545
+#define _STORE_SUBSCR_LIST_INT 546
+#define _SWAP 547
+#define _SWAP_2 548
+#define _SWAP_3 549
+#define _TIER2_RESUME_CHECK 550
+#define _TO_BOOL 551
 #define _TO_BOOL_BOOL TO_BOOL_BOOL
 #define _TO_BOOL_INT TO_BOOL_INT
-#define _TO_BOOL_LIST 553
+#define _TO_BOOL_LIST 552
 #define _TO_BOOL_NONE TO_BOOL_NONE
-#define _TO_BOOL_STR 554
+#define _TO_BOOL_STR 553
 #define _UNARY_INVERT UNARY_INVERT
 #define _UNARY_NEGATIVE UNARY_NEGATIVE
 #define _UNARY_NOT UNARY_NOT
 #define _UNPACK_EX UNPACK_EX
-#define _UNPACK_SEQUENCE 555
-#define _UNPACK_SEQUENCE_LIST 556
-#define _UNPACK_SEQUENCE_TUPLE 557
-#define _UNPACK_SEQUENCE_TWO_TUPLE 558
+#define _UNPACK_SEQUENCE 554
+#define _UNPACK_SEQUENCE_LIST 555
+#define _UNPACK_SEQUENCE_TUPLE 556
+#define _UNPACK_SEQUENCE_TWO_TUPLE 557
 #define _WITH_EXCEPT_START WITH_EXCEPT_START
 #define _YIELD_VALUE YIELD_VALUE
-#define MAX_UOP_ID 558
+#define MAX_UOP_ID 557
 
 #ifdef __cplusplus
 }
index 348ea644eee20729a52588d5ed27006bce212c66..bb519f53e34ba9df2872ca850fe533cf8035bc2f 100644 (file)
@@ -341,7 +341,6 @@ const uint16_t _PyUop_Flags[MAX_UOP_ID+1] = {
     [_TIER2_RESUME_CHECK] = HAS_PERIODIC_FLAG,
     [_COLD_EXIT] = 0,
     [_COLD_DYNAMIC_EXIT] = 0,
-    [_GUARD_EXECUTOR_IP] = HAS_EXIT_FLAG,
     [_GUARD_IP__PUSH_FRAME] = HAS_EXIT_FLAG,
     [_GUARD_IP_YIELD_VALUE] = HAS_EXIT_FLAG,
     [_GUARD_IP_RETURN_VALUE] = HAS_EXIT_FLAG,
@@ -482,7 +481,6 @@ const char *const _PyOpcode_uop_name[MAX_UOP_ID+1] = {
     [_GUARD_CALLABLE_TYPE_1] = "_GUARD_CALLABLE_TYPE_1",
     [_GUARD_DORV_NO_DICT] = "_GUARD_DORV_NO_DICT",
     [_GUARD_DORV_VALUES_INST_ATTR_FROM_DICT] = "_GUARD_DORV_VALUES_INST_ATTR_FROM_DICT",
-    [_GUARD_EXECUTOR_IP] = "_GUARD_EXECUTOR_IP",
     [_GUARD_GLOBALS_VERSION] = "_GUARD_GLOBALS_VERSION",
     [_GUARD_IP_RETURN_GENERATOR] = "_GUARD_IP_RETURN_GENERATOR",
     [_GUARD_IP_RETURN_VALUE] = "_GUARD_IP_RETURN_VALUE",
@@ -1331,8 +1329,6 @@ int _PyUop_num_popped(int opcode, int oparg)
             return 0;
         case _COLD_DYNAMIC_EXIT:
             return 0;
-        case _GUARD_EXECUTOR_IP:
-            return 0;
         case _GUARD_IP__PUSH_FRAME:
             return 0;
         case _GUARD_IP_YIELD_VALUE:
index ddd55e71fc190cf22cc265cb9b6375e88c04f877..3fcfab5ef159440d6f01eb9727172c78ee1a84ea 100644 (file)
@@ -2983,7 +2983,7 @@ dummy_func(
                     oparg >>= 8;
                     insert_exec_at--;
                 }
-                int succ = _PyJit_TryInitializeTracing(tstate, frame, this_instr, insert_exec_at, next_instr, STACK_LEVEL(), 0, NULL, NULL, oparg, false);
+                int succ = _PyJit_TryInitializeTracing(tstate, frame, this_instr, insert_exec_at, next_instr, STACK_LEVEL(), 0, NULL, NULL, oparg);
                 if (succ) {
                     ENTER_TRACING();
                 }
@@ -5303,9 +5303,8 @@ dummy_func(
             }
     #endif
             tstate->jit_exit = exit;
-            assert(exit->is_dynamic);
             _PyExecutorObject *exec = exit->executor;
-            assert(exec->trace[0].opcode == _COLD_DYNAMIC_EXIT || exec->trace[0].opcode == _START_DYNAMIC_EXECUTOR);
+            assert(exec->trace[0].opcode == _COLD_DYNAMIC_EXIT);
             TIER2_TO_TIER2(exec);
         }
 
@@ -5422,6 +5421,7 @@ dummy_func(
                 assert(tstate->jit_exit->executor == current_executor);
                 assert(tstate->current_executor == executor);
                 _PyExecutor_ClearExit(tstate->jit_exit);
+                _Py_set_eval_breaker_bit(tstate, _PY_EVAL_JIT_DO_NOT_REENTER);
                 // Note: this points to _DYNAMIC_DEOPT!!!
                 DEOPT_IF(true);
             }
@@ -5475,11 +5475,6 @@ dummy_func(
                 PyCodeObject *code = _PyFrame_GetCode(frame);
                 executor = code->co_executors->executors[target->op.arg];
                 Py_INCREF(executor);
-            #if Py_DEBUG
-                if (executor->trace[2].opcode == _GUARD_EXECUTOR_IP) {
-                    assert(executor->trace[2].operand0 == (uint64_t)target);
-                }
-            #endif
             }
             else {
                 if (frame->owner >= FRAME_OWNED_BY_INTERPRETER) {
@@ -5495,7 +5490,7 @@ dummy_func(
                 // Note: it's safe to use target->op.arg here instead of the oparg given by EXTENDED_ARG.
                 // The invariant in the optimizer is the deopt target always points back to the first EXTENDED_ARG.
                 // So setting it to anything else is wrong.
-                int succ = _PyJit_TryInitializeTracing(tstate, frame, target, target, target, STACK_LEVEL(), chain_depth, exit, previous_executor, target->op.arg, false);
+                int succ = _PyJit_TryInitializeTracing(tstate, frame, target, target, target, STACK_LEVEL(), chain_depth, exit, previous_executor, target->op.arg);
                 exit->temperature = restart_backoff_counter(exit->temperature);
                 if (succ) {
                     GOTO_TIER_ONE_CONTINUE_TRACING(target);
@@ -5510,50 +5505,10 @@ dummy_func(
         tier2 op(_COLD_DYNAMIC_EXIT, ( -- )) {
             _PyExitData *exit = tstate->jit_exit;
             assert(exit != NULL);
-            assert(exit->is_dynamic);
             _Py_CODEUNIT *target = frame->instr_ptr;
-            _Py_BackoffCounter temperature = exit->temperature;
-            _PyExecutorObject *executor;
-            if (target->op.code == ENTER_EXECUTOR) {
-                PyCodeObject *code = _PyFrame_GetCode(frame);
-                executor = code->co_executors->executors[target->op.arg];
-                if (executor->vm_data.valid &&
-                    executor->trace[0].opcode == _START_DYNAMIC_EXECUTOR) {
-                    assert(executor->trace[2].operand0 == (uint64_t)target);
-                    Py_INCREF(executor);
-                    assert(tstate->jit_exit == exit);
-                    exit->executor = executor;
-                    TIER2_TO_TIER2(executor);
-                }
-                else {
-                    GOTO_TIER_ONE(target);
-                }
-            }
-            if (frame->owner >= FRAME_OWNED_BY_INTERPRETER) {
-                GOTO_TIER_ONE(target);
-            }
-            if (!backoff_counter_triggers(temperature)) {
-                exit->temperature = advance_backoff_counter(temperature);
-                GOTO_TIER_ONE(target);
-            }
-            _PyExecutorObject *previous_executor = _PyExecutor_FromExit(exit);
-            assert(tstate->current_executor == (PyObject *)previous_executor);
-            int chain_depth = previous_executor->vm_data.chain_depth + 1;
-            int succ = _PyJit_TryInitializeTracing(tstate, frame, target, target, target, STACK_LEVEL(), chain_depth, exit, previous_executor, target->op.arg, true);
-            exit->temperature = restart_backoff_counter(exit->temperature);
-            if (succ) {
-                GOTO_TIER_ONE_CONTINUE_TRACING(target);
-            }
             GOTO_TIER_ONE(target);
         }
 
-        tier2 op(_GUARD_EXECUTOR_IP, (ip/4 --)) {
-            if (frame->instr_ptr != (_Py_CODEUNIT*)ip) {
-                _Py_set_eval_breaker_bit(tstate, _PY_EVAL_JIT_DO_NOT_REENTER);
-                EXIT_IF(true);
-            }
-        }
-
         tier2 op(_GUARD_IP__PUSH_FRAME, (ip/4 --)) {
             // Implementation automatically inserted by Tools/cases/tier2_generator.py
             EXIT_IF(true);
index 0b7781ccfdbde135ec2eb594cbc05845a5b66e43..074b0f8b86e95999072904ccca966d1c4861bdcc 100644 (file)
@@ -1216,8 +1216,7 @@ tier2_start:
     next_uop = current_executor->trace;
     assert(next_uop->opcode == _START_EXECUTOR ||
         next_uop->opcode == _COLD_EXIT ||
-        next_uop->opcode == _COLD_DYNAMIC_EXIT ||
-        next_uop->opcode == _START_DYNAMIC_EXECUTOR);
+        next_uop->opcode == _COLD_DYNAMIC_EXIT);
 
 #undef LOAD_IP
 #define LOAD_IP(UNUSED) (void)0
@@ -1243,8 +1242,7 @@ tier2_start:
 
     assert(next_uop->opcode == _START_EXECUTOR ||
         next_uop->opcode == _COLD_EXIT ||
-        next_uop->opcode == _COLD_DYNAMIC_EXIT ||
-        next_uop->opcode == _START_DYNAMIC_EXECUTOR);
+        next_uop->opcode == _COLD_DYNAMIC_EXIT);
 tier2_dispatch:
     for (;;) {
         uopcode = next_uop->opcode;
index c45bf72033b67c32d84c298a4ffb8aebd2ded092..826c8fc9af69ec9f36bc809c43d35ba72beaac1c 100644 (file)
             }
             #endif
             tstate->jit_exit = exit;
-            assert(exit->is_dynamic);
             _PyExecutorObject *exec = exit->executor;
-            assert(exec->trace[0].opcode == _COLD_DYNAMIC_EXIT || exec->trace[0].opcode == _START_DYNAMIC_EXECUTOR);
+            assert(exec->trace[0].opcode == _COLD_DYNAMIC_EXIT);
             TIER2_TO_TIER2(exec);
             break;
         }
                 _PyFrame_SetStackPointer(frame, stack_pointer);
                 _PyExecutor_ClearExit(tstate->jit_exit);
                 stack_pointer = _PyFrame_GetStackPointer(frame);
+                _Py_set_eval_breaker_bit(tstate, _PY_EVAL_JIT_DO_NOT_REENTER);
                 if (true) {
                     UOP_STAT_INC(uopcode, miss);
                     JUMP_TO_JUMP_TARGET();
                 PyCodeObject *code = _PyFrame_GetCode(frame);
                 executor = code->co_executors->executors[target->op.arg];
                 Py_INCREF(executor);
-                #if Py_DEBUG
-                if (executor->trace[2].opcode == _GUARD_EXECUTOR_IP) {
-                    assert(executor->trace[2].operand0 == (uint64_t)target);
-                }
-                #endif
             }
             else {
                 if (frame->owner >= FRAME_OWNED_BY_INTERPRETER) {
                 _PyExecutorObject *previous_executor = _PyExecutor_FromExit(exit);
                 assert(tstate->current_executor == (PyObject *)previous_executor);
                 int chain_depth = previous_executor->vm_data.chain_depth + 1;
-                int succ = _PyJit_TryInitializeTracing(tstate, frame, target, target, target, STACK_LEVEL(), chain_depth, exit, previous_executor, target->op.arg, false);
+                int succ = _PyJit_TryInitializeTracing(tstate, frame, target, target, target, STACK_LEVEL(), chain_depth, exit, previous_executor, target->op.arg);
                 exit->temperature = restart_backoff_counter(exit->temperature);
                 if (succ) {
                     GOTO_TIER_ONE_CONTINUE_TRACING(target);
         case _COLD_DYNAMIC_EXIT: {
             _PyExitData *exit = tstate->jit_exit;
             assert(exit != NULL);
-            assert(exit->is_dynamic);
             _Py_CODEUNIT *target = frame->instr_ptr;
-            _Py_BackoffCounter temperature = exit->temperature;
-            _PyExecutorObject *executor;
-            if (target->op.code == ENTER_EXECUTOR) {
-                PyCodeObject *code = _PyFrame_GetCode(frame);
-                executor = code->co_executors->executors[target->op.arg];
-                if (executor->vm_data.valid &&
-                    executor->trace[0].opcode == _START_DYNAMIC_EXECUTOR) {
-                    assert(executor->trace[2].operand0 == (uint64_t)target);
-                    Py_INCREF(executor);
-                    assert(tstate->jit_exit == exit);
-                    exit->executor = executor;
-                    TIER2_TO_TIER2(executor);
-                }
-                else {
-                    GOTO_TIER_ONE(target);
-                }
-            }
-            if (frame->owner >= FRAME_OWNED_BY_INTERPRETER) {
-                GOTO_TIER_ONE(target);
-            }
-            if (!backoff_counter_triggers(temperature)) {
-                exit->temperature = advance_backoff_counter(temperature);
-                GOTO_TIER_ONE(target);
-            }
-            _PyExecutorObject *previous_executor = _PyExecutor_FromExit(exit);
-            assert(tstate->current_executor == (PyObject *)previous_executor);
-            int chain_depth = previous_executor->vm_data.chain_depth + 1;
-            int succ = _PyJit_TryInitializeTracing(tstate, frame, target, target, target, STACK_LEVEL(), chain_depth, exit, previous_executor, target->op.arg, true);
-            exit->temperature = restart_backoff_counter(exit->temperature);
-            if (succ) {
-                GOTO_TIER_ONE_CONTINUE_TRACING(target);
-            }
             GOTO_TIER_ONE(target);
             break;
         }
 
-        case _GUARD_EXECUTOR_IP: {
-            PyObject *ip = (PyObject *)CURRENT_OPERAND0();
-            if (frame->instr_ptr != (_Py_CODEUNIT*)ip) {
-                _Py_set_eval_breaker_bit(tstate, _PY_EVAL_JIT_DO_NOT_REENTER);
-                if (true) {
-                    UOP_STAT_INC(uopcode, miss);
-                    JUMP_TO_JUMP_TARGET();
-                }
-            }
-            break;
-        }
-
         case _GUARD_IP_RETURN_VALUE: {
             PyObject *ip = (PyObject *)CURRENT_OPERAND0();
             if (frame->instr_ptr + (frame->return_offset) != (_Py_CODEUNIT *)ip) {
index 78e8422731ea61fdc825fb297bb9d871794ec6c3..c97a6a9dad8bb81072f83661fc3fa3be44216928 100644 (file)
                         oparg >>= 8;
                         insert_exec_at--;
                     }
-                    int succ = _PyJit_TryInitializeTracing(tstate, frame, this_instr, insert_exec_at, next_instr, STACK_LEVEL(), 0, NULL, NULL, oparg, false);
+                    int succ = _PyJit_TryInitializeTracing(tstate, frame, this_instr, insert_exec_at, next_instr, STACK_LEVEL(), 0, NULL, NULL, oparg);
                     if (succ) {
                         ENTER_TRACING();
                     }
index e507607f6ff366fb3ba8bfd9d35def756d93ea7a..268a3f3c3b6428d72ed04d80c03683833d990c2e 100644 (file)
@@ -941,7 +941,7 @@ full:
 
 // Returns 0 for do not enter tracing, 1 on enter tracing.
 int
-_PyJit_TryInitializeTracing(PyThreadState *tstate, _PyInterpreterFrame *frame, _Py_CODEUNIT *curr_instr, _Py_CODEUNIT *insert_exec_instr, _Py_CODEUNIT *close_loop_instr, int curr_stackdepth, int chain_depth, _PyExitData *exit, _PyExecutorObject *prev_exec, int oparg, bool is_dynamic_target)
+_PyJit_TryInitializeTracing(PyThreadState *tstate, _PyInterpreterFrame *frame, _Py_CODEUNIT *curr_instr, _Py_CODEUNIT *insert_exec_instr, _Py_CODEUNIT *close_loop_instr, int curr_stackdepth, int chain_depth, _PyExitData *exit, _PyExecutorObject *prev_exec, int oparg)
 {
     // A recursive trace.
     // Don't trace into the inner call because it will stomp on the previous trace, causing endless retraces.
@@ -968,19 +968,10 @@ _PyJit_TryInitializeTracing(PyThreadState *tstate, _PyInterpreterFrame *frame, _
         chain_depth);
 #endif
 
-    if (is_dynamic_target) {
-        assert(curr_instr == frame->instr_ptr);
-        assert(curr_instr == insert_exec_instr);
-        add_to_trace(tstate->interp->jit_state.code_buffer, 0, _START_DYNAMIC_EXECUTOR, 0, (uintptr_t)insert_exec_instr, 0);
-        add_to_trace(tstate->interp->jit_state.code_buffer, 1, _MAKE_WARM, 0, 0, 0);
-        add_to_trace(tstate->interp->jit_state.code_buffer, 2, _GUARD_EXECUTOR_IP, 0, (uintptr_t)curr_instr, 0);
-        tstate->interp->jit_state.code_curr_size = 3;
-    }
-    else {
-        add_to_trace(tstate->interp->jit_state.code_buffer, 0, _START_EXECUTOR, 0, (uintptr_t)insert_exec_instr, INSTR_IP(insert_exec_instr, code));
-        add_to_trace(tstate->interp->jit_state.code_buffer, 1, _MAKE_WARM, 0, 0, 0);
-        tstate->interp->jit_state.code_curr_size = 2;
-    }
+    add_to_trace(tstate->interp->jit_state.code_buffer, 0, _START_EXECUTOR, 0, (uintptr_t)insert_exec_instr, INSTR_IP(insert_exec_instr, code));
+    add_to_trace(tstate->interp->jit_state.code_buffer, 1, _MAKE_WARM, 0, 0, 0);
+    tstate->interp->jit_state.code_curr_size = 2;
+
     tstate->interp->jit_state.code_max_size = UOP_MAX_TRACE_LENGTH;
     tstate->interp->jit_state.insert_exec_instr = insert_exec_instr;
     tstate->interp->jit_state.close_loop_instr = close_loop_instr;
@@ -1100,15 +1091,11 @@ prepare_for_execution(_PyUOpInstruction *buffer, int length)
                 opcode == _GUARD_IP__PUSH_FRAME ||
                 opcode == _GUARD_IP_RETURN_VALUE ||
                 opcode == _GUARD_IP_YIELD_VALUE ||
-                opcode == _GUARD_IP_RETURN_GENERATOR ||
-                opcode == _GUARD_EXECUTOR_IP
+                opcode == _GUARD_IP_RETURN_GENERATOR
             ) {
                 exit_op = _DYNAMIC_EXIT;
                 unique_target = true;
             }
-            if (opcode == _START_DYNAMIC_EXECUTOR) {
-                exit_op = _DYNAMIC_DEOPT;
-            }
             if (unique_target || jump_target != current_jump_target || current_exit_op != exit_op) {
                 make_exit(&buffer[next_spare], exit_op, jump_target);
                 current_exit_op = exit_op;
@@ -1186,11 +1173,7 @@ sanity_check(_PyExecutorObject *executor)
     uint32_t i = 0;
     CHECK(executor->trace[0].opcode == _START_EXECUTOR ||
         executor->trace[0].opcode == _COLD_EXIT ||
-        executor->trace[0].opcode == _COLD_DYNAMIC_EXIT ||
-        executor->trace[0].opcode == _START_DYNAMIC_EXECUTOR);
-    if (executor->trace[0].opcode == _START_DYNAMIC_EXECUTOR) {
-        CHECK(executor->trace[2].opcode == _GUARD_EXECUTOR_IP);
-    }
+        executor->trace[0].opcode == _COLD_DYNAMIC_EXIT);
     for (; i < executor->code_size; i++) {
         const _PyUOpInstruction *inst = &executor->trace[i];
         uint16_t opcode = inst->opcode;
@@ -1255,7 +1238,7 @@ make_executor_from_uops(_PyUOpInstruction *buffer, int length, const _PyBloomFil
     }
     int next_exit = exit_count-1;
     _PyUOpInstruction *dest = (_PyUOpInstruction *)&executor->trace[length];
-    assert(buffer[0].opcode == _START_EXECUTOR || buffer[0].opcode == _START_DYNAMIC_EXECUTOR);
+    assert(buffer[0].opcode == _START_EXECUTOR);
     buffer[0].operand0 = (uint64_t)executor;
     for (int i = length-1; i >= 0; i--) {
         int opcode = buffer[i].opcode;
@@ -1272,7 +1255,7 @@ make_executor_from_uops(_PyUOpInstruction *buffer, int length, const _PyBloomFil
     }
     assert(next_exit == -1);
     assert(dest == executor->trace);
-    assert(dest->opcode == _START_EXECUTOR || dest->opcode == _START_DYNAMIC_EXECUTOR);
+    assert(dest->opcode == _START_EXECUTOR);
     _Py_ExecutorInit(executor, dependencies);
 #ifdef Py_DEBUG
     char *python_lltrace = Py_GETENV("PYTHON_LLTRACE");
index 50e5287c91aa914f07e378bbde302e521387ca0d..31affc93e7bb7d83b015f310720b9707a86d6118 100644 (file)
             break;
         }
 
-        case _GUARD_EXECUTOR_IP: {
-            break;
-        }
-
         case _GUARD_IP__PUSH_FRAME: {
             break;
         }