diff --git a/.gitattributes b/.gitattributes index 4f82cea7480cfe..b9aea3a25bed48 100644 --- a/.gitattributes +++ b/.gitattributes @@ -96,6 +96,7 @@ Python/Python-ast.c generated Python/executor_cases.c.h generated Python/generated_cases.c.h generated Python/optimizer_cases.c.h generated +Python/uop_super_matcher_cases.c.h generated Python/opcode_targets.h generated Python/stdlib_module_names.h generated Tools/peg_generator/pegen/grammar_parser.py generated diff --git a/Include/internal/pycore_uop_ids.h b/Include/internal/pycore_uop_ids.h index 8f71eab44d914d..3ccf982009f61b 100644 --- a/Include/internal/pycore_uop_ids.h +++ b/Include/internal/pycore_uop_ids.h @@ -64,17 +64,27 @@ extern "C" { #define _CHECK_EG_MATCH CHECK_EG_MATCH #define _CHECK_EXC_MATCH CHECK_EXC_MATCH #define _CHECK_FUNCTION_EXACT_ARGS 318 -#define _CHECK_GLOBALS 319 -#define _CHECK_MANAGED_OBJECT_HAS_VALUES 320 -#define _CHECK_PEP_523 321 -#define _CHECK_STACK_SPACE 322 -#define _CHECK_VALIDITY 323 -#define _CHECK_VALIDITY_AND_SET_IP 324 -#define _COLD_EXIT 325 -#define _COMPARE_OP 326 -#define _COMPARE_OP_FLOAT 327 -#define _COMPARE_OP_INT 328 -#define _COMPARE_OP_STR 329 +#define _CHECK_FUNCTION_EXACT_ARGS_0 319 +#define _CHECK_FUNCTION_EXACT_ARGS_1 320 +#define _CHECK_FUNCTION_EXACT_ARGS_2 321 +#define _CHECK_FUNCTION_EXACT_ARGS_3 322 +#define _CHECK_FUNCTION_EXACT_ARGS_4 323 +#define _CHECK_GLOBALS 324 +#define _CHECK_MANAGED_OBJECT_HAS_VALUES 325 +#define _CHECK_PEP_523 326 +#define _CHECK_STACK_SPACE 327 +#define _CHECK_STACK_SPACE_0 328 +#define _CHECK_STACK_SPACE_1 329 +#define _CHECK_STACK_SPACE_2 330 +#define _CHECK_STACK_SPACE_3 331 +#define _CHECK_STACK_SPACE_4 332 +#define _CHECK_VALIDITY 333 +#define _CHECK_VALIDITY_AND_SET_IP 334 +#define _COLD_EXIT 335 +#define _COMPARE_OP 336 +#define _COMPARE_OP_FLOAT 337 +#define _COMPARE_OP_INT 338 +#define _COMPARE_OP_STR 339 #define _CONTAINS_OP CONTAINS_OP #define _CONVERT_VALUE CONVERT_VALUE #define _COPY COPY @@ -89,41 +99,41 @@ extern "C" { #define _DICT_UPDATE DICT_UPDATE #define _END_SEND END_SEND #define _EXIT_INIT_CHECK EXIT_INIT_CHECK -#define _FATAL_ERROR 330 +#define _FATAL_ERROR 340 #define _FORMAT_SIMPLE FORMAT_SIMPLE #define _FORMAT_WITH_SPEC FORMAT_WITH_SPEC -#define _FOR_ITER 331 +#define _FOR_ITER 341 #define _FOR_ITER_GEN FOR_ITER_GEN -#define _FOR_ITER_TIER_TWO 332 +#define _FOR_ITER_TIER_TWO 342 #define _GET_AITER GET_AITER #define _GET_ANEXT GET_ANEXT #define _GET_AWAITABLE GET_AWAITABLE #define _GET_ITER GET_ITER #define _GET_LEN GET_LEN #define _GET_YIELD_FROM_ITER GET_YIELD_FROM_ITER -#define _GUARD_BOTH_FLOAT 333 -#define _GUARD_BOTH_INT 334 -#define _GUARD_BOTH_UNICODE 335 -#define _GUARD_BUILTINS_VERSION 336 -#define _GUARD_DORV_VALUES 337 -#define _GUARD_DORV_VALUES_INST_ATTR_FROM_DICT 338 -#define _GUARD_GLOBALS_VERSION 339 -#define _GUARD_IS_FALSE_POP 340 -#define _GUARD_IS_NONE_POP 341 -#define _GUARD_IS_NOT_NONE_POP 342 -#define _GUARD_IS_TRUE_POP 343 -#define _GUARD_KEYS_VERSION 344 -#define _GUARD_NOT_EXHAUSTED_LIST 345 -#define _GUARD_NOT_EXHAUSTED_RANGE 346 -#define _GUARD_NOT_EXHAUSTED_TUPLE 347 -#define _GUARD_TYPE_VERSION 348 -#define _INIT_CALL_BOUND_METHOD_EXACT_ARGS 349 -#define _INIT_CALL_PY_EXACT_ARGS 350 -#define _INIT_CALL_PY_EXACT_ARGS_0 351 -#define _INIT_CALL_PY_EXACT_ARGS_1 352 -#define _INIT_CALL_PY_EXACT_ARGS_2 353 -#define _INIT_CALL_PY_EXACT_ARGS_3 354 -#define _INIT_CALL_PY_EXACT_ARGS_4 355 +#define _GUARD_BOTH_FLOAT 343 +#define _GUARD_BOTH_INT 344 +#define _GUARD_BOTH_UNICODE 345 +#define _GUARD_BUILTINS_VERSION 346 +#define _GUARD_DORV_VALUES 347 +#define _GUARD_DORV_VALUES_INST_ATTR_FROM_DICT 348 +#define _GUARD_GLOBALS_VERSION 349 +#define _GUARD_IS_FALSE_POP 350 +#define _GUARD_IS_NONE_POP 351 +#define _GUARD_IS_NOT_NONE_POP 352 +#define _GUARD_IS_TRUE_POP 353 +#define _GUARD_KEYS_VERSION 354 +#define _GUARD_NOT_EXHAUSTED_LIST 355 +#define _GUARD_NOT_EXHAUSTED_RANGE 356 +#define _GUARD_NOT_EXHAUSTED_TUPLE 357 +#define _GUARD_TYPE_VERSION 358 +#define _INIT_CALL_BOUND_METHOD_EXACT_ARGS 359 +#define _INIT_CALL_PY_EXACT_ARGS 360 +#define _INIT_CALL_PY_EXACT_ARGS_0 361 +#define _INIT_CALL_PY_EXACT_ARGS_1 362 +#define _INIT_CALL_PY_EXACT_ARGS_2 363 +#define _INIT_CALL_PY_EXACT_ARGS_3 364 +#define _INIT_CALL_PY_EXACT_ARGS_4 365 #define _INSTRUMENTED_CALL INSTRUMENTED_CALL #define _INSTRUMENTED_CALL_FUNCTION_EX INSTRUMENTED_CALL_FUNCTION_EX #define _INSTRUMENTED_CALL_KW INSTRUMENTED_CALL_KW @@ -140,65 +150,65 @@ extern "C" { #define _INSTRUMENTED_RETURN_CONST INSTRUMENTED_RETURN_CONST #define _INSTRUMENTED_RETURN_VALUE INSTRUMENTED_RETURN_VALUE #define _INSTRUMENTED_YIELD_VALUE INSTRUMENTED_YIELD_VALUE -#define _INTERNAL_INCREMENT_OPT_COUNTER 356 -#define _IS_NONE 357 +#define _INTERNAL_INCREMENT_OPT_COUNTER 366 +#define _IS_NONE 367 #define _IS_OP IS_OP -#define _ITER_CHECK_LIST 358 -#define _ITER_CHECK_RANGE 359 -#define _ITER_CHECK_TUPLE 360 -#define _ITER_JUMP_LIST 361 -#define _ITER_JUMP_RANGE 362 -#define _ITER_JUMP_TUPLE 363 -#define _ITER_NEXT_LIST 364 -#define _ITER_NEXT_RANGE 365 -#define _ITER_NEXT_TUPLE 366 -#define _JUMP_TO_TOP 367 +#define _ITER_CHECK_LIST 368 +#define _ITER_CHECK_RANGE 369 +#define _ITER_CHECK_TUPLE 370 +#define _ITER_JUMP_LIST 371 +#define _ITER_JUMP_RANGE 372 +#define _ITER_JUMP_TUPLE 373 +#define _ITER_NEXT_LIST 374 +#define _ITER_NEXT_RANGE 375 +#define _ITER_NEXT_TUPLE 376 +#define _JUMP_TO_TOP 377 #define _LIST_APPEND LIST_APPEND #define _LIST_EXTEND LIST_EXTEND #define _LOAD_ASSERTION_ERROR LOAD_ASSERTION_ERROR -#define _LOAD_ATTR 368 -#define _LOAD_ATTR_CLASS 369 -#define _LOAD_ATTR_CLASS_0 370 -#define _LOAD_ATTR_CLASS_1 371 +#define _LOAD_ATTR 378 +#define _LOAD_ATTR_CLASS 379 +#define _LOAD_ATTR_CLASS_0 380 +#define _LOAD_ATTR_CLASS_1 381 #define _LOAD_ATTR_GETATTRIBUTE_OVERRIDDEN LOAD_ATTR_GETATTRIBUTE_OVERRIDDEN -#define _LOAD_ATTR_INSTANCE_VALUE 372 -#define _LOAD_ATTR_INSTANCE_VALUE_0 373 -#define _LOAD_ATTR_INSTANCE_VALUE_1 374 -#define _LOAD_ATTR_METHOD_LAZY_DICT 375 -#define _LOAD_ATTR_METHOD_NO_DICT 376 -#define _LOAD_ATTR_METHOD_WITH_VALUES 377 -#define _LOAD_ATTR_MODULE 378 -#define _LOAD_ATTR_NONDESCRIPTOR_NO_DICT 379 -#define _LOAD_ATTR_NONDESCRIPTOR_WITH_VALUES 380 +#define _LOAD_ATTR_INSTANCE_VALUE 382 +#define _LOAD_ATTR_INSTANCE_VALUE_0 383 +#define _LOAD_ATTR_INSTANCE_VALUE_1 384 +#define _LOAD_ATTR_METHOD_LAZY_DICT 385 +#define _LOAD_ATTR_METHOD_NO_DICT 386 +#define _LOAD_ATTR_METHOD_WITH_VALUES 387 +#define _LOAD_ATTR_MODULE 388 +#define _LOAD_ATTR_NONDESCRIPTOR_NO_DICT 389 +#define _LOAD_ATTR_NONDESCRIPTOR_WITH_VALUES 390 #define _LOAD_ATTR_PROPERTY LOAD_ATTR_PROPERTY -#define _LOAD_ATTR_SLOT 381 -#define _LOAD_ATTR_SLOT_0 382 -#define _LOAD_ATTR_SLOT_1 383 -#define _LOAD_ATTR_WITH_HINT 384 +#define _LOAD_ATTR_SLOT 391 +#define _LOAD_ATTR_SLOT_0 392 +#define _LOAD_ATTR_SLOT_1 393 +#define _LOAD_ATTR_WITH_HINT 394 #define _LOAD_BUILD_CLASS LOAD_BUILD_CLASS #define _LOAD_CONST LOAD_CONST -#define _LOAD_CONST_INLINE 385 -#define _LOAD_CONST_INLINE_BORROW 386 -#define _LOAD_CONST_INLINE_BORROW_WITH_NULL 387 -#define _LOAD_CONST_INLINE_WITH_NULL 388 +#define _LOAD_CONST_INLINE 395 +#define _LOAD_CONST_INLINE_BORROW 396 +#define _LOAD_CONST_INLINE_BORROW_WITH_NULL 397 +#define _LOAD_CONST_INLINE_WITH_NULL 398 #define _LOAD_DEREF LOAD_DEREF -#define _LOAD_FAST 389 -#define _LOAD_FAST_0 390 -#define _LOAD_FAST_1 391 -#define _LOAD_FAST_2 392 -#define _LOAD_FAST_3 393 -#define _LOAD_FAST_4 394 -#define _LOAD_FAST_5 395 -#define _LOAD_FAST_6 396 -#define _LOAD_FAST_7 397 +#define _LOAD_FAST 399 +#define _LOAD_FAST_0 400 +#define _LOAD_FAST_1 401 +#define _LOAD_FAST_2 402 +#define _LOAD_FAST_3 403 +#define _LOAD_FAST_4 404 +#define _LOAD_FAST_5 405 +#define _LOAD_FAST_6 406 +#define _LOAD_FAST_7 407 #define _LOAD_FAST_AND_CLEAR LOAD_FAST_AND_CLEAR #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 398 -#define _LOAD_GLOBAL_BUILTINS 399 -#define _LOAD_GLOBAL_MODULE 400 +#define _LOAD_GLOBAL 408 +#define _LOAD_GLOBAL_BUILTINS 409 +#define _LOAD_GLOBAL_MODULE 410 #define _LOAD_LOCALS LOAD_LOCALS #define _LOAD_NAME LOAD_NAME #define _LOAD_SUPER_ATTR_ATTR LOAD_SUPER_ATTR_ATTR @@ -212,47 +222,47 @@ extern "C" { #define _MATCH_SEQUENCE MATCH_SEQUENCE #define _NOP NOP #define _POP_EXCEPT POP_EXCEPT -#define _POP_FRAME 401 -#define _POP_JUMP_IF_FALSE 402 -#define _POP_JUMP_IF_TRUE 403 +#define _POP_FRAME 411 +#define _POP_JUMP_IF_FALSE 412 +#define _POP_JUMP_IF_TRUE 413 #define _POP_TOP POP_TOP -#define _POP_TOP_LOAD_CONST_INLINE_BORROW 404 +#define _POP_TOP_LOAD_CONST_INLINE_BORROW 414 #define _PUSH_EXC_INFO PUSH_EXC_INFO -#define _PUSH_FRAME 405 +#define _PUSH_FRAME 415 #define _PUSH_NULL PUSH_NULL #define _RESUME_CHECK RESUME_CHECK -#define _SAVE_RETURN_OFFSET 406 -#define _SEND 407 +#define _SAVE_RETURN_OFFSET 416 +#define _SEND 417 #define _SEND_GEN SEND_GEN #define _SETUP_ANNOTATIONS SETUP_ANNOTATIONS #define _SET_ADD SET_ADD #define _SET_FUNCTION_ATTRIBUTE SET_FUNCTION_ATTRIBUTE #define _SET_UPDATE SET_UPDATE -#define _START_EXECUTOR 408 -#define _STORE_ATTR 409 -#define _STORE_ATTR_INSTANCE_VALUE 410 -#define _STORE_ATTR_SLOT 411 +#define _START_EXECUTOR 418 +#define _STORE_ATTR 419 +#define _STORE_ATTR_INSTANCE_VALUE 420 +#define _STORE_ATTR_SLOT 421 #define _STORE_ATTR_WITH_HINT STORE_ATTR_WITH_HINT #define _STORE_DEREF STORE_DEREF -#define _STORE_FAST 412 -#define _STORE_FAST_0 413 -#define _STORE_FAST_1 414 -#define _STORE_FAST_2 415 -#define _STORE_FAST_3 416 -#define _STORE_FAST_4 417 -#define _STORE_FAST_5 418 -#define _STORE_FAST_6 419 -#define _STORE_FAST_7 420 +#define _STORE_FAST 422 +#define _STORE_FAST_0 423 +#define _STORE_FAST_1 424 +#define _STORE_FAST_2 425 +#define _STORE_FAST_3 426 +#define _STORE_FAST_4 427 +#define _STORE_FAST_5 428 +#define _STORE_FAST_6 429 +#define _STORE_FAST_7 430 #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 STORE_SLICE -#define _STORE_SUBSCR 421 +#define _STORE_SUBSCR 431 #define _STORE_SUBSCR_DICT STORE_SUBSCR_DICT #define _STORE_SUBSCR_LIST_INT STORE_SUBSCR_LIST_INT #define _SWAP SWAP -#define _TO_BOOL 422 +#define _TO_BOOL 432 #define _TO_BOOL_ALWAYS_TRUE TO_BOOL_ALWAYS_TRUE #define _TO_BOOL_BOOL TO_BOOL_BOOL #define _TO_BOOL_INT TO_BOOL_INT @@ -263,12 +273,160 @@ extern "C" { #define _UNARY_NEGATIVE UNARY_NEGATIVE #define _UNARY_NOT UNARY_NOT #define _UNPACK_EX UNPACK_EX -#define _UNPACK_SEQUENCE 423 +#define _UNPACK_SEQUENCE 433 #define _UNPACK_SEQUENCE_LIST UNPACK_SEQUENCE_LIST #define _UNPACK_SEQUENCE_TUPLE UNPACK_SEQUENCE_TUPLE #define _UNPACK_SEQUENCE_TWO_TUPLE UNPACK_SEQUENCE_TWO_TUPLE #define _WITH_EXCEPT_START WITH_EXCEPT_START -#define MAX_UOP_ID 423 +#define _CALL_BOUND_METHOD_EXACT_ARGS 434 +#define _CALL_BOUND_METHOD_EXACT_ARGS_0 435 +#define _CALL_BOUND_METHOD_EXACT_ARGS_1 436 +#define _CALL_BOUND_METHOD_EXACT_ARGS_2 437 +#define _CALL_BOUND_METHOD_EXACT_ARGS_3 438 +#define _CALL_BOUND_METHOD_EXACT_ARGS_4 439 +#define _CHECK_CALL_PY_EXACT_ARGS 440 +#define _CHECK_CALL_PY_EXACT_ARGS_0 441 +#define _CHECK_CALL_PY_EXACT_ARGS_1 442 +#define _CHECK_CALL_PY_EXACT_ARGS_2 443 +#define _CHECK_CALL_PY_EXACT_ARGS_3 444 +#define _CHECK_CALL_PY_EXACT_ARGS_4 445 +#define _GUARD_BOTH_FLOAT__BINARY_OP_ADD_FLOAT 446 +#define _GUARD_BOTH_FLOAT__BINARY_OP_MULTIPLY_FLOAT 447 +#define _GUARD_BOTH_FLOAT__BINARY_OP_SUBTRACT_FLOAT 448 +#define _GUARD_BOTH_INT__BINARY_OP_ADD_INT 449 +#define _GUARD_BOTH_INT__BINARY_OP_MULTIPLY_INT 450 +#define _GUARD_BOTH_INT__BINARY_OP_SUBTRACT_INT 451 +#define _GUARD_BOTH_UNICODE__BINARY_OP_ADD_UNICODE 452 +#define _SAVE_RETURN_OFFSET__PUSH_FRAME 453 +#define __LOAD_FAST_0__LOAD_FAST_0 454 +#define __LOAD_FAST_0__LOAD_FAST_1 455 +#define __LOAD_FAST_0__LOAD_FAST_2 456 +#define __LOAD_FAST_0__LOAD_FAST_3 457 +#define __LOAD_FAST_0__LOAD_FAST_4 458 +#define __LOAD_FAST_0__LOAD_FAST_5 459 +#define __LOAD_FAST_0__LOAD_FAST_6 460 +#define __LOAD_FAST_0__LOAD_FAST_7 461 +#define __LOAD_FAST_1__LOAD_FAST_0 462 +#define __LOAD_FAST_1__LOAD_FAST_1 463 +#define __LOAD_FAST_1__LOAD_FAST_2 464 +#define __LOAD_FAST_1__LOAD_FAST_3 465 +#define __LOAD_FAST_1__LOAD_FAST_4 466 +#define __LOAD_FAST_1__LOAD_FAST_5 467 +#define __LOAD_FAST_1__LOAD_FAST_6 468 +#define __LOAD_FAST_1__LOAD_FAST_7 469 +#define __LOAD_FAST_2__LOAD_FAST_0 470 +#define __LOAD_FAST_2__LOAD_FAST_1 471 +#define __LOAD_FAST_2__LOAD_FAST_2 472 +#define __LOAD_FAST_2__LOAD_FAST_3 473 +#define __LOAD_FAST_2__LOAD_FAST_4 474 +#define __LOAD_FAST_2__LOAD_FAST_5 475 +#define __LOAD_FAST_2__LOAD_FAST_6 476 +#define __LOAD_FAST_2__LOAD_FAST_7 477 +#define __LOAD_FAST_3__LOAD_FAST_0 478 +#define __LOAD_FAST_3__LOAD_FAST_1 479 +#define __LOAD_FAST_3__LOAD_FAST_2 480 +#define __LOAD_FAST_3__LOAD_FAST_3 481 +#define __LOAD_FAST_3__LOAD_FAST_4 482 +#define __LOAD_FAST_3__LOAD_FAST_5 483 +#define __LOAD_FAST_3__LOAD_FAST_6 484 +#define __LOAD_FAST_3__LOAD_FAST_7 485 +#define __LOAD_FAST_4__LOAD_FAST_0 486 +#define __LOAD_FAST_4__LOAD_FAST_1 487 +#define __LOAD_FAST_4__LOAD_FAST_2 488 +#define __LOAD_FAST_4__LOAD_FAST_3 489 +#define __LOAD_FAST_4__LOAD_FAST_4 490 +#define __LOAD_FAST_4__LOAD_FAST_5 491 +#define __LOAD_FAST_4__LOAD_FAST_6 492 +#define __LOAD_FAST_4__LOAD_FAST_7 493 +#define __LOAD_FAST_5__LOAD_FAST_0 494 +#define __LOAD_FAST_5__LOAD_FAST_1 495 +#define __LOAD_FAST_5__LOAD_FAST_2 496 +#define __LOAD_FAST_5__LOAD_FAST_3 497 +#define __LOAD_FAST_5__LOAD_FAST_4 498 +#define __LOAD_FAST_5__LOAD_FAST_5 499 +#define __LOAD_FAST_5__LOAD_FAST_6 500 +#define __LOAD_FAST_5__LOAD_FAST_7 501 +#define __LOAD_FAST_6__LOAD_FAST_0 502 +#define __LOAD_FAST_6__LOAD_FAST_1 503 +#define __LOAD_FAST_6__LOAD_FAST_2 504 +#define __LOAD_FAST_6__LOAD_FAST_3 505 +#define __LOAD_FAST_6__LOAD_FAST_4 506 +#define __LOAD_FAST_6__LOAD_FAST_5 507 +#define __LOAD_FAST_6__LOAD_FAST_6 508 +#define __LOAD_FAST_6__LOAD_FAST_7 509 +#define __LOAD_FAST_7__LOAD_FAST_0 510 +#define __LOAD_FAST_7__LOAD_FAST_1 511 +#define __LOAD_FAST_7__LOAD_FAST_2 512 +#define __LOAD_FAST_7__LOAD_FAST_3 513 +#define __LOAD_FAST_7__LOAD_FAST_4 514 +#define __LOAD_FAST_7__LOAD_FAST_5 515 +#define __LOAD_FAST_7__LOAD_FAST_6 516 +#define __LOAD_FAST_7__LOAD_FAST_7 517 +#define __STORE_FAST_0__LOAD_FAST_0 518 +#define __STORE_FAST_0__LOAD_FAST_1 519 +#define __STORE_FAST_0__LOAD_FAST_2 520 +#define __STORE_FAST_0__LOAD_FAST_3 521 +#define __STORE_FAST_0__LOAD_FAST_4 522 +#define __STORE_FAST_0__LOAD_FAST_5 523 +#define __STORE_FAST_0__LOAD_FAST_6 524 +#define __STORE_FAST_0__LOAD_FAST_7 525 +#define __STORE_FAST_1__LOAD_FAST_0 526 +#define __STORE_FAST_1__LOAD_FAST_1 527 +#define __STORE_FAST_1__LOAD_FAST_2 528 +#define __STORE_FAST_1__LOAD_FAST_3 529 +#define __STORE_FAST_1__LOAD_FAST_4 530 +#define __STORE_FAST_1__LOAD_FAST_5 531 +#define __STORE_FAST_1__LOAD_FAST_6 532 +#define __STORE_FAST_1__LOAD_FAST_7 533 +#define __STORE_FAST_2__LOAD_FAST_0 534 +#define __STORE_FAST_2__LOAD_FAST_1 535 +#define __STORE_FAST_2__LOAD_FAST_2 536 +#define __STORE_FAST_2__LOAD_FAST_3 537 +#define __STORE_FAST_2__LOAD_FAST_4 538 +#define __STORE_FAST_2__LOAD_FAST_5 539 +#define __STORE_FAST_2__LOAD_FAST_6 540 +#define __STORE_FAST_2__LOAD_FAST_7 541 +#define __STORE_FAST_3__LOAD_FAST_0 542 +#define __STORE_FAST_3__LOAD_FAST_1 543 +#define __STORE_FAST_3__LOAD_FAST_2 544 +#define __STORE_FAST_3__LOAD_FAST_3 545 +#define __STORE_FAST_3__LOAD_FAST_4 546 +#define __STORE_FAST_3__LOAD_FAST_5 547 +#define __STORE_FAST_3__LOAD_FAST_6 548 +#define __STORE_FAST_3__LOAD_FAST_7 549 +#define __STORE_FAST_4__LOAD_FAST_0 550 +#define __STORE_FAST_4__LOAD_FAST_1 551 +#define __STORE_FAST_4__LOAD_FAST_2 552 +#define __STORE_FAST_4__LOAD_FAST_3 553 +#define __STORE_FAST_4__LOAD_FAST_4 554 +#define __STORE_FAST_4__LOAD_FAST_5 555 +#define __STORE_FAST_4__LOAD_FAST_6 556 +#define __STORE_FAST_4__LOAD_FAST_7 557 +#define __STORE_FAST_5__LOAD_FAST_0 558 +#define __STORE_FAST_5__LOAD_FAST_1 559 +#define __STORE_FAST_5__LOAD_FAST_2 560 +#define __STORE_FAST_5__LOAD_FAST_3 561 +#define __STORE_FAST_5__LOAD_FAST_4 562 +#define __STORE_FAST_5__LOAD_FAST_5 563 +#define __STORE_FAST_5__LOAD_FAST_6 564 +#define __STORE_FAST_5__LOAD_FAST_7 565 +#define __STORE_FAST_6__LOAD_FAST_0 566 +#define __STORE_FAST_6__LOAD_FAST_1 567 +#define __STORE_FAST_6__LOAD_FAST_2 568 +#define __STORE_FAST_6__LOAD_FAST_3 569 +#define __STORE_FAST_6__LOAD_FAST_4 570 +#define __STORE_FAST_6__LOAD_FAST_5 571 +#define __STORE_FAST_6__LOAD_FAST_6 572 +#define __STORE_FAST_6__LOAD_FAST_7 573 +#define __STORE_FAST_7__LOAD_FAST_0 574 +#define __STORE_FAST_7__LOAD_FAST_1 575 +#define __STORE_FAST_7__LOAD_FAST_2 576 +#define __STORE_FAST_7__LOAD_FAST_3 577 +#define __STORE_FAST_7__LOAD_FAST_4 578 +#define __STORE_FAST_7__LOAD_FAST_5 579 +#define __STORE_FAST_7__LOAD_FAST_6 580 +#define __STORE_FAST_7__LOAD_FAST_7 581 +#define MAX_UOP_ID 581 #ifdef __cplusplus } diff --git a/Include/internal/pycore_uop_metadata.h b/Include/internal/pycore_uop_metadata.h index 7f921a6cd3f4c8..507a57b332ee1d 100644 --- a/Include/internal/pycore_uop_metadata.h +++ b/Include/internal/pycore_uop_metadata.h @@ -189,7 +189,17 @@ const uint16_t _PyUop_Flags[MAX_UOP_ID+1] = { [_CHECK_CALL_BOUND_METHOD_EXACT_ARGS] = HAS_ARG_FLAG | HAS_DEOPT_FLAG | HAS_PASSTHROUGH_FLAG, [_INIT_CALL_BOUND_METHOD_EXACT_ARGS] = HAS_ARG_FLAG, [_CHECK_PEP_523] = HAS_DEOPT_FLAG, + [_CHECK_FUNCTION_EXACT_ARGS_0] = HAS_DEOPT_FLAG | HAS_PASSTHROUGH_FLAG, + [_CHECK_FUNCTION_EXACT_ARGS_1] = HAS_DEOPT_FLAG | HAS_PASSTHROUGH_FLAG, + [_CHECK_FUNCTION_EXACT_ARGS_2] = HAS_DEOPT_FLAG | HAS_PASSTHROUGH_FLAG, + [_CHECK_FUNCTION_EXACT_ARGS_3] = HAS_DEOPT_FLAG | HAS_PASSTHROUGH_FLAG, + [_CHECK_FUNCTION_EXACT_ARGS_4] = HAS_DEOPT_FLAG | HAS_PASSTHROUGH_FLAG, [_CHECK_FUNCTION_EXACT_ARGS] = HAS_ARG_FLAG | HAS_DEOPT_FLAG | HAS_PASSTHROUGH_FLAG, + [_CHECK_STACK_SPACE_0] = HAS_DEOPT_FLAG | HAS_PASSTHROUGH_FLAG, + [_CHECK_STACK_SPACE_1] = HAS_DEOPT_FLAG | HAS_PASSTHROUGH_FLAG, + [_CHECK_STACK_SPACE_2] = HAS_DEOPT_FLAG | HAS_PASSTHROUGH_FLAG, + [_CHECK_STACK_SPACE_3] = HAS_DEOPT_FLAG | HAS_PASSTHROUGH_FLAG, + [_CHECK_STACK_SPACE_4] = HAS_DEOPT_FLAG | HAS_PASSTHROUGH_FLAG, [_CHECK_STACK_SPACE] = HAS_ARG_FLAG | HAS_DEOPT_FLAG | HAS_PASSTHROUGH_FLAG, [_INIT_CALL_PY_EXACT_ARGS_0] = HAS_ESCAPES_FLAG | HAS_PURE_FLAG, [_INIT_CALL_PY_EXACT_ARGS_1] = HAS_ESCAPES_FLAG | HAS_PURE_FLAG, @@ -247,6 +257,8 @@ const uint16_t _PyUop_Flags[MAX_UOP_ID+1] = { const uint8_t _PyUop_Replication[MAX_UOP_ID+1] = { [_LOAD_FAST] = 8, [_STORE_FAST] = 8, + [_CHECK_FUNCTION_EXACT_ARGS] = 5, + [_CHECK_STACK_SPACE] = 5, [_INIT_CALL_PY_EXACT_ARGS] = 5, }; @@ -298,10 +310,20 @@ const char *const _PyOpcode_uop_name[MAX_UOP_ID+1] = { [_CHECK_EG_MATCH] = "_CHECK_EG_MATCH", [_CHECK_EXC_MATCH] = "_CHECK_EXC_MATCH", [_CHECK_FUNCTION_EXACT_ARGS] = "_CHECK_FUNCTION_EXACT_ARGS", + [_CHECK_FUNCTION_EXACT_ARGS_0] = "_CHECK_FUNCTION_EXACT_ARGS_0", + [_CHECK_FUNCTION_EXACT_ARGS_1] = "_CHECK_FUNCTION_EXACT_ARGS_1", + [_CHECK_FUNCTION_EXACT_ARGS_2] = "_CHECK_FUNCTION_EXACT_ARGS_2", + [_CHECK_FUNCTION_EXACT_ARGS_3] = "_CHECK_FUNCTION_EXACT_ARGS_3", + [_CHECK_FUNCTION_EXACT_ARGS_4] = "_CHECK_FUNCTION_EXACT_ARGS_4", [_CHECK_GLOBALS] = "_CHECK_GLOBALS", [_CHECK_MANAGED_OBJECT_HAS_VALUES] = "_CHECK_MANAGED_OBJECT_HAS_VALUES", [_CHECK_PEP_523] = "_CHECK_PEP_523", [_CHECK_STACK_SPACE] = "_CHECK_STACK_SPACE", + [_CHECK_STACK_SPACE_0] = "_CHECK_STACK_SPACE_0", + [_CHECK_STACK_SPACE_1] = "_CHECK_STACK_SPACE_1", + [_CHECK_STACK_SPACE_2] = "_CHECK_STACK_SPACE_2", + [_CHECK_STACK_SPACE_3] = "_CHECK_STACK_SPACE_3", + [_CHECK_STACK_SPACE_4] = "_CHECK_STACK_SPACE_4", [_CHECK_VALIDITY] = "_CHECK_VALIDITY", [_CHECK_VALIDITY_AND_SET_IP] = "_CHECK_VALIDITY_AND_SET_IP", [_COLD_EXIT] = "_COLD_EXIT", @@ -476,6 +498,154 @@ const char *const _PyOpcode_uop_name[MAX_UOP_ID+1] = { [_UNPACK_SEQUENCE_TUPLE] = "_UNPACK_SEQUENCE_TUPLE", [_UNPACK_SEQUENCE_TWO_TUPLE] = "_UNPACK_SEQUENCE_TWO_TUPLE", [_WITH_EXCEPT_START] = "_WITH_EXCEPT_START", + [_CALL_BOUND_METHOD_EXACT_ARGS] = "_CALL_BOUND_METHOD_EXACT_ARGS", + [_CALL_BOUND_METHOD_EXACT_ARGS_0] = "_CALL_BOUND_METHOD_EXACT_ARGS_0", + [_CALL_BOUND_METHOD_EXACT_ARGS_1] = "_CALL_BOUND_METHOD_EXACT_ARGS_1", + [_CALL_BOUND_METHOD_EXACT_ARGS_2] = "_CALL_BOUND_METHOD_EXACT_ARGS_2", + [_CALL_BOUND_METHOD_EXACT_ARGS_3] = "_CALL_BOUND_METHOD_EXACT_ARGS_3", + [_CALL_BOUND_METHOD_EXACT_ARGS_4] = "_CALL_BOUND_METHOD_EXACT_ARGS_4", + [_CHECK_CALL_PY_EXACT_ARGS] = "_CHECK_CALL_PY_EXACT_ARGS", + [_CHECK_CALL_PY_EXACT_ARGS_0] = "_CHECK_CALL_PY_EXACT_ARGS_0", + [_CHECK_CALL_PY_EXACT_ARGS_1] = "_CHECK_CALL_PY_EXACT_ARGS_1", + [_CHECK_CALL_PY_EXACT_ARGS_2] = "_CHECK_CALL_PY_EXACT_ARGS_2", + [_CHECK_CALL_PY_EXACT_ARGS_3] = "_CHECK_CALL_PY_EXACT_ARGS_3", + [_CHECK_CALL_PY_EXACT_ARGS_4] = "_CHECK_CALL_PY_EXACT_ARGS_4", + [_GUARD_BOTH_FLOAT__BINARY_OP_ADD_FLOAT] = "_GUARD_BOTH_FLOAT__BINARY_OP_ADD_FLOAT", + [_GUARD_BOTH_FLOAT__BINARY_OP_MULTIPLY_FLOAT] = "_GUARD_BOTH_FLOAT__BINARY_OP_MULTIPLY_FLOAT", + [_GUARD_BOTH_FLOAT__BINARY_OP_SUBTRACT_FLOAT] = "_GUARD_BOTH_FLOAT__BINARY_OP_SUBTRACT_FLOAT", + [_GUARD_BOTH_INT__BINARY_OP_ADD_INT] = "_GUARD_BOTH_INT__BINARY_OP_ADD_INT", + [_GUARD_BOTH_INT__BINARY_OP_MULTIPLY_INT] = "_GUARD_BOTH_INT__BINARY_OP_MULTIPLY_INT", + [_GUARD_BOTH_INT__BINARY_OP_SUBTRACT_INT] = "_GUARD_BOTH_INT__BINARY_OP_SUBTRACT_INT", + [_GUARD_BOTH_UNICODE__BINARY_OP_ADD_UNICODE] = "_GUARD_BOTH_UNICODE__BINARY_OP_ADD_UNICODE", + [_SAVE_RETURN_OFFSET__PUSH_FRAME] = "_SAVE_RETURN_OFFSET__PUSH_FRAME", + [__LOAD_FAST_0__LOAD_FAST_0] = "__LOAD_FAST_0__LOAD_FAST_0", + [__LOAD_FAST_0__LOAD_FAST_1] = "__LOAD_FAST_0__LOAD_FAST_1", + [__LOAD_FAST_0__LOAD_FAST_2] = "__LOAD_FAST_0__LOAD_FAST_2", + [__LOAD_FAST_0__LOAD_FAST_3] = "__LOAD_FAST_0__LOAD_FAST_3", + [__LOAD_FAST_0__LOAD_FAST_4] = "__LOAD_FAST_0__LOAD_FAST_4", + [__LOAD_FAST_0__LOAD_FAST_5] = "__LOAD_FAST_0__LOAD_FAST_5", + [__LOAD_FAST_0__LOAD_FAST_6] = "__LOAD_FAST_0__LOAD_FAST_6", + [__LOAD_FAST_0__LOAD_FAST_7] = "__LOAD_FAST_0__LOAD_FAST_7", + [__LOAD_FAST_1__LOAD_FAST_0] = "__LOAD_FAST_1__LOAD_FAST_0", + [__LOAD_FAST_1__LOAD_FAST_1] = "__LOAD_FAST_1__LOAD_FAST_1", + [__LOAD_FAST_1__LOAD_FAST_2] = "__LOAD_FAST_1__LOAD_FAST_2", + [__LOAD_FAST_1__LOAD_FAST_3] = "__LOAD_FAST_1__LOAD_FAST_3", + [__LOAD_FAST_1__LOAD_FAST_4] = "__LOAD_FAST_1__LOAD_FAST_4", + [__LOAD_FAST_1__LOAD_FAST_5] = "__LOAD_FAST_1__LOAD_FAST_5", + [__LOAD_FAST_1__LOAD_FAST_6] = "__LOAD_FAST_1__LOAD_FAST_6", + [__LOAD_FAST_1__LOAD_FAST_7] = "__LOAD_FAST_1__LOAD_FAST_7", + [__LOAD_FAST_2__LOAD_FAST_0] = "__LOAD_FAST_2__LOAD_FAST_0", + [__LOAD_FAST_2__LOAD_FAST_1] = "__LOAD_FAST_2__LOAD_FAST_1", + [__LOAD_FAST_2__LOAD_FAST_2] = "__LOAD_FAST_2__LOAD_FAST_2", + [__LOAD_FAST_2__LOAD_FAST_3] = "__LOAD_FAST_2__LOAD_FAST_3", + [__LOAD_FAST_2__LOAD_FAST_4] = "__LOAD_FAST_2__LOAD_FAST_4", + [__LOAD_FAST_2__LOAD_FAST_5] = "__LOAD_FAST_2__LOAD_FAST_5", + [__LOAD_FAST_2__LOAD_FAST_6] = "__LOAD_FAST_2__LOAD_FAST_6", + [__LOAD_FAST_2__LOAD_FAST_7] = "__LOAD_FAST_2__LOAD_FAST_7", + [__LOAD_FAST_3__LOAD_FAST_0] = "__LOAD_FAST_3__LOAD_FAST_0", + [__LOAD_FAST_3__LOAD_FAST_1] = "__LOAD_FAST_3__LOAD_FAST_1", + [__LOAD_FAST_3__LOAD_FAST_2] = "__LOAD_FAST_3__LOAD_FAST_2", + [__LOAD_FAST_3__LOAD_FAST_3] = "__LOAD_FAST_3__LOAD_FAST_3", + [__LOAD_FAST_3__LOAD_FAST_4] = "__LOAD_FAST_3__LOAD_FAST_4", + [__LOAD_FAST_3__LOAD_FAST_5] = "__LOAD_FAST_3__LOAD_FAST_5", + [__LOAD_FAST_3__LOAD_FAST_6] = "__LOAD_FAST_3__LOAD_FAST_6", + [__LOAD_FAST_3__LOAD_FAST_7] = "__LOAD_FAST_3__LOAD_FAST_7", + [__LOAD_FAST_4__LOAD_FAST_0] = "__LOAD_FAST_4__LOAD_FAST_0", + [__LOAD_FAST_4__LOAD_FAST_1] = "__LOAD_FAST_4__LOAD_FAST_1", + [__LOAD_FAST_4__LOAD_FAST_2] = "__LOAD_FAST_4__LOAD_FAST_2", + [__LOAD_FAST_4__LOAD_FAST_3] = "__LOAD_FAST_4__LOAD_FAST_3", + [__LOAD_FAST_4__LOAD_FAST_4] = "__LOAD_FAST_4__LOAD_FAST_4", + [__LOAD_FAST_4__LOAD_FAST_5] = "__LOAD_FAST_4__LOAD_FAST_5", + [__LOAD_FAST_4__LOAD_FAST_6] = "__LOAD_FAST_4__LOAD_FAST_6", + [__LOAD_FAST_4__LOAD_FAST_7] = "__LOAD_FAST_4__LOAD_FAST_7", + [__LOAD_FAST_5__LOAD_FAST_0] = "__LOAD_FAST_5__LOAD_FAST_0", + [__LOAD_FAST_5__LOAD_FAST_1] = "__LOAD_FAST_5__LOAD_FAST_1", + [__LOAD_FAST_5__LOAD_FAST_2] = "__LOAD_FAST_5__LOAD_FAST_2", + [__LOAD_FAST_5__LOAD_FAST_3] = "__LOAD_FAST_5__LOAD_FAST_3", + [__LOAD_FAST_5__LOAD_FAST_4] = "__LOAD_FAST_5__LOAD_FAST_4", + [__LOAD_FAST_5__LOAD_FAST_5] = "__LOAD_FAST_5__LOAD_FAST_5", + [__LOAD_FAST_5__LOAD_FAST_6] = "__LOAD_FAST_5__LOAD_FAST_6", + [__LOAD_FAST_5__LOAD_FAST_7] = "__LOAD_FAST_5__LOAD_FAST_7", + [__LOAD_FAST_6__LOAD_FAST_0] = "__LOAD_FAST_6__LOAD_FAST_0", + [__LOAD_FAST_6__LOAD_FAST_1] = "__LOAD_FAST_6__LOAD_FAST_1", + [__LOAD_FAST_6__LOAD_FAST_2] = "__LOAD_FAST_6__LOAD_FAST_2", + [__LOAD_FAST_6__LOAD_FAST_3] = "__LOAD_FAST_6__LOAD_FAST_3", + [__LOAD_FAST_6__LOAD_FAST_4] = "__LOAD_FAST_6__LOAD_FAST_4", + [__LOAD_FAST_6__LOAD_FAST_5] = "__LOAD_FAST_6__LOAD_FAST_5", + [__LOAD_FAST_6__LOAD_FAST_6] = "__LOAD_FAST_6__LOAD_FAST_6", + [__LOAD_FAST_6__LOAD_FAST_7] = "__LOAD_FAST_6__LOAD_FAST_7", + [__LOAD_FAST_7__LOAD_FAST_0] = "__LOAD_FAST_7__LOAD_FAST_0", + [__LOAD_FAST_7__LOAD_FAST_1] = "__LOAD_FAST_7__LOAD_FAST_1", + [__LOAD_FAST_7__LOAD_FAST_2] = "__LOAD_FAST_7__LOAD_FAST_2", + [__LOAD_FAST_7__LOAD_FAST_3] = "__LOAD_FAST_7__LOAD_FAST_3", + [__LOAD_FAST_7__LOAD_FAST_4] = "__LOAD_FAST_7__LOAD_FAST_4", + [__LOAD_FAST_7__LOAD_FAST_5] = "__LOAD_FAST_7__LOAD_FAST_5", + [__LOAD_FAST_7__LOAD_FAST_6] = "__LOAD_FAST_7__LOAD_FAST_6", + [__LOAD_FAST_7__LOAD_FAST_7] = "__LOAD_FAST_7__LOAD_FAST_7", + [__STORE_FAST_0__LOAD_FAST_0] = "__STORE_FAST_0__LOAD_FAST_0", + [__STORE_FAST_0__LOAD_FAST_1] = "__STORE_FAST_0__LOAD_FAST_1", + [__STORE_FAST_0__LOAD_FAST_2] = "__STORE_FAST_0__LOAD_FAST_2", + [__STORE_FAST_0__LOAD_FAST_3] = "__STORE_FAST_0__LOAD_FAST_3", + [__STORE_FAST_0__LOAD_FAST_4] = "__STORE_FAST_0__LOAD_FAST_4", + [__STORE_FAST_0__LOAD_FAST_5] = "__STORE_FAST_0__LOAD_FAST_5", + [__STORE_FAST_0__LOAD_FAST_6] = "__STORE_FAST_0__LOAD_FAST_6", + [__STORE_FAST_0__LOAD_FAST_7] = "__STORE_FAST_0__LOAD_FAST_7", + [__STORE_FAST_1__LOAD_FAST_0] = "__STORE_FAST_1__LOAD_FAST_0", + [__STORE_FAST_1__LOAD_FAST_1] = "__STORE_FAST_1__LOAD_FAST_1", + [__STORE_FAST_1__LOAD_FAST_2] = "__STORE_FAST_1__LOAD_FAST_2", + [__STORE_FAST_1__LOAD_FAST_3] = "__STORE_FAST_1__LOAD_FAST_3", + [__STORE_FAST_1__LOAD_FAST_4] = "__STORE_FAST_1__LOAD_FAST_4", + [__STORE_FAST_1__LOAD_FAST_5] = "__STORE_FAST_1__LOAD_FAST_5", + [__STORE_FAST_1__LOAD_FAST_6] = "__STORE_FAST_1__LOAD_FAST_6", + [__STORE_FAST_1__LOAD_FAST_7] = "__STORE_FAST_1__LOAD_FAST_7", + [__STORE_FAST_2__LOAD_FAST_0] = "__STORE_FAST_2__LOAD_FAST_0", + [__STORE_FAST_2__LOAD_FAST_1] = "__STORE_FAST_2__LOAD_FAST_1", + [__STORE_FAST_2__LOAD_FAST_2] = "__STORE_FAST_2__LOAD_FAST_2", + [__STORE_FAST_2__LOAD_FAST_3] = "__STORE_FAST_2__LOAD_FAST_3", + [__STORE_FAST_2__LOAD_FAST_4] = "__STORE_FAST_2__LOAD_FAST_4", + [__STORE_FAST_2__LOAD_FAST_5] = "__STORE_FAST_2__LOAD_FAST_5", + [__STORE_FAST_2__LOAD_FAST_6] = "__STORE_FAST_2__LOAD_FAST_6", + [__STORE_FAST_2__LOAD_FAST_7] = "__STORE_FAST_2__LOAD_FAST_7", + [__STORE_FAST_3__LOAD_FAST_0] = "__STORE_FAST_3__LOAD_FAST_0", + [__STORE_FAST_3__LOAD_FAST_1] = "__STORE_FAST_3__LOAD_FAST_1", + [__STORE_FAST_3__LOAD_FAST_2] = "__STORE_FAST_3__LOAD_FAST_2", + [__STORE_FAST_3__LOAD_FAST_3] = "__STORE_FAST_3__LOAD_FAST_3", + [__STORE_FAST_3__LOAD_FAST_4] = "__STORE_FAST_3__LOAD_FAST_4", + [__STORE_FAST_3__LOAD_FAST_5] = "__STORE_FAST_3__LOAD_FAST_5", + [__STORE_FAST_3__LOAD_FAST_6] = "__STORE_FAST_3__LOAD_FAST_6", + [__STORE_FAST_3__LOAD_FAST_7] = "__STORE_FAST_3__LOAD_FAST_7", + [__STORE_FAST_4__LOAD_FAST_0] = "__STORE_FAST_4__LOAD_FAST_0", + [__STORE_FAST_4__LOAD_FAST_1] = "__STORE_FAST_4__LOAD_FAST_1", + [__STORE_FAST_4__LOAD_FAST_2] = "__STORE_FAST_4__LOAD_FAST_2", + [__STORE_FAST_4__LOAD_FAST_3] = "__STORE_FAST_4__LOAD_FAST_3", + [__STORE_FAST_4__LOAD_FAST_4] = "__STORE_FAST_4__LOAD_FAST_4", + [__STORE_FAST_4__LOAD_FAST_5] = "__STORE_FAST_4__LOAD_FAST_5", + [__STORE_FAST_4__LOAD_FAST_6] = "__STORE_FAST_4__LOAD_FAST_6", + [__STORE_FAST_4__LOAD_FAST_7] = "__STORE_FAST_4__LOAD_FAST_7", + [__STORE_FAST_5__LOAD_FAST_0] = "__STORE_FAST_5__LOAD_FAST_0", + [__STORE_FAST_5__LOAD_FAST_1] = "__STORE_FAST_5__LOAD_FAST_1", + [__STORE_FAST_5__LOAD_FAST_2] = "__STORE_FAST_5__LOAD_FAST_2", + [__STORE_FAST_5__LOAD_FAST_3] = "__STORE_FAST_5__LOAD_FAST_3", + [__STORE_FAST_5__LOAD_FAST_4] = "__STORE_FAST_5__LOAD_FAST_4", + [__STORE_FAST_5__LOAD_FAST_5] = "__STORE_FAST_5__LOAD_FAST_5", + [__STORE_FAST_5__LOAD_FAST_6] = "__STORE_FAST_5__LOAD_FAST_6", + [__STORE_FAST_5__LOAD_FAST_7] = "__STORE_FAST_5__LOAD_FAST_7", + [__STORE_FAST_6__LOAD_FAST_0] = "__STORE_FAST_6__LOAD_FAST_0", + [__STORE_FAST_6__LOAD_FAST_1] = "__STORE_FAST_6__LOAD_FAST_1", + [__STORE_FAST_6__LOAD_FAST_2] = "__STORE_FAST_6__LOAD_FAST_2", + [__STORE_FAST_6__LOAD_FAST_3] = "__STORE_FAST_6__LOAD_FAST_3", + [__STORE_FAST_6__LOAD_FAST_4] = "__STORE_FAST_6__LOAD_FAST_4", + [__STORE_FAST_6__LOAD_FAST_5] = "__STORE_FAST_6__LOAD_FAST_5", + [__STORE_FAST_6__LOAD_FAST_6] = "__STORE_FAST_6__LOAD_FAST_6", + [__STORE_FAST_6__LOAD_FAST_7] = "__STORE_FAST_6__LOAD_FAST_7", + [__STORE_FAST_7__LOAD_FAST_0] = "__STORE_FAST_7__LOAD_FAST_0", + [__STORE_FAST_7__LOAD_FAST_1] = "__STORE_FAST_7__LOAD_FAST_1", + [__STORE_FAST_7__LOAD_FAST_2] = "__STORE_FAST_7__LOAD_FAST_2", + [__STORE_FAST_7__LOAD_FAST_3] = "__STORE_FAST_7__LOAD_FAST_3", + [__STORE_FAST_7__LOAD_FAST_4] = "__STORE_FAST_7__LOAD_FAST_4", + [__STORE_FAST_7__LOAD_FAST_5] = "__STORE_FAST_7__LOAD_FAST_5", + [__STORE_FAST_7__LOAD_FAST_6] = "__STORE_FAST_7__LOAD_FAST_6", + [__STORE_FAST_7__LOAD_FAST_7] = "__STORE_FAST_7__LOAD_FAST_7", }; #endif // NEED_OPCODE_METADATA diff --git a/Lib/test/test_capi/test_opt.py b/Lib/test/test_capi/test_opt.py index a0a19225b79433..6a5696213e6586 100644 --- a/Lib/test/test_capi/test_opt.py +++ b/Lib/test/test_capi/test_opt.py @@ -231,7 +231,7 @@ def testfunc(x): self.assertIsNotNone(ex) uops = get_opnames(ex) self.assertIn("_SET_IP", uops) - self.assertIn("_LOAD_FAST_0", uops) + self.assertIn("__LOAD_FAST_1__LOAD_FAST_0", uops) def test_extended_arg(self): "Check EXTENDED_ARG handling in superblock creation" @@ -399,7 +399,7 @@ def testfunc(n): uops = get_opnames(ex) # Since there is no JUMP_FORWARD instruction, # look for indirect evidence: the += operator - self.assertIn("_BINARY_OP_ADD_INT", uops) + self.assertIn("_GUARD_BOTH_INT__BINARY_OP_ADD_INT", uops) def test_for_iter_range(self): def testfunc(n): @@ -494,7 +494,7 @@ def dummy(x): ex = get_first_executor(testfunc) self.assertIsNotNone(ex) uops = get_opnames(ex) - self.assertIn("_PUSH_FRAME", uops) + self.assertIn("_SAVE_RETURN_OFFSET__PUSH_FRAME", uops) self.assertIn("_BINARY_OP_ADD_INT", uops) def test_branch_taken(self): @@ -601,8 +601,8 @@ def testfunc(loops): res, ex = self._run_with_optimizer(testfunc, 32) self.assertIsNotNone(ex) self.assertEqual(res, 63) - binop_count = [opname for opname in iter_opnames(ex) if opname == "_BINARY_OP_ADD_INT"] - guard_both_int_count = [opname for opname in iter_opnames(ex) if opname == "_GUARD_BOTH_INT"] + binop_count = [opname for opname in iter_opnames(ex) if "_BINARY_OP_ADD_INT" in opname] + guard_both_int_count = [opname for opname in iter_opnames(ex) if "_GUARD_BOTH_INT" in opname] self.assertGreaterEqual(len(binop_count), 3) self.assertLessEqual(len(guard_both_int_count), 1) @@ -625,8 +625,8 @@ def testfunc(loops): ex = get_first_executor(testfunc) self.assertIsNotNone(ex) self.assertEqual(res, 124) - binop_count = [opname for opname in iter_opnames(ex) if opname == "_BINARY_OP_ADD_INT"] - guard_both_int_count = [opname for opname in iter_opnames(ex) if opname == "_GUARD_BOTH_INT"] + binop_count = [opname for opname in iter_opnames(ex) if "_BINARY_OP_ADD_INT" in opname] + guard_both_int_count = [opname for opname in iter_opnames(ex) if "_GUARD_BOTH_INT" in opname] self.assertGreaterEqual(len(binop_count), 3) self.assertLessEqual(len(guard_both_int_count), 1) @@ -649,8 +649,8 @@ def testfunc(loops): ex = get_first_executor(testfunc) self.assertIsNotNone(ex) self.assertEqual(res, 124) - binop_count = [opname for opname in iter_opnames(ex) if opname == "_BINARY_OP_ADD_INT"] - guard_both_int_count = [opname for opname in iter_opnames(ex) if opname == "_GUARD_BOTH_INT"] + binop_count = [opname for opname in iter_opnames(ex) if "_BINARY_OP_ADD_INT" in opname] + guard_both_int_count = [opname for opname in iter_opnames(ex) if "_GUARD_BOTH_INT" in opname] self.assertGreaterEqual(len(binop_count), 3) self.assertLessEqual(len(guard_both_int_count), 1) @@ -667,7 +667,7 @@ def testfunc(loops): res, ex = self._run_with_optimizer(testfunc, 64) self.assertIsNotNone(ex) - binop_count = [opname for opname in iter_opnames(ex) if opname == "_BINARY_OP_ADD_INT"] + binop_count = [opname for opname in iter_opnames(ex) if "_BINARY_OP_ADD_INT" in opname] self.assertGreaterEqual(len(binop_count), 3) def test_call_py_exact_args(self): @@ -680,7 +680,7 @@ def dummy(x): res, ex = self._run_with_optimizer(testfunc, 32) self.assertIsNotNone(ex) uops = get_opnames(ex) - self.assertIn("_PUSH_FRAME", uops) + self.assertIn("_SAVE_RETURN_OFFSET__PUSH_FRAME", uops) self.assertIn("_BINARY_OP_ADD_INT", uops) self.assertNotIn("_CHECK_PEP_523", uops) @@ -713,8 +713,8 @@ def testfunc(n): self.assertEqual(res, 4) self.assertIsNotNone(ex) uops = get_opnames(ex) - self.assertIn("_GUARD_BOTH_INT", uops) - guard_count = [opname for opname in iter_opnames(ex) if opname == "_GUARD_BOTH_INT"] + self.assertIn("_GUARD_BOTH_INT__BINARY_OP_ADD_INT", uops) + guard_count = [opname for opname in iter_opnames(ex) if opname == "_GUARD_BOTH_INT__BINARY_OP_ADD_INT"] self.assertEqual(len(guard_count), 1) def test_comprehension(self): @@ -809,7 +809,7 @@ def testfunc(n): self.assertLessEqual(len(guard_both_float_count), 1) # TODO gh-115506: this assertion may change after propagating constants. # We'll also need to verify that propagation actually occurs. - self.assertIn("_BINARY_OP_ADD_FLOAT", uops) + self.assertIn("_GUARD_BOTH_FLOAT__BINARY_OP_ADD_FLOAT", uops) def test_float_subtract_constant_propagation(self): def testfunc(n): @@ -829,7 +829,7 @@ def testfunc(n): self.assertLessEqual(len(guard_both_float_count), 1) # TODO gh-115506: this assertion may change after propagating constants. # We'll also need to verify that propagation actually occurs. - self.assertIn("_BINARY_OP_SUBTRACT_FLOAT", uops) + self.assertIn("_GUARD_BOTH_FLOAT__BINARY_OP_SUBTRACT_FLOAT", uops) def test_float_multiply_constant_propagation(self): def testfunc(n): @@ -849,7 +849,7 @@ def testfunc(n): self.assertLessEqual(len(guard_both_float_count), 1) # TODO gh-115506: this assertion may change after propagating constants. # We'll also need to verify that propagation actually occurs. - self.assertIn("_BINARY_OP_MULTIPLY_FLOAT", uops) + self.assertIn("_GUARD_BOTH_FLOAT__BINARY_OP_MULTIPLY_FLOAT", uops) def test_add_unicode_propagation(self): def testfunc(n): diff --git a/Lib/test/test_generated_cases.py b/Lib/test/test_generated_cases.py index 32c2c2fca05c4e..ce46a26983ac48 100644 --- a/Lib/test/test_generated_cases.py +++ b/Lib/test/test_generated_cases.py @@ -29,11 +29,12 @@ def skip_if_different_mount_drives(): test_tools.skip_if_missing("cases_generator") with test_tools.imports_under_tool("cases_generator"): - from analyzer import StackItem + from analyzer import StackItem, analyze_files import parser from stack import Stack import tier1_generator import optimizer_generator + import tier2_super_matcher_generator def handle_stderr(): @@ -813,6 +814,20 @@ def test_deopt_and_exit(self): with self.assertRaises(Exception): self.run_cases_test(input, output) + def test_super(self): + input = """ + op(OP1, (arg1 -- out)) { + FOO(); + } + op(OP2, (arg1 -- out)) { + BAR(); + } + super(_OP1__OP2) = OP1 + OP2; + """ + output = "" + self.run_cases_test(input, output) + + class TestGeneratedAbstractCases(unittest.TestCase): def setUp(self) -> None: super().setUp() @@ -965,5 +980,223 @@ def test_missing_override_failure(self): self.run_cases_test(input, input2, output) +class TestGeneratedSuperMatcher(unittest.TestCase): + def setUp(self) -> None: + super().setUp() + self.maxDiff = None + + self.temp_dir = tempfile.gettempdir() + self.temp_input_filename = os.path.join(self.temp_dir, "input.txt") + self.temp_output_filename = os.path.join(self.temp_dir, "output.txt") + self.temp_metadata_filename = os.path.join(self.temp_dir, "metadata.txt") + self.temp_pymetadata_filename = os.path.join(self.temp_dir, "pymetadata.txt") + self.temp_executor_filename = os.path.join(self.temp_dir, "executor.txt") + + def tearDown(self) -> None: + for filename in [ + self.temp_input_filename, + self.temp_output_filename, + self.temp_metadata_filename, + self.temp_pymetadata_filename, + self.temp_executor_filename, + ]: + try: + os.remove(filename) + except: + pass + super().tearDown() + + def run_cases_test(self, input: str, expected: str): + with open(self.temp_input_filename, "w+") as temp_input: + temp_input.write(parser.BEGIN_MARKER) + temp_input.write(input) + temp_input.write(parser.END_MARKER) + temp_input.flush() + + with handle_stderr(), open(self.temp_output_filename, "w+") as temp_output: + data = analyze_files([self.temp_input_filename]) + tier2_super_matcher_generator.generate_tier2( + [self.temp_input_filename], data, temp_output, False + ) + + with open(self.temp_output_filename) as temp_output: + lines = temp_output.readlines() + while lines and lines[0].startswith(("// ", "#", " #", "\n")): + lines.pop(0) + while lines and lines[-1].startswith(("#", "\n")): + lines.pop(-1) + actual = "".join(lines) + + # if actual.strip() != expected.strip(): + # print("Actual:") + # print(actual) + # print("Expected:") + # print(expected) + # print("End") + self.assertEqual(actual.strip(), expected.strip()) + + def test_super_basic(self): + input = """ + op(OP1, (arg1 -- out)) { + FOO(); + } + op(OP2, (arg1 -- out)) { + BAR(); + } + super(_OP1__OP2) = OP1 + OP2; + """ + output = """ + case OP1: { + if ((this_instr[1].opcode == OP2)) { + DPRINTF(2, "Inserting super _OP1__OP2\\n"); + REPLACE_OP(this_instr, _OP1__OP2, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + this_instr += 1; + break; + } + """ + self.run_cases_test(input, output) + + def test_super_replicate(self): + input = """ + op(OP1, (arg1 -- out)) { + FOO(); + } + replicate(3) op(OP2, (arg1 -- out)) { + BAR(); + } + super(_OP1__OP2) = OP1 + OP2; + """ + output = """ + case OP1: { + if ((this_instr[1].opcode == OP2)) { + DPRINTF(2, "Inserting super _OP1__OP2\\n"); + REPLACE_OP(this_instr, _OP1__OP2, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == OP2_0)) { + DPRINTF(2, "Inserting super _OP1__OP2_0\\n"); + REPLACE_OP(this_instr, _OP1__OP2_0, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == OP2_1)) { + DPRINTF(2, "Inserting super _OP1__OP2_1\\n"); + REPLACE_OP(this_instr, _OP1__OP2_1, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == OP2_2)) { + DPRINTF(2, "Inserting super _OP1__OP2_2\\n"); + REPLACE_OP(this_instr, _OP1__OP2_2, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + this_instr += 1; + break; + } + """ + self.run_cases_test(input, output) + + def test_super_replicate_only(self): + input = """ + replicate(3) op(OP1, (arg1 -- out)) { + FOO(); + } + replicate(3) op(OP2, (arg1 -- out)) { + BAR(); + } + replicate_only super(_OP1__OP2) = OP1 + OP2; + """ + output = """ + case OP1_0: { + if ((this_instr[1].opcode == OP2_0)) { + DPRINTF(2, "Inserting super _OP1_0_OP2_0\\n"); + REPLACE_OP(this_instr, _OP1_0_OP2_0, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == OP2_1)) { + DPRINTF(2, "Inserting super _OP1_0_OP2_1\\n"); + REPLACE_OP(this_instr, _OP1_0_OP2_1, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == OP2_2)) { + DPRINTF(2, "Inserting super _OP1_0_OP2_2\\n"); + REPLACE_OP(this_instr, _OP1_0_OP2_2, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + this_instr += 1; + break; + } + + case OP1_1: { + if ((this_instr[1].opcode == OP2_0)) { + DPRINTF(2, "Inserting super _OP1_1_OP2_0\\n"); + REPLACE_OP(this_instr, _OP1_1_OP2_0, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == OP2_1)) { + DPRINTF(2, "Inserting super _OP1_1_OP2_1\\n"); + REPLACE_OP(this_instr, _OP1_1_OP2_1, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == OP2_2)) { + DPRINTF(2, "Inserting super _OP1_1_OP2_2\\n"); + REPLACE_OP(this_instr, _OP1_1_OP2_2, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + this_instr += 1; + break; + } + + case OP1_2: { + if ((this_instr[1].opcode == OP2_0)) { + DPRINTF(2, "Inserting super _OP1_2_OP2_0\\n"); + REPLACE_OP(this_instr, _OP1_2_OP2_0, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == OP2_1)) { + DPRINTF(2, "Inserting super _OP1_2_OP2_1\\n"); + REPLACE_OP(this_instr, _OP1_2_OP2_1, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == OP2_2)) { + DPRINTF(2, "Inserting super _OP1_2_OP2_2\\n"); + REPLACE_OP(this_instr, _OP1_2_OP2_2, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + this_instr += 1; + break; + } + + """ + self.run_cases_test(input, output) + if __name__ == "__main__": unittest.main() diff --git a/Makefile.pre.in b/Makefile.pre.in index ee65ecd918ce2a..8346e1c7178c50 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1888,6 +1888,8 @@ regen-cases: -o $(srcdir)/Python/generated_cases.c.h.new $(srcdir)/Python/bytecodes.c $(PYTHON_FOR_REGEN) $(srcdir)/Tools/cases_generator/tier2_generator.py \ -o $(srcdir)/Python/executor_cases.c.h.new $(srcdir)/Python/bytecodes.c + $(PYTHON_FOR_REGEN) $(srcdir)/Tools/cases_generator/tier2_super_matcher_generator.py \ + -o $(srcdir)/Python/uop_super_matcher_cases.c.h.new $(srcdir)/Python/bytecodes.c $(PYTHON_FOR_REGEN) $(srcdir)/Tools/cases_generator/optimizer_generator.py \ -o $(srcdir)/Python/optimizer_cases.c.h.new \ $(srcdir)/Python/optimizer_bytecodes.c \ @@ -1903,6 +1905,7 @@ regen-cases: $(UPDATE_FILE) $(srcdir)/Include/internal/pycore_opcode_metadata.h $(srcdir)/Include/internal/pycore_opcode_metadata.h.new $(UPDATE_FILE) $(srcdir)/Include/internal/pycore_uop_metadata.h $(srcdir)/Include/internal/pycore_uop_metadata.h.new $(UPDATE_FILE) $(srcdir)/Python/executor_cases.c.h $(srcdir)/Python/executor_cases.c.h.new + $(UPDATE_FILE) $(srcdir)/Python/uop_super_matcher_cases.c.h $(srcdir)/Python/uop_super_matcher_cases.c.h.new $(UPDATE_FILE) $(srcdir)/Python/optimizer_cases.c.h $(srcdir)/Python/optimizer_cases.c.h.new $(UPDATE_FILE) $(srcdir)/Lib/_opcode_metadata.py $(srcdir)/Lib/_opcode_metadata.py.new @@ -1926,7 +1929,8 @@ Python/optimizer.o: \ Python/optimizer_analysis.o: \ $(srcdir)/Include/internal/pycore_opcode_metadata.h \ $(srcdir)/Include/internal/pycore_optimizer.h \ - $(srcdir)/Python/optimizer_cases.c.h + $(srcdir)/Python/optimizer_cases.c.h \ + $(srcdir)/Python/uop_super_matcher_cases.c.h Python/frozen.o: $(FROZEN_FILES_OUT) diff --git a/Misc/NEWS.d/next/Core and Builtins/2024-03-01-13-40-39.gh-issue-116202.Cmq-PB.rst b/Misc/NEWS.d/next/Core and Builtins/2024-03-01-13-40-39.gh-issue-116202.Cmq-PB.rst new file mode 100644 index 00000000000000..e843b4a8337213 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2024-03-01-13-40-39.gh-issue-116202.Cmq-PB.rst @@ -0,0 +1 @@ +Add tier 2 super uops. diff --git a/Python/bytecodes.c b/Python/bytecodes.c index 396a8f09f3feca..02927dbea42d45 100644 --- a/Python/bytecodes.c +++ b/Python/bytecodes.c @@ -229,6 +229,8 @@ dummy_func( Py_INCREF(value2); } + replicate_only super(_LOAD_FAST__LOAD_FAST) = LOAD_FAST + LOAD_FAST; + pure inst(LOAD_CONST, (-- value)) { value = GETITEM(FRAME_CO_CONSTS, oparg); Py_INCREF(value); @@ -250,6 +252,8 @@ dummy_func( Py_INCREF(value2); } + replicate_only super(_STORE_FAST__LOAD_FAST) = STORE_FAST + LOAD_FAST; + inst(STORE_FAST_STORE_FAST, (value2, value1 --)) { uint32_t oparg1 = oparg >> 4; uint32_t oparg2 = oparg & 15; @@ -444,6 +448,13 @@ dummy_func( macro(BINARY_OP_SUBTRACT_INT) = _GUARD_BOTH_INT + unused/1 + _BINARY_OP_SUBTRACT_INT; + super(_GUARD_BOTH_INT__BINARY_OP_MULTIPLY_INT) = + _GUARD_BOTH_INT + _BINARY_OP_MULTIPLY_INT; + super(_GUARD_BOTH_INT__BINARY_OP_ADD_INT) = + _GUARD_BOTH_INT + _BINARY_OP_ADD_INT; + super(_GUARD_BOTH_INT__BINARY_OP_SUBTRACT_INT) = + _GUARD_BOTH_INT + _BINARY_OP_SUBTRACT_INT; + op(_GUARD_BOTH_FLOAT, (left, right -- left, right)) { EXIT_IF(!PyFloat_CheckExact(left)); EXIT_IF(!PyFloat_CheckExact(right)); @@ -480,6 +491,13 @@ dummy_func( macro(BINARY_OP_SUBTRACT_FLOAT) = _GUARD_BOTH_FLOAT + unused/1 + _BINARY_OP_SUBTRACT_FLOAT; + super(_GUARD_BOTH_FLOAT__BINARY_OP_MULTIPLY_FLOAT) = + _GUARD_BOTH_FLOAT + _BINARY_OP_MULTIPLY_FLOAT; + super(_GUARD_BOTH_FLOAT__BINARY_OP_ADD_FLOAT) = + _GUARD_BOTH_FLOAT + _BINARY_OP_ADD_FLOAT; + super(_GUARD_BOTH_FLOAT__BINARY_OP_SUBTRACT_FLOAT) = + _GUARD_BOTH_FLOAT + _BINARY_OP_SUBTRACT_FLOAT; + op(_GUARD_BOTH_UNICODE, (left, right -- left, right)) { EXIT_IF(!PyUnicode_CheckExact(left)); EXIT_IF(!PyUnicode_CheckExact(right)); @@ -496,6 +514,9 @@ dummy_func( macro(BINARY_OP_ADD_UNICODE) = _GUARD_BOTH_UNICODE + unused/1 + _BINARY_OP_ADD_UNICODE; + super(_GUARD_BOTH_UNICODE__BINARY_OP_ADD_UNICODE) = + _GUARD_BOTH_UNICODE + _BINARY_OP_ADD_UNICODE; + // This is a subtle one. It's a super-instruction for // BINARY_OP_ADD_UNICODE followed by STORE_FAST // where the store goes into the left argument. @@ -3091,7 +3112,7 @@ dummy_func( DEOPT_IF(tstate->interp->eval_frame); } - op(_CHECK_FUNCTION_EXACT_ARGS, (func_version/2, callable, self_or_null, unused[oparg] -- callable, self_or_null, unused[oparg])) { + replicate(5) op(_CHECK_FUNCTION_EXACT_ARGS, (func_version/2, callable, self_or_null, unused[oparg] -- callable, self_or_null, unused[oparg])) { DEOPT_IF(!PyFunction_Check(callable)); PyFunctionObject *func = (PyFunctionObject *)callable; DEOPT_IF(func->func_version != func_version); @@ -3099,7 +3120,7 @@ dummy_func( DEOPT_IF(code->co_argcount != oparg + (self_or_null != NULL)); } - op(_CHECK_STACK_SPACE, (callable, unused, unused[oparg] -- callable, unused, unused[oparg])) { + replicate(5) op(_CHECK_STACK_SPACE, (callable, unused, unused[oparg] -- callable, unused, unused[oparg])) { PyFunctionObject *func = (PyFunctionObject *)callable; PyCodeObject *code = (PyCodeObject *)func->func_code; DEOPT_IF(!_PyThreadState_HasStackSpace(tstate, code->co_framesize)); @@ -3154,6 +3175,13 @@ dummy_func( _SAVE_RETURN_OFFSET + _PUSH_FRAME; + super(_CALL_BOUND_METHOD_EXACT_ARGS) = + _CHECK_CALL_BOUND_METHOD_EXACT_ARGS + + _INIT_CALL_BOUND_METHOD_EXACT_ARGS + + _CHECK_FUNCTION_EXACT_ARGS + + _CHECK_STACK_SPACE + + _INIT_CALL_PY_EXACT_ARGS; + macro(CALL_PY_EXACT_ARGS) = unused/1 + // Skip over the counter _CHECK_PEP_523 + @@ -3163,6 +3191,13 @@ dummy_func( _SAVE_RETURN_OFFSET + _PUSH_FRAME; + super(_CHECK_CALL_PY_EXACT_ARGS) = + _CHECK_FUNCTION_EXACT_ARGS + + _CHECK_STACK_SPACE + + _INIT_CALL_PY_EXACT_ARGS; + + super(_SAVE_RETURN_OFFSET__PUSH_FRAME) = _SAVE_RETURN_OFFSET + _PUSH_FRAME; + inst(CALL_PY_WITH_DEFAULTS, (unused/1, func_version/2, callable, self_or_null, args[oparg] -- unused)) { DEOPT_IF(tstate->interp->eval_frame); int argcount = oparg; diff --git a/Python/executor_cases.c.h b/Python/executor_cases.c.h index 56ee93862743d5..e1df3212c00c47 100644 --- a/Python/executor_cases.c.h +++ b/Python/executor_cases.c.h @@ -2816,6 +2816,86 @@ break; } + case _CHECK_FUNCTION_EXACT_ARGS_0: { + PyObject *self_or_null; + PyObject *callable; + oparg = 0; + assert(oparg == CURRENT_OPARG()); + self_or_null = stack_pointer[-1 - oparg]; + callable = stack_pointer[-2 - oparg]; + uint32_t func_version = (uint32_t)CURRENT_OPERAND(); + if (!PyFunction_Check(callable)) goto deoptimize; + PyFunctionObject *func = (PyFunctionObject *)callable; + if (func->func_version != func_version) goto deoptimize; + PyCodeObject *code = (PyCodeObject *)func->func_code; + if (code->co_argcount != oparg + (self_or_null != NULL)) goto deoptimize; + break; + } + + case _CHECK_FUNCTION_EXACT_ARGS_1: { + PyObject *self_or_null; + PyObject *callable; + oparg = 1; + assert(oparg == CURRENT_OPARG()); + self_or_null = stack_pointer[-1 - oparg]; + callable = stack_pointer[-2 - oparg]; + uint32_t func_version = (uint32_t)CURRENT_OPERAND(); + if (!PyFunction_Check(callable)) goto deoptimize; + PyFunctionObject *func = (PyFunctionObject *)callable; + if (func->func_version != func_version) goto deoptimize; + PyCodeObject *code = (PyCodeObject *)func->func_code; + if (code->co_argcount != oparg + (self_or_null != NULL)) goto deoptimize; + break; + } + + case _CHECK_FUNCTION_EXACT_ARGS_2: { + PyObject *self_or_null; + PyObject *callable; + oparg = 2; + assert(oparg == CURRENT_OPARG()); + self_or_null = stack_pointer[-1 - oparg]; + callable = stack_pointer[-2 - oparg]; + uint32_t func_version = (uint32_t)CURRENT_OPERAND(); + if (!PyFunction_Check(callable)) goto deoptimize; + PyFunctionObject *func = (PyFunctionObject *)callable; + if (func->func_version != func_version) goto deoptimize; + PyCodeObject *code = (PyCodeObject *)func->func_code; + if (code->co_argcount != oparg + (self_or_null != NULL)) goto deoptimize; + break; + } + + case _CHECK_FUNCTION_EXACT_ARGS_3: { + PyObject *self_or_null; + PyObject *callable; + oparg = 3; + assert(oparg == CURRENT_OPARG()); + self_or_null = stack_pointer[-1 - oparg]; + callable = stack_pointer[-2 - oparg]; + uint32_t func_version = (uint32_t)CURRENT_OPERAND(); + if (!PyFunction_Check(callable)) goto deoptimize; + PyFunctionObject *func = (PyFunctionObject *)callable; + if (func->func_version != func_version) goto deoptimize; + PyCodeObject *code = (PyCodeObject *)func->func_code; + if (code->co_argcount != oparg + (self_or_null != NULL)) goto deoptimize; + break; + } + + case _CHECK_FUNCTION_EXACT_ARGS_4: { + PyObject *self_or_null; + PyObject *callable; + oparg = 4; + assert(oparg == CURRENT_OPARG()); + self_or_null = stack_pointer[-1 - oparg]; + callable = stack_pointer[-2 - oparg]; + uint32_t func_version = (uint32_t)CURRENT_OPERAND(); + if (!PyFunction_Check(callable)) goto deoptimize; + PyFunctionObject *func = (PyFunctionObject *)callable; + if (func->func_version != func_version) goto deoptimize; + PyCodeObject *code = (PyCodeObject *)func->func_code; + if (code->co_argcount != oparg + (self_or_null != NULL)) goto deoptimize; + break; + } + case _CHECK_FUNCTION_EXACT_ARGS: { PyObject *self_or_null; PyObject *callable; @@ -2831,6 +2911,66 @@ break; } + case _CHECK_STACK_SPACE_0: { + PyObject *callable; + oparg = 0; + assert(oparg == CURRENT_OPARG()); + callable = stack_pointer[-2 - oparg]; + PyFunctionObject *func = (PyFunctionObject *)callable; + PyCodeObject *code = (PyCodeObject *)func->func_code; + if (!_PyThreadState_HasStackSpace(tstate, code->co_framesize)) goto deoptimize; + if (tstate->py_recursion_remaining <= 1) goto deoptimize; + break; + } + + case _CHECK_STACK_SPACE_1: { + PyObject *callable; + oparg = 1; + assert(oparg == CURRENT_OPARG()); + callable = stack_pointer[-2 - oparg]; + PyFunctionObject *func = (PyFunctionObject *)callable; + PyCodeObject *code = (PyCodeObject *)func->func_code; + if (!_PyThreadState_HasStackSpace(tstate, code->co_framesize)) goto deoptimize; + if (tstate->py_recursion_remaining <= 1) goto deoptimize; + break; + } + + case _CHECK_STACK_SPACE_2: { + PyObject *callable; + oparg = 2; + assert(oparg == CURRENT_OPARG()); + callable = stack_pointer[-2 - oparg]; + PyFunctionObject *func = (PyFunctionObject *)callable; + PyCodeObject *code = (PyCodeObject *)func->func_code; + if (!_PyThreadState_HasStackSpace(tstate, code->co_framesize)) goto deoptimize; + if (tstate->py_recursion_remaining <= 1) goto deoptimize; + break; + } + + case _CHECK_STACK_SPACE_3: { + PyObject *callable; + oparg = 3; + assert(oparg == CURRENT_OPARG()); + callable = stack_pointer[-2 - oparg]; + PyFunctionObject *func = (PyFunctionObject *)callable; + PyCodeObject *code = (PyCodeObject *)func->func_code; + if (!_PyThreadState_HasStackSpace(tstate, code->co_framesize)) goto deoptimize; + if (tstate->py_recursion_remaining <= 1) goto deoptimize; + break; + } + + case _CHECK_STACK_SPACE_4: { + PyObject *callable; + oparg = 4; + assert(oparg == CURRENT_OPARG()); + callable = stack_pointer[-2 - oparg]; + PyFunctionObject *func = (PyFunctionObject *)callable; + PyCodeObject *code = (PyCodeObject *)func->func_code; + if (!_PyThreadState_HasStackSpace(tstate, code->co_framesize)) goto deoptimize; + if (tstate->py_recursion_remaining <= 1) goto deoptimize; + break; + } + case _CHECK_STACK_SPACE: { PyObject *callable; oparg = CURRENT_OPARG(); @@ -3873,4 +4013,3990 @@ break; } + case __LOAD_FAST_0__LOAD_FAST_0: { + // _LOAD_FAST_0 + { + PyObject *value; + oparg = 0; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_0 + { + PyObject *value; + oparg = 0; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_0__LOAD_FAST_1: { + // _LOAD_FAST_0 + { + PyObject *value; + oparg = 0; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_1 + { + PyObject *value; + oparg = 1; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_0__LOAD_FAST_2: { + // _LOAD_FAST_0 + { + PyObject *value; + oparg = 0; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_2 + { + PyObject *value; + oparg = 2; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_0__LOAD_FAST_3: { + // _LOAD_FAST_0 + { + PyObject *value; + oparg = 0; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_3 + { + PyObject *value; + oparg = 3; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_0__LOAD_FAST_4: { + // _LOAD_FAST_0 + { + PyObject *value; + oparg = 0; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_4 + { + PyObject *value; + oparg = 4; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_0__LOAD_FAST_5: { + // _LOAD_FAST_0 + { + PyObject *value; + oparg = 0; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_5 + { + PyObject *value; + oparg = 5; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_0__LOAD_FAST_6: { + // _LOAD_FAST_0 + { + PyObject *value; + oparg = 0; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_6 + { + PyObject *value; + oparg = 6; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_0__LOAD_FAST_7: { + // _LOAD_FAST_0 + { + PyObject *value; + oparg = 0; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_7 + { + PyObject *value; + oparg = 7; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_1__LOAD_FAST_0: { + // _LOAD_FAST_1 + { + PyObject *value; + oparg = 1; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_0 + { + PyObject *value; + oparg = 0; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_1__LOAD_FAST_1: { + // _LOAD_FAST_1 + { + PyObject *value; + oparg = 1; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_1 + { + PyObject *value; + oparg = 1; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_1__LOAD_FAST_2: { + // _LOAD_FAST_1 + { + PyObject *value; + oparg = 1; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_2 + { + PyObject *value; + oparg = 2; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_1__LOAD_FAST_3: { + // _LOAD_FAST_1 + { + PyObject *value; + oparg = 1; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_3 + { + PyObject *value; + oparg = 3; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_1__LOAD_FAST_4: { + // _LOAD_FAST_1 + { + PyObject *value; + oparg = 1; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_4 + { + PyObject *value; + oparg = 4; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_1__LOAD_FAST_5: { + // _LOAD_FAST_1 + { + PyObject *value; + oparg = 1; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_5 + { + PyObject *value; + oparg = 5; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_1__LOAD_FAST_6: { + // _LOAD_FAST_1 + { + PyObject *value; + oparg = 1; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_6 + { + PyObject *value; + oparg = 6; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_1__LOAD_FAST_7: { + // _LOAD_FAST_1 + { + PyObject *value; + oparg = 1; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_7 + { + PyObject *value; + oparg = 7; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_2__LOAD_FAST_0: { + // _LOAD_FAST_2 + { + PyObject *value; + oparg = 2; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_0 + { + PyObject *value; + oparg = 0; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_2__LOAD_FAST_1: { + // _LOAD_FAST_2 + { + PyObject *value; + oparg = 2; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_1 + { + PyObject *value; + oparg = 1; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_2__LOAD_FAST_2: { + // _LOAD_FAST_2 + { + PyObject *value; + oparg = 2; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_2 + { + PyObject *value; + oparg = 2; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_2__LOAD_FAST_3: { + // _LOAD_FAST_2 + { + PyObject *value; + oparg = 2; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_3 + { + PyObject *value; + oparg = 3; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_2__LOAD_FAST_4: { + // _LOAD_FAST_2 + { + PyObject *value; + oparg = 2; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_4 + { + PyObject *value; + oparg = 4; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_2__LOAD_FAST_5: { + // _LOAD_FAST_2 + { + PyObject *value; + oparg = 2; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_5 + { + PyObject *value; + oparg = 5; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_2__LOAD_FAST_6: { + // _LOAD_FAST_2 + { + PyObject *value; + oparg = 2; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_6 + { + PyObject *value; + oparg = 6; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_2__LOAD_FAST_7: { + // _LOAD_FAST_2 + { + PyObject *value; + oparg = 2; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_7 + { + PyObject *value; + oparg = 7; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_3__LOAD_FAST_0: { + // _LOAD_FAST_3 + { + PyObject *value; + oparg = 3; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_0 + { + PyObject *value; + oparg = 0; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_3__LOAD_FAST_1: { + // _LOAD_FAST_3 + { + PyObject *value; + oparg = 3; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_1 + { + PyObject *value; + oparg = 1; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_3__LOAD_FAST_2: { + // _LOAD_FAST_3 + { + PyObject *value; + oparg = 3; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_2 + { + PyObject *value; + oparg = 2; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_3__LOAD_FAST_3: { + // _LOAD_FAST_3 + { + PyObject *value; + oparg = 3; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_3 + { + PyObject *value; + oparg = 3; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_3__LOAD_FAST_4: { + // _LOAD_FAST_3 + { + PyObject *value; + oparg = 3; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_4 + { + PyObject *value; + oparg = 4; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_3__LOAD_FAST_5: { + // _LOAD_FAST_3 + { + PyObject *value; + oparg = 3; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_5 + { + PyObject *value; + oparg = 5; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_3__LOAD_FAST_6: { + // _LOAD_FAST_3 + { + PyObject *value; + oparg = 3; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_6 + { + PyObject *value; + oparg = 6; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_3__LOAD_FAST_7: { + // _LOAD_FAST_3 + { + PyObject *value; + oparg = 3; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_7 + { + PyObject *value; + oparg = 7; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_4__LOAD_FAST_0: { + // _LOAD_FAST_4 + { + PyObject *value; + oparg = 4; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_0 + { + PyObject *value; + oparg = 0; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_4__LOAD_FAST_1: { + // _LOAD_FAST_4 + { + PyObject *value; + oparg = 4; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_1 + { + PyObject *value; + oparg = 1; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_4__LOAD_FAST_2: { + // _LOAD_FAST_4 + { + PyObject *value; + oparg = 4; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_2 + { + PyObject *value; + oparg = 2; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_4__LOAD_FAST_3: { + // _LOAD_FAST_4 + { + PyObject *value; + oparg = 4; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_3 + { + PyObject *value; + oparg = 3; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_4__LOAD_FAST_4: { + // _LOAD_FAST_4 + { + PyObject *value; + oparg = 4; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_4 + { + PyObject *value; + oparg = 4; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_4__LOAD_FAST_5: { + // _LOAD_FAST_4 + { + PyObject *value; + oparg = 4; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_5 + { + PyObject *value; + oparg = 5; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_4__LOAD_FAST_6: { + // _LOAD_FAST_4 + { + PyObject *value; + oparg = 4; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_6 + { + PyObject *value; + oparg = 6; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_4__LOAD_FAST_7: { + // _LOAD_FAST_4 + { + PyObject *value; + oparg = 4; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_7 + { + PyObject *value; + oparg = 7; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_5__LOAD_FAST_0: { + // _LOAD_FAST_5 + { + PyObject *value; + oparg = 5; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_0 + { + PyObject *value; + oparg = 0; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_5__LOAD_FAST_1: { + // _LOAD_FAST_5 + { + PyObject *value; + oparg = 5; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_1 + { + PyObject *value; + oparg = 1; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_5__LOAD_FAST_2: { + // _LOAD_FAST_5 + { + PyObject *value; + oparg = 5; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_2 + { + PyObject *value; + oparg = 2; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_5__LOAD_FAST_3: { + // _LOAD_FAST_5 + { + PyObject *value; + oparg = 5; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_3 + { + PyObject *value; + oparg = 3; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_5__LOAD_FAST_4: { + // _LOAD_FAST_5 + { + PyObject *value; + oparg = 5; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_4 + { + PyObject *value; + oparg = 4; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_5__LOAD_FAST_5: { + // _LOAD_FAST_5 + { + PyObject *value; + oparg = 5; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_5 + { + PyObject *value; + oparg = 5; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_5__LOAD_FAST_6: { + // _LOAD_FAST_5 + { + PyObject *value; + oparg = 5; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_6 + { + PyObject *value; + oparg = 6; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_5__LOAD_FAST_7: { + // _LOAD_FAST_5 + { + PyObject *value; + oparg = 5; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_7 + { + PyObject *value; + oparg = 7; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_6__LOAD_FAST_0: { + // _LOAD_FAST_6 + { + PyObject *value; + oparg = 6; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_0 + { + PyObject *value; + oparg = 0; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_6__LOAD_FAST_1: { + // _LOAD_FAST_6 + { + PyObject *value; + oparg = 6; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_1 + { + PyObject *value; + oparg = 1; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_6__LOAD_FAST_2: { + // _LOAD_FAST_6 + { + PyObject *value; + oparg = 6; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_2 + { + PyObject *value; + oparg = 2; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_6__LOAD_FAST_3: { + // _LOAD_FAST_6 + { + PyObject *value; + oparg = 6; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_3 + { + PyObject *value; + oparg = 3; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_6__LOAD_FAST_4: { + // _LOAD_FAST_6 + { + PyObject *value; + oparg = 6; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_4 + { + PyObject *value; + oparg = 4; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_6__LOAD_FAST_5: { + // _LOAD_FAST_6 + { + PyObject *value; + oparg = 6; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_5 + { + PyObject *value; + oparg = 5; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_6__LOAD_FAST_6: { + // _LOAD_FAST_6 + { + PyObject *value; + oparg = 6; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_6 + { + PyObject *value; + oparg = 6; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_6__LOAD_FAST_7: { + // _LOAD_FAST_6 + { + PyObject *value; + oparg = 6; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_7 + { + PyObject *value; + oparg = 7; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_7__LOAD_FAST_0: { + // _LOAD_FAST_7 + { + PyObject *value; + oparg = 7; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_0 + { + PyObject *value; + oparg = 0; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_7__LOAD_FAST_1: { + // _LOAD_FAST_7 + { + PyObject *value; + oparg = 7; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_1 + { + PyObject *value; + oparg = 1; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_7__LOAD_FAST_2: { + // _LOAD_FAST_7 + { + PyObject *value; + oparg = 7; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_2 + { + PyObject *value; + oparg = 2; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_7__LOAD_FAST_3: { + // _LOAD_FAST_7 + { + PyObject *value; + oparg = 7; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_3 + { + PyObject *value; + oparg = 3; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_7__LOAD_FAST_4: { + // _LOAD_FAST_7 + { + PyObject *value; + oparg = 7; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_4 + { + PyObject *value; + oparg = 4; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_7__LOAD_FAST_5: { + // _LOAD_FAST_7 + { + PyObject *value; + oparg = 7; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_5 + { + PyObject *value; + oparg = 5; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_7__LOAD_FAST_6: { + // _LOAD_FAST_7 + { + PyObject *value; + oparg = 7; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_6 + { + PyObject *value; + oparg = 6; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __LOAD_FAST_7__LOAD_FAST_7: { + // _LOAD_FAST_7 + { + PyObject *value; + oparg = 7; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + // _LOAD_FAST_7 + { + PyObject *value; + oparg = 7; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_0__LOAD_FAST_0: { + // _STORE_FAST_0 + { + PyObject *value; + oparg = 0; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_0 + { + PyObject *value; + oparg = 0; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_0__LOAD_FAST_1: { + // _STORE_FAST_0 + { + PyObject *value; + oparg = 0; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_1 + { + PyObject *value; + oparg = 1; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_0__LOAD_FAST_2: { + // _STORE_FAST_0 + { + PyObject *value; + oparg = 0; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_2 + { + PyObject *value; + oparg = 2; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_0__LOAD_FAST_3: { + // _STORE_FAST_0 + { + PyObject *value; + oparg = 0; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_3 + { + PyObject *value; + oparg = 3; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_0__LOAD_FAST_4: { + // _STORE_FAST_0 + { + PyObject *value; + oparg = 0; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_4 + { + PyObject *value; + oparg = 4; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_0__LOAD_FAST_5: { + // _STORE_FAST_0 + { + PyObject *value; + oparg = 0; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_5 + { + PyObject *value; + oparg = 5; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_0__LOAD_FAST_6: { + // _STORE_FAST_0 + { + PyObject *value; + oparg = 0; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_6 + { + PyObject *value; + oparg = 6; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_0__LOAD_FAST_7: { + // _STORE_FAST_0 + { + PyObject *value; + oparg = 0; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_7 + { + PyObject *value; + oparg = 7; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_1__LOAD_FAST_0: { + // _STORE_FAST_1 + { + PyObject *value; + oparg = 1; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_0 + { + PyObject *value; + oparg = 0; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_1__LOAD_FAST_1: { + // _STORE_FAST_1 + { + PyObject *value; + oparg = 1; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_1 + { + PyObject *value; + oparg = 1; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_1__LOAD_FAST_2: { + // _STORE_FAST_1 + { + PyObject *value; + oparg = 1; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_2 + { + PyObject *value; + oparg = 2; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_1__LOAD_FAST_3: { + // _STORE_FAST_1 + { + PyObject *value; + oparg = 1; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_3 + { + PyObject *value; + oparg = 3; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_1__LOAD_FAST_4: { + // _STORE_FAST_1 + { + PyObject *value; + oparg = 1; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_4 + { + PyObject *value; + oparg = 4; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_1__LOAD_FAST_5: { + // _STORE_FAST_1 + { + PyObject *value; + oparg = 1; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_5 + { + PyObject *value; + oparg = 5; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_1__LOAD_FAST_6: { + // _STORE_FAST_1 + { + PyObject *value; + oparg = 1; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_6 + { + PyObject *value; + oparg = 6; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_1__LOAD_FAST_7: { + // _STORE_FAST_1 + { + PyObject *value; + oparg = 1; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_7 + { + PyObject *value; + oparg = 7; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_2__LOAD_FAST_0: { + // _STORE_FAST_2 + { + PyObject *value; + oparg = 2; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_0 + { + PyObject *value; + oparg = 0; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_2__LOAD_FAST_1: { + // _STORE_FAST_2 + { + PyObject *value; + oparg = 2; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_1 + { + PyObject *value; + oparg = 1; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_2__LOAD_FAST_2: { + // _STORE_FAST_2 + { + PyObject *value; + oparg = 2; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_2 + { + PyObject *value; + oparg = 2; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_2__LOAD_FAST_3: { + // _STORE_FAST_2 + { + PyObject *value; + oparg = 2; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_3 + { + PyObject *value; + oparg = 3; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_2__LOAD_FAST_4: { + // _STORE_FAST_2 + { + PyObject *value; + oparg = 2; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_4 + { + PyObject *value; + oparg = 4; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_2__LOAD_FAST_5: { + // _STORE_FAST_2 + { + PyObject *value; + oparg = 2; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_5 + { + PyObject *value; + oparg = 5; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_2__LOAD_FAST_6: { + // _STORE_FAST_2 + { + PyObject *value; + oparg = 2; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_6 + { + PyObject *value; + oparg = 6; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_2__LOAD_FAST_7: { + // _STORE_FAST_2 + { + PyObject *value; + oparg = 2; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_7 + { + PyObject *value; + oparg = 7; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_3__LOAD_FAST_0: { + // _STORE_FAST_3 + { + PyObject *value; + oparg = 3; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_0 + { + PyObject *value; + oparg = 0; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_3__LOAD_FAST_1: { + // _STORE_FAST_3 + { + PyObject *value; + oparg = 3; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_1 + { + PyObject *value; + oparg = 1; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_3__LOAD_FAST_2: { + // _STORE_FAST_3 + { + PyObject *value; + oparg = 3; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_2 + { + PyObject *value; + oparg = 2; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_3__LOAD_FAST_3: { + // _STORE_FAST_3 + { + PyObject *value; + oparg = 3; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_3 + { + PyObject *value; + oparg = 3; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_3__LOAD_FAST_4: { + // _STORE_FAST_3 + { + PyObject *value; + oparg = 3; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_4 + { + PyObject *value; + oparg = 4; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_3__LOAD_FAST_5: { + // _STORE_FAST_3 + { + PyObject *value; + oparg = 3; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_5 + { + PyObject *value; + oparg = 5; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_3__LOAD_FAST_6: { + // _STORE_FAST_3 + { + PyObject *value; + oparg = 3; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_6 + { + PyObject *value; + oparg = 6; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_3__LOAD_FAST_7: { + // _STORE_FAST_3 + { + PyObject *value; + oparg = 3; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_7 + { + PyObject *value; + oparg = 7; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_4__LOAD_FAST_0: { + // _STORE_FAST_4 + { + PyObject *value; + oparg = 4; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_0 + { + PyObject *value; + oparg = 0; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_4__LOAD_FAST_1: { + // _STORE_FAST_4 + { + PyObject *value; + oparg = 4; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_1 + { + PyObject *value; + oparg = 1; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_4__LOAD_FAST_2: { + // _STORE_FAST_4 + { + PyObject *value; + oparg = 4; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_2 + { + PyObject *value; + oparg = 2; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_4__LOAD_FAST_3: { + // _STORE_FAST_4 + { + PyObject *value; + oparg = 4; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_3 + { + PyObject *value; + oparg = 3; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_4__LOAD_FAST_4: { + // _STORE_FAST_4 + { + PyObject *value; + oparg = 4; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_4 + { + PyObject *value; + oparg = 4; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_4__LOAD_FAST_5: { + // _STORE_FAST_4 + { + PyObject *value; + oparg = 4; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_5 + { + PyObject *value; + oparg = 5; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_4__LOAD_FAST_6: { + // _STORE_FAST_4 + { + PyObject *value; + oparg = 4; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_6 + { + PyObject *value; + oparg = 6; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_4__LOAD_FAST_7: { + // _STORE_FAST_4 + { + PyObject *value; + oparg = 4; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_7 + { + PyObject *value; + oparg = 7; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_5__LOAD_FAST_0: { + // _STORE_FAST_5 + { + PyObject *value; + oparg = 5; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_0 + { + PyObject *value; + oparg = 0; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_5__LOAD_FAST_1: { + // _STORE_FAST_5 + { + PyObject *value; + oparg = 5; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_1 + { + PyObject *value; + oparg = 1; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_5__LOAD_FAST_2: { + // _STORE_FAST_5 + { + PyObject *value; + oparg = 5; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_2 + { + PyObject *value; + oparg = 2; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_5__LOAD_FAST_3: { + // _STORE_FAST_5 + { + PyObject *value; + oparg = 5; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_3 + { + PyObject *value; + oparg = 3; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_5__LOAD_FAST_4: { + // _STORE_FAST_5 + { + PyObject *value; + oparg = 5; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_4 + { + PyObject *value; + oparg = 4; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_5__LOAD_FAST_5: { + // _STORE_FAST_5 + { + PyObject *value; + oparg = 5; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_5 + { + PyObject *value; + oparg = 5; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_5__LOAD_FAST_6: { + // _STORE_FAST_5 + { + PyObject *value; + oparg = 5; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_6 + { + PyObject *value; + oparg = 6; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_5__LOAD_FAST_7: { + // _STORE_FAST_5 + { + PyObject *value; + oparg = 5; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_7 + { + PyObject *value; + oparg = 7; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_6__LOAD_FAST_0: { + // _STORE_FAST_6 + { + PyObject *value; + oparg = 6; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_0 + { + PyObject *value; + oparg = 0; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_6__LOAD_FAST_1: { + // _STORE_FAST_6 + { + PyObject *value; + oparg = 6; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_1 + { + PyObject *value; + oparg = 1; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_6__LOAD_FAST_2: { + // _STORE_FAST_6 + { + PyObject *value; + oparg = 6; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_2 + { + PyObject *value; + oparg = 2; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_6__LOAD_FAST_3: { + // _STORE_FAST_6 + { + PyObject *value; + oparg = 6; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_3 + { + PyObject *value; + oparg = 3; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_6__LOAD_FAST_4: { + // _STORE_FAST_6 + { + PyObject *value; + oparg = 6; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_4 + { + PyObject *value; + oparg = 4; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_6__LOAD_FAST_5: { + // _STORE_FAST_6 + { + PyObject *value; + oparg = 6; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_5 + { + PyObject *value; + oparg = 5; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_6__LOAD_FAST_6: { + // _STORE_FAST_6 + { + PyObject *value; + oparg = 6; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_6 + { + PyObject *value; + oparg = 6; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_6__LOAD_FAST_7: { + // _STORE_FAST_6 + { + PyObject *value; + oparg = 6; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_7 + { + PyObject *value; + oparg = 7; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_7__LOAD_FAST_0: { + // _STORE_FAST_7 + { + PyObject *value; + oparg = 7; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_0 + { + PyObject *value; + oparg = 0; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_7__LOAD_FAST_1: { + // _STORE_FAST_7 + { + PyObject *value; + oparg = 7; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_1 + { + PyObject *value; + oparg = 1; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_7__LOAD_FAST_2: { + // _STORE_FAST_7 + { + PyObject *value; + oparg = 7; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_2 + { + PyObject *value; + oparg = 2; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_7__LOAD_FAST_3: { + // _STORE_FAST_7 + { + PyObject *value; + oparg = 7; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_3 + { + PyObject *value; + oparg = 3; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_7__LOAD_FAST_4: { + // _STORE_FAST_7 + { + PyObject *value; + oparg = 7; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_4 + { + PyObject *value; + oparg = 4; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_7__LOAD_FAST_5: { + // _STORE_FAST_7 + { + PyObject *value; + oparg = 7; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_5 + { + PyObject *value; + oparg = 5; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_7__LOAD_FAST_6: { + // _STORE_FAST_7 + { + PyObject *value; + oparg = 7; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_6 + { + PyObject *value; + oparg = 6; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case __STORE_FAST_7__LOAD_FAST_7: { + // _STORE_FAST_7 + { + PyObject *value; + oparg = 7; + value = stack_pointer[-1]; + SETLOCAL(oparg, value); + stack_pointer += -1; + } + // _LOAD_FAST_7 + { + PyObject *value; + oparg = 7; + value = GETLOCAL(oparg); + assert(value != NULL); + Py_INCREF(value); + stack_pointer[0] = value; + stack_pointer += 1; + } + break; + } + + case _GUARD_BOTH_INT__BINARY_OP_MULTIPLY_INT: { + // _GUARD_BOTH_INT + { + PyObject *right; + PyObject *left; + right = stack_pointer[-1]; + left = stack_pointer[-2]; + if (!PyLong_CheckExact(left)) goto deoptimize; + if (!PyLong_CheckExact(right)) goto deoptimize; + } + // _BINARY_OP_MULTIPLY_INT + { + PyObject *right; + PyObject *left; + PyObject *res; + right = stack_pointer[-1]; + left = stack_pointer[-2]; + STAT_INC(BINARY_OP, hit); + res = _PyLong_Multiply((PyLongObject *)left, (PyLongObject *)right); + _Py_DECREF_SPECIALIZED(right, (destructor)PyObject_Free); + _Py_DECREF_SPECIALIZED(left, (destructor)PyObject_Free); + if (res == NULL) goto pop_2_error_tier_two; + stack_pointer[-2] = res; + stack_pointer += -1; + } + break; + } + + case _GUARD_BOTH_INT__BINARY_OP_ADD_INT: { + // _GUARD_BOTH_INT + { + PyObject *right; + PyObject *left; + right = stack_pointer[-1]; + left = stack_pointer[-2]; + if (!PyLong_CheckExact(left)) goto deoptimize; + if (!PyLong_CheckExact(right)) goto deoptimize; + } + // _BINARY_OP_ADD_INT + { + PyObject *right; + PyObject *left; + PyObject *res; + right = stack_pointer[-1]; + left = stack_pointer[-2]; + STAT_INC(BINARY_OP, hit); + res = _PyLong_Add((PyLongObject *)left, (PyLongObject *)right); + _Py_DECREF_SPECIALIZED(right, (destructor)PyObject_Free); + _Py_DECREF_SPECIALIZED(left, (destructor)PyObject_Free); + if (res == NULL) goto pop_2_error_tier_two; + stack_pointer[-2] = res; + stack_pointer += -1; + } + break; + } + + case _GUARD_BOTH_INT__BINARY_OP_SUBTRACT_INT: { + // _GUARD_BOTH_INT + { + PyObject *right; + PyObject *left; + right = stack_pointer[-1]; + left = stack_pointer[-2]; + if (!PyLong_CheckExact(left)) goto deoptimize; + if (!PyLong_CheckExact(right)) goto deoptimize; + } + // _BINARY_OP_SUBTRACT_INT + { + PyObject *right; + PyObject *left; + PyObject *res; + right = stack_pointer[-1]; + left = stack_pointer[-2]; + STAT_INC(BINARY_OP, hit); + res = _PyLong_Subtract((PyLongObject *)left, (PyLongObject *)right); + _Py_DECREF_SPECIALIZED(right, (destructor)PyObject_Free); + _Py_DECREF_SPECIALIZED(left, (destructor)PyObject_Free); + if (res == NULL) goto pop_2_error_tier_two; + stack_pointer[-2] = res; + stack_pointer += -1; + } + break; + } + + case _GUARD_BOTH_FLOAT__BINARY_OP_MULTIPLY_FLOAT: { + // _GUARD_BOTH_FLOAT + { + PyObject *right; + PyObject *left; + right = stack_pointer[-1]; + left = stack_pointer[-2]; + if (!PyFloat_CheckExact(left)) goto deoptimize; + if (!PyFloat_CheckExact(right)) goto deoptimize; + } + // _BINARY_OP_MULTIPLY_FLOAT + { + PyObject *right; + PyObject *left; + PyObject *res; + right = stack_pointer[-1]; + left = stack_pointer[-2]; + STAT_INC(BINARY_OP, hit); + double dres = + ((PyFloatObject *)left)->ob_fval * + ((PyFloatObject *)right)->ob_fval; + DECREF_INPUTS_AND_REUSE_FLOAT(left, right, dres, res); + stack_pointer[-2] = res; + stack_pointer += -1; + } + break; + } + + case _GUARD_BOTH_FLOAT__BINARY_OP_ADD_FLOAT: { + // _GUARD_BOTH_FLOAT + { + PyObject *right; + PyObject *left; + right = stack_pointer[-1]; + left = stack_pointer[-2]; + if (!PyFloat_CheckExact(left)) goto deoptimize; + if (!PyFloat_CheckExact(right)) goto deoptimize; + } + // _BINARY_OP_ADD_FLOAT + { + PyObject *right; + PyObject *left; + PyObject *res; + right = stack_pointer[-1]; + left = stack_pointer[-2]; + STAT_INC(BINARY_OP, hit); + double dres = + ((PyFloatObject *)left)->ob_fval + + ((PyFloatObject *)right)->ob_fval; + DECREF_INPUTS_AND_REUSE_FLOAT(left, right, dres, res); + stack_pointer[-2] = res; + stack_pointer += -1; + } + break; + } + + case _GUARD_BOTH_FLOAT__BINARY_OP_SUBTRACT_FLOAT: { + // _GUARD_BOTH_FLOAT + { + PyObject *right; + PyObject *left; + right = stack_pointer[-1]; + left = stack_pointer[-2]; + if (!PyFloat_CheckExact(left)) goto deoptimize; + if (!PyFloat_CheckExact(right)) goto deoptimize; + } + // _BINARY_OP_SUBTRACT_FLOAT + { + PyObject *right; + PyObject *left; + PyObject *res; + right = stack_pointer[-1]; + left = stack_pointer[-2]; + STAT_INC(BINARY_OP, hit); + double dres = + ((PyFloatObject *)left)->ob_fval - + ((PyFloatObject *)right)->ob_fval; + DECREF_INPUTS_AND_REUSE_FLOAT(left, right, dres, res); + stack_pointer[-2] = res; + stack_pointer += -1; + } + break; + } + + case _GUARD_BOTH_UNICODE__BINARY_OP_ADD_UNICODE: { + // _GUARD_BOTH_UNICODE + { + PyObject *right; + PyObject *left; + right = stack_pointer[-1]; + left = stack_pointer[-2]; + if (!PyUnicode_CheckExact(left)) goto deoptimize; + if (!PyUnicode_CheckExact(right)) goto deoptimize; + } + // _BINARY_OP_ADD_UNICODE + { + PyObject *right; + PyObject *left; + PyObject *res; + right = stack_pointer[-1]; + left = stack_pointer[-2]; + STAT_INC(BINARY_OP, hit); + res = PyUnicode_Concat(left, right); + _Py_DECREF_SPECIALIZED(left, _PyUnicode_ExactDealloc); + _Py_DECREF_SPECIALIZED(right, _PyUnicode_ExactDealloc); + if (res == NULL) goto pop_2_error_tier_two; + stack_pointer[-2] = res; + stack_pointer += -1; + } + break; + } + + case _CALL_BOUND_METHOD_EXACT_ARGS: { + // _CHECK_CALL_BOUND_METHOD_EXACT_ARGS + { + PyObject *null; + PyObject *callable; + oparg = CURRENT_OPARG(); + null = stack_pointer[-1 - oparg]; + callable = stack_pointer[-2 - oparg]; + if (null != NULL) goto deoptimize; + if (Py_TYPE(callable) != &PyMethod_Type) goto deoptimize; + } + // _INIT_CALL_BOUND_METHOD_EXACT_ARGS + { + PyObject *callable; + PyObject *func; + PyObject *self; + oparg = CURRENT_OPARG(); + callable = stack_pointer[-2 - oparg]; + STAT_INC(CALL, hit); + self = Py_NewRef(((PyMethodObject *)callable)->im_self); + stack_pointer[-1 - oparg] = self; // Patch stack as it is used by _INIT_CALL_PY_EXACT_ARGS + func = Py_NewRef(((PyMethodObject *)callable)->im_func); + stack_pointer[-2 - oparg] = func; // This is used by CALL, upon deoptimization + Py_DECREF(callable); + stack_pointer[-2 - oparg] = func; + stack_pointer[-1 - oparg] = self; + } + // _CHECK_FUNCTION_EXACT_ARGS + { + PyObject *self_or_null; + PyObject *callable; + oparg = CURRENT_OPARG(); + self_or_null = stack_pointer[-1 - oparg]; + callable = stack_pointer[-2 - oparg]; + uint32_t func_version = (uint32_t)CURRENT_OPERAND(); + if (!PyFunction_Check(callable)) goto deoptimize; + PyFunctionObject *func = (PyFunctionObject *)callable; + if (func->func_version != func_version) goto deoptimize; + PyCodeObject *code = (PyCodeObject *)func->func_code; + if (code->co_argcount != oparg + (self_or_null != NULL)) goto deoptimize; + } + // _CHECK_STACK_SPACE + { + PyObject *callable; + oparg = CURRENT_OPARG(); + callable = stack_pointer[-2 - oparg]; + PyFunctionObject *func = (PyFunctionObject *)callable; + PyCodeObject *code = (PyCodeObject *)func->func_code; + if (!_PyThreadState_HasStackSpace(tstate, code->co_framesize)) goto deoptimize; + if (tstate->py_recursion_remaining <= 1) goto deoptimize; + } + // _INIT_CALL_PY_EXACT_ARGS + { + PyObject **args; + PyObject *self_or_null; + PyObject *callable; + _PyInterpreterFrame *new_frame; + oparg = CURRENT_OPARG(); + args = &stack_pointer[-oparg]; + self_or_null = stack_pointer[-1 - oparg]; + callable = stack_pointer[-2 - oparg]; + int argcount = oparg; + if (self_or_null != NULL) { + args--; + argcount++; + } + STAT_INC(CALL, hit); + PyFunctionObject *func = (PyFunctionObject *)callable; + new_frame = _PyFrame_PushUnchecked(tstate, func, argcount); + for (int i = 0; i < argcount; i++) { + new_frame->localsplus[i] = args[i]; + } + stack_pointer[-2 - oparg] = (PyObject *)new_frame; + stack_pointer += -1 - oparg; + } + break; + } + + case _CALL_BOUND_METHOD_EXACT_ARGS_0: { + // _CHECK_CALL_BOUND_METHOD_EXACT_ARGS + { + PyObject *null; + PyObject *callable; + oparg = CURRENT_OPARG(); + null = stack_pointer[-1 - oparg]; + callable = stack_pointer[-2 - oparg]; + if (null != NULL) goto deoptimize; + if (Py_TYPE(callable) != &PyMethod_Type) goto deoptimize; + } + // _INIT_CALL_BOUND_METHOD_EXACT_ARGS + { + PyObject *callable; + PyObject *func; + PyObject *self; + oparg = CURRENT_OPARG(); + callable = stack_pointer[-2 - oparg]; + STAT_INC(CALL, hit); + self = Py_NewRef(((PyMethodObject *)callable)->im_self); + stack_pointer[-1 - oparg] = self; // Patch stack as it is used by _INIT_CALL_PY_EXACT_ARGS + func = Py_NewRef(((PyMethodObject *)callable)->im_func); + stack_pointer[-2 - oparg] = func; // This is used by CALL, upon deoptimization + Py_DECREF(callable); + stack_pointer[-2 - oparg] = func; + stack_pointer[-1 - oparg] = self; + } + // _CHECK_FUNCTION_EXACT_ARGS_0 + { + PyObject *self_or_null; + PyObject *callable; + oparg = 0; + assert(oparg == CURRENT_OPARG()); + self_or_null = stack_pointer[-1 - oparg]; + callable = stack_pointer[-2 - oparg]; + uint32_t func_version = (uint32_t)CURRENT_OPERAND(); + if (!PyFunction_Check(callable)) goto deoptimize; + PyFunctionObject *func = (PyFunctionObject *)callable; + if (func->func_version != func_version) goto deoptimize; + PyCodeObject *code = (PyCodeObject *)func->func_code; + if (code->co_argcount != oparg + (self_or_null != NULL)) goto deoptimize; + } + // _CHECK_STACK_SPACE_0 + { + PyObject *callable; + oparg = 0; + assert(oparg == CURRENT_OPARG()); + callable = stack_pointer[-2 - oparg]; + PyFunctionObject *func = (PyFunctionObject *)callable; + PyCodeObject *code = (PyCodeObject *)func->func_code; + if (!_PyThreadState_HasStackSpace(tstate, code->co_framesize)) goto deoptimize; + if (tstate->py_recursion_remaining <= 1) goto deoptimize; + } + // _INIT_CALL_PY_EXACT_ARGS_0 + { + PyObject **args; + PyObject *self_or_null; + PyObject *callable; + _PyInterpreterFrame *new_frame; + oparg = 0; + assert(oparg == CURRENT_OPARG()); + args = &stack_pointer[-oparg]; + self_or_null = stack_pointer[-1 - oparg]; + callable = stack_pointer[-2 - oparg]; + int argcount = oparg; + if (self_or_null != NULL) { + args--; + argcount++; + } + STAT_INC(CALL, hit); + PyFunctionObject *func = (PyFunctionObject *)callable; + new_frame = _PyFrame_PushUnchecked(tstate, func, argcount); + for (int i = 0; i < argcount; i++) { + new_frame->localsplus[i] = args[i]; + } + stack_pointer[-2 - oparg] = (PyObject *)new_frame; + stack_pointer += -1 - oparg; + } + break; + } + + case _CALL_BOUND_METHOD_EXACT_ARGS_1: { + // _CHECK_CALL_BOUND_METHOD_EXACT_ARGS + { + PyObject *null; + PyObject *callable; + oparg = CURRENT_OPARG(); + null = stack_pointer[-1 - oparg]; + callable = stack_pointer[-2 - oparg]; + if (null != NULL) goto deoptimize; + if (Py_TYPE(callable) != &PyMethod_Type) goto deoptimize; + } + // _INIT_CALL_BOUND_METHOD_EXACT_ARGS + { + PyObject *callable; + PyObject *func; + PyObject *self; + oparg = CURRENT_OPARG(); + callable = stack_pointer[-2 - oparg]; + STAT_INC(CALL, hit); + self = Py_NewRef(((PyMethodObject *)callable)->im_self); + stack_pointer[-1 - oparg] = self; // Patch stack as it is used by _INIT_CALL_PY_EXACT_ARGS + func = Py_NewRef(((PyMethodObject *)callable)->im_func); + stack_pointer[-2 - oparg] = func; // This is used by CALL, upon deoptimization + Py_DECREF(callable); + stack_pointer[-2 - oparg] = func; + stack_pointer[-1 - oparg] = self; + } + // _CHECK_FUNCTION_EXACT_ARGS_1 + { + PyObject *self_or_null; + PyObject *callable; + oparg = 1; + assert(oparg == CURRENT_OPARG()); + self_or_null = stack_pointer[-1 - oparg]; + callable = stack_pointer[-2 - oparg]; + uint32_t func_version = (uint32_t)CURRENT_OPERAND(); + if (!PyFunction_Check(callable)) goto deoptimize; + PyFunctionObject *func = (PyFunctionObject *)callable; + if (func->func_version != func_version) goto deoptimize; + PyCodeObject *code = (PyCodeObject *)func->func_code; + if (code->co_argcount != oparg + (self_or_null != NULL)) goto deoptimize; + } + // _CHECK_STACK_SPACE_1 + { + PyObject *callable; + oparg = 1; + assert(oparg == CURRENT_OPARG()); + callable = stack_pointer[-2 - oparg]; + PyFunctionObject *func = (PyFunctionObject *)callable; + PyCodeObject *code = (PyCodeObject *)func->func_code; + if (!_PyThreadState_HasStackSpace(tstate, code->co_framesize)) goto deoptimize; + if (tstate->py_recursion_remaining <= 1) goto deoptimize; + } + // _INIT_CALL_PY_EXACT_ARGS_1 + { + PyObject **args; + PyObject *self_or_null; + PyObject *callable; + _PyInterpreterFrame *new_frame; + oparg = 1; + assert(oparg == CURRENT_OPARG()); + args = &stack_pointer[-oparg]; + self_or_null = stack_pointer[-1 - oparg]; + callable = stack_pointer[-2 - oparg]; + int argcount = oparg; + if (self_or_null != NULL) { + args--; + argcount++; + } + STAT_INC(CALL, hit); + PyFunctionObject *func = (PyFunctionObject *)callable; + new_frame = _PyFrame_PushUnchecked(tstate, func, argcount); + for (int i = 0; i < argcount; i++) { + new_frame->localsplus[i] = args[i]; + } + stack_pointer[-2 - oparg] = (PyObject *)new_frame; + stack_pointer += -1 - oparg; + } + break; + } + + case _CALL_BOUND_METHOD_EXACT_ARGS_2: { + // _CHECK_CALL_BOUND_METHOD_EXACT_ARGS + { + PyObject *null; + PyObject *callable; + oparg = CURRENT_OPARG(); + null = stack_pointer[-1 - oparg]; + callable = stack_pointer[-2 - oparg]; + if (null != NULL) goto deoptimize; + if (Py_TYPE(callable) != &PyMethod_Type) goto deoptimize; + } + // _INIT_CALL_BOUND_METHOD_EXACT_ARGS + { + PyObject *callable; + PyObject *func; + PyObject *self; + oparg = CURRENT_OPARG(); + callable = stack_pointer[-2 - oparg]; + STAT_INC(CALL, hit); + self = Py_NewRef(((PyMethodObject *)callable)->im_self); + stack_pointer[-1 - oparg] = self; // Patch stack as it is used by _INIT_CALL_PY_EXACT_ARGS + func = Py_NewRef(((PyMethodObject *)callable)->im_func); + stack_pointer[-2 - oparg] = func; // This is used by CALL, upon deoptimization + Py_DECREF(callable); + stack_pointer[-2 - oparg] = func; + stack_pointer[-1 - oparg] = self; + } + // _CHECK_FUNCTION_EXACT_ARGS_2 + { + PyObject *self_or_null; + PyObject *callable; + oparg = 2; + assert(oparg == CURRENT_OPARG()); + self_or_null = stack_pointer[-1 - oparg]; + callable = stack_pointer[-2 - oparg]; + uint32_t func_version = (uint32_t)CURRENT_OPERAND(); + if (!PyFunction_Check(callable)) goto deoptimize; + PyFunctionObject *func = (PyFunctionObject *)callable; + if (func->func_version != func_version) goto deoptimize; + PyCodeObject *code = (PyCodeObject *)func->func_code; + if (code->co_argcount != oparg + (self_or_null != NULL)) goto deoptimize; + } + // _CHECK_STACK_SPACE_2 + { + PyObject *callable; + oparg = 2; + assert(oparg == CURRENT_OPARG()); + callable = stack_pointer[-2 - oparg]; + PyFunctionObject *func = (PyFunctionObject *)callable; + PyCodeObject *code = (PyCodeObject *)func->func_code; + if (!_PyThreadState_HasStackSpace(tstate, code->co_framesize)) goto deoptimize; + if (tstate->py_recursion_remaining <= 1) goto deoptimize; + } + // _INIT_CALL_PY_EXACT_ARGS_2 + { + PyObject **args; + PyObject *self_or_null; + PyObject *callable; + _PyInterpreterFrame *new_frame; + oparg = 2; + assert(oparg == CURRENT_OPARG()); + args = &stack_pointer[-oparg]; + self_or_null = stack_pointer[-1 - oparg]; + callable = stack_pointer[-2 - oparg]; + int argcount = oparg; + if (self_or_null != NULL) { + args--; + argcount++; + } + STAT_INC(CALL, hit); + PyFunctionObject *func = (PyFunctionObject *)callable; + new_frame = _PyFrame_PushUnchecked(tstate, func, argcount); + for (int i = 0; i < argcount; i++) { + new_frame->localsplus[i] = args[i]; + } + stack_pointer[-2 - oparg] = (PyObject *)new_frame; + stack_pointer += -1 - oparg; + } + break; + } + + case _CALL_BOUND_METHOD_EXACT_ARGS_3: { + // _CHECK_CALL_BOUND_METHOD_EXACT_ARGS + { + PyObject *null; + PyObject *callable; + oparg = CURRENT_OPARG(); + null = stack_pointer[-1 - oparg]; + callable = stack_pointer[-2 - oparg]; + if (null != NULL) goto deoptimize; + if (Py_TYPE(callable) != &PyMethod_Type) goto deoptimize; + } + // _INIT_CALL_BOUND_METHOD_EXACT_ARGS + { + PyObject *callable; + PyObject *func; + PyObject *self; + oparg = CURRENT_OPARG(); + callable = stack_pointer[-2 - oparg]; + STAT_INC(CALL, hit); + self = Py_NewRef(((PyMethodObject *)callable)->im_self); + stack_pointer[-1 - oparg] = self; // Patch stack as it is used by _INIT_CALL_PY_EXACT_ARGS + func = Py_NewRef(((PyMethodObject *)callable)->im_func); + stack_pointer[-2 - oparg] = func; // This is used by CALL, upon deoptimization + Py_DECREF(callable); + stack_pointer[-2 - oparg] = func; + stack_pointer[-1 - oparg] = self; + } + // _CHECK_FUNCTION_EXACT_ARGS_3 + { + PyObject *self_or_null; + PyObject *callable; + oparg = 3; + assert(oparg == CURRENT_OPARG()); + self_or_null = stack_pointer[-1 - oparg]; + callable = stack_pointer[-2 - oparg]; + uint32_t func_version = (uint32_t)CURRENT_OPERAND(); + if (!PyFunction_Check(callable)) goto deoptimize; + PyFunctionObject *func = (PyFunctionObject *)callable; + if (func->func_version != func_version) goto deoptimize; + PyCodeObject *code = (PyCodeObject *)func->func_code; + if (code->co_argcount != oparg + (self_or_null != NULL)) goto deoptimize; + } + // _CHECK_STACK_SPACE_3 + { + PyObject *callable; + oparg = 3; + assert(oparg == CURRENT_OPARG()); + callable = stack_pointer[-2 - oparg]; + PyFunctionObject *func = (PyFunctionObject *)callable; + PyCodeObject *code = (PyCodeObject *)func->func_code; + if (!_PyThreadState_HasStackSpace(tstate, code->co_framesize)) goto deoptimize; + if (tstate->py_recursion_remaining <= 1) goto deoptimize; + } + // _INIT_CALL_PY_EXACT_ARGS_3 + { + PyObject **args; + PyObject *self_or_null; + PyObject *callable; + _PyInterpreterFrame *new_frame; + oparg = 3; + assert(oparg == CURRENT_OPARG()); + args = &stack_pointer[-oparg]; + self_or_null = stack_pointer[-1 - oparg]; + callable = stack_pointer[-2 - oparg]; + int argcount = oparg; + if (self_or_null != NULL) { + args--; + argcount++; + } + STAT_INC(CALL, hit); + PyFunctionObject *func = (PyFunctionObject *)callable; + new_frame = _PyFrame_PushUnchecked(tstate, func, argcount); + for (int i = 0; i < argcount; i++) { + new_frame->localsplus[i] = args[i]; + } + stack_pointer[-2 - oparg] = (PyObject *)new_frame; + stack_pointer += -1 - oparg; + } + break; + } + + case _CALL_BOUND_METHOD_EXACT_ARGS_4: { + // _CHECK_CALL_BOUND_METHOD_EXACT_ARGS + { + PyObject *null; + PyObject *callable; + oparg = CURRENT_OPARG(); + null = stack_pointer[-1 - oparg]; + callable = stack_pointer[-2 - oparg]; + if (null != NULL) goto deoptimize; + if (Py_TYPE(callable) != &PyMethod_Type) goto deoptimize; + } + // _INIT_CALL_BOUND_METHOD_EXACT_ARGS + { + PyObject *callable; + PyObject *func; + PyObject *self; + oparg = CURRENT_OPARG(); + callable = stack_pointer[-2 - oparg]; + STAT_INC(CALL, hit); + self = Py_NewRef(((PyMethodObject *)callable)->im_self); + stack_pointer[-1 - oparg] = self; // Patch stack as it is used by _INIT_CALL_PY_EXACT_ARGS + func = Py_NewRef(((PyMethodObject *)callable)->im_func); + stack_pointer[-2 - oparg] = func; // This is used by CALL, upon deoptimization + Py_DECREF(callable); + stack_pointer[-2 - oparg] = func; + stack_pointer[-1 - oparg] = self; + } + // _CHECK_FUNCTION_EXACT_ARGS_4 + { + PyObject *self_or_null; + PyObject *callable; + oparg = 4; + assert(oparg == CURRENT_OPARG()); + self_or_null = stack_pointer[-1 - oparg]; + callable = stack_pointer[-2 - oparg]; + uint32_t func_version = (uint32_t)CURRENT_OPERAND(); + if (!PyFunction_Check(callable)) goto deoptimize; + PyFunctionObject *func = (PyFunctionObject *)callable; + if (func->func_version != func_version) goto deoptimize; + PyCodeObject *code = (PyCodeObject *)func->func_code; + if (code->co_argcount != oparg + (self_or_null != NULL)) goto deoptimize; + } + // _CHECK_STACK_SPACE_4 + { + PyObject *callable; + oparg = 4; + assert(oparg == CURRENT_OPARG()); + callable = stack_pointer[-2 - oparg]; + PyFunctionObject *func = (PyFunctionObject *)callable; + PyCodeObject *code = (PyCodeObject *)func->func_code; + if (!_PyThreadState_HasStackSpace(tstate, code->co_framesize)) goto deoptimize; + if (tstate->py_recursion_remaining <= 1) goto deoptimize; + } + // _INIT_CALL_PY_EXACT_ARGS_4 + { + PyObject **args; + PyObject *self_or_null; + PyObject *callable; + _PyInterpreterFrame *new_frame; + oparg = 4; + assert(oparg == CURRENT_OPARG()); + args = &stack_pointer[-oparg]; + self_or_null = stack_pointer[-1 - oparg]; + callable = stack_pointer[-2 - oparg]; + int argcount = oparg; + if (self_or_null != NULL) { + args--; + argcount++; + } + STAT_INC(CALL, hit); + PyFunctionObject *func = (PyFunctionObject *)callable; + new_frame = _PyFrame_PushUnchecked(tstate, func, argcount); + for (int i = 0; i < argcount; i++) { + new_frame->localsplus[i] = args[i]; + } + stack_pointer[-2 - oparg] = (PyObject *)new_frame; + stack_pointer += -1 - oparg; + } + break; + } + + case _CHECK_CALL_PY_EXACT_ARGS: { + // _CHECK_FUNCTION_EXACT_ARGS + { + PyObject *self_or_null; + PyObject *callable; + oparg = CURRENT_OPARG(); + self_or_null = stack_pointer[-1 - oparg]; + callable = stack_pointer[-2 - oparg]; + uint32_t func_version = (uint32_t)CURRENT_OPERAND(); + if (!PyFunction_Check(callable)) goto deoptimize; + PyFunctionObject *func = (PyFunctionObject *)callable; + if (func->func_version != func_version) goto deoptimize; + PyCodeObject *code = (PyCodeObject *)func->func_code; + if (code->co_argcount != oparg + (self_or_null != NULL)) goto deoptimize; + } + // _CHECK_STACK_SPACE + { + PyObject *callable; + oparg = CURRENT_OPARG(); + callable = stack_pointer[-2 - oparg]; + PyFunctionObject *func = (PyFunctionObject *)callable; + PyCodeObject *code = (PyCodeObject *)func->func_code; + if (!_PyThreadState_HasStackSpace(tstate, code->co_framesize)) goto deoptimize; + if (tstate->py_recursion_remaining <= 1) goto deoptimize; + } + // _INIT_CALL_PY_EXACT_ARGS + { + PyObject **args; + PyObject *self_or_null; + PyObject *callable; + _PyInterpreterFrame *new_frame; + oparg = CURRENT_OPARG(); + args = &stack_pointer[-oparg]; + self_or_null = stack_pointer[-1 - oparg]; + callable = stack_pointer[-2 - oparg]; + int argcount = oparg; + if (self_or_null != NULL) { + args--; + argcount++; + } + STAT_INC(CALL, hit); + PyFunctionObject *func = (PyFunctionObject *)callable; + new_frame = _PyFrame_PushUnchecked(tstate, func, argcount); + for (int i = 0; i < argcount; i++) { + new_frame->localsplus[i] = args[i]; + } + stack_pointer[-2 - oparg] = (PyObject *)new_frame; + stack_pointer += -1 - oparg; + } + break; + } + + case _CHECK_CALL_PY_EXACT_ARGS_0: { + // _CHECK_FUNCTION_EXACT_ARGS_0 + { + PyObject *self_or_null; + PyObject *callable; + oparg = 0; + assert(oparg == CURRENT_OPARG()); + self_or_null = stack_pointer[-1 - oparg]; + callable = stack_pointer[-2 - oparg]; + uint32_t func_version = (uint32_t)CURRENT_OPERAND(); + if (!PyFunction_Check(callable)) goto deoptimize; + PyFunctionObject *func = (PyFunctionObject *)callable; + if (func->func_version != func_version) goto deoptimize; + PyCodeObject *code = (PyCodeObject *)func->func_code; + if (code->co_argcount != oparg + (self_or_null != NULL)) goto deoptimize; + } + // _CHECK_STACK_SPACE_0 + { + PyObject *callable; + oparg = 0; + assert(oparg == CURRENT_OPARG()); + callable = stack_pointer[-2 - oparg]; + PyFunctionObject *func = (PyFunctionObject *)callable; + PyCodeObject *code = (PyCodeObject *)func->func_code; + if (!_PyThreadState_HasStackSpace(tstate, code->co_framesize)) goto deoptimize; + if (tstate->py_recursion_remaining <= 1) goto deoptimize; + } + // _INIT_CALL_PY_EXACT_ARGS_0 + { + PyObject **args; + PyObject *self_or_null; + PyObject *callable; + _PyInterpreterFrame *new_frame; + oparg = 0; + assert(oparg == CURRENT_OPARG()); + args = &stack_pointer[-oparg]; + self_or_null = stack_pointer[-1 - oparg]; + callable = stack_pointer[-2 - oparg]; + int argcount = oparg; + if (self_or_null != NULL) { + args--; + argcount++; + } + STAT_INC(CALL, hit); + PyFunctionObject *func = (PyFunctionObject *)callable; + new_frame = _PyFrame_PushUnchecked(tstate, func, argcount); + for (int i = 0; i < argcount; i++) { + new_frame->localsplus[i] = args[i]; + } + stack_pointer[-2 - oparg] = (PyObject *)new_frame; + stack_pointer += -1 - oparg; + } + break; + } + + case _CHECK_CALL_PY_EXACT_ARGS_1: { + // _CHECK_FUNCTION_EXACT_ARGS_1 + { + PyObject *self_or_null; + PyObject *callable; + oparg = 1; + assert(oparg == CURRENT_OPARG()); + self_or_null = stack_pointer[-1 - oparg]; + callable = stack_pointer[-2 - oparg]; + uint32_t func_version = (uint32_t)CURRENT_OPERAND(); + if (!PyFunction_Check(callable)) goto deoptimize; + PyFunctionObject *func = (PyFunctionObject *)callable; + if (func->func_version != func_version) goto deoptimize; + PyCodeObject *code = (PyCodeObject *)func->func_code; + if (code->co_argcount != oparg + (self_or_null != NULL)) goto deoptimize; + } + // _CHECK_STACK_SPACE_1 + { + PyObject *callable; + oparg = 1; + assert(oparg == CURRENT_OPARG()); + callable = stack_pointer[-2 - oparg]; + PyFunctionObject *func = (PyFunctionObject *)callable; + PyCodeObject *code = (PyCodeObject *)func->func_code; + if (!_PyThreadState_HasStackSpace(tstate, code->co_framesize)) goto deoptimize; + if (tstate->py_recursion_remaining <= 1) goto deoptimize; + } + // _INIT_CALL_PY_EXACT_ARGS_1 + { + PyObject **args; + PyObject *self_or_null; + PyObject *callable; + _PyInterpreterFrame *new_frame; + oparg = 1; + assert(oparg == CURRENT_OPARG()); + args = &stack_pointer[-oparg]; + self_or_null = stack_pointer[-1 - oparg]; + callable = stack_pointer[-2 - oparg]; + int argcount = oparg; + if (self_or_null != NULL) { + args--; + argcount++; + } + STAT_INC(CALL, hit); + PyFunctionObject *func = (PyFunctionObject *)callable; + new_frame = _PyFrame_PushUnchecked(tstate, func, argcount); + for (int i = 0; i < argcount; i++) { + new_frame->localsplus[i] = args[i]; + } + stack_pointer[-2 - oparg] = (PyObject *)new_frame; + stack_pointer += -1 - oparg; + } + break; + } + + case _CHECK_CALL_PY_EXACT_ARGS_2: { + // _CHECK_FUNCTION_EXACT_ARGS_2 + { + PyObject *self_or_null; + PyObject *callable; + oparg = 2; + assert(oparg == CURRENT_OPARG()); + self_or_null = stack_pointer[-1 - oparg]; + callable = stack_pointer[-2 - oparg]; + uint32_t func_version = (uint32_t)CURRENT_OPERAND(); + if (!PyFunction_Check(callable)) goto deoptimize; + PyFunctionObject *func = (PyFunctionObject *)callable; + if (func->func_version != func_version) goto deoptimize; + PyCodeObject *code = (PyCodeObject *)func->func_code; + if (code->co_argcount != oparg + (self_or_null != NULL)) goto deoptimize; + } + // _CHECK_STACK_SPACE_2 + { + PyObject *callable; + oparg = 2; + assert(oparg == CURRENT_OPARG()); + callable = stack_pointer[-2 - oparg]; + PyFunctionObject *func = (PyFunctionObject *)callable; + PyCodeObject *code = (PyCodeObject *)func->func_code; + if (!_PyThreadState_HasStackSpace(tstate, code->co_framesize)) goto deoptimize; + if (tstate->py_recursion_remaining <= 1) goto deoptimize; + } + // _INIT_CALL_PY_EXACT_ARGS_2 + { + PyObject **args; + PyObject *self_or_null; + PyObject *callable; + _PyInterpreterFrame *new_frame; + oparg = 2; + assert(oparg == CURRENT_OPARG()); + args = &stack_pointer[-oparg]; + self_or_null = stack_pointer[-1 - oparg]; + callable = stack_pointer[-2 - oparg]; + int argcount = oparg; + if (self_or_null != NULL) { + args--; + argcount++; + } + STAT_INC(CALL, hit); + PyFunctionObject *func = (PyFunctionObject *)callable; + new_frame = _PyFrame_PushUnchecked(tstate, func, argcount); + for (int i = 0; i < argcount; i++) { + new_frame->localsplus[i] = args[i]; + } + stack_pointer[-2 - oparg] = (PyObject *)new_frame; + stack_pointer += -1 - oparg; + } + break; + } + + case _CHECK_CALL_PY_EXACT_ARGS_3: { + // _CHECK_FUNCTION_EXACT_ARGS_3 + { + PyObject *self_or_null; + PyObject *callable; + oparg = 3; + assert(oparg == CURRENT_OPARG()); + self_or_null = stack_pointer[-1 - oparg]; + callable = stack_pointer[-2 - oparg]; + uint32_t func_version = (uint32_t)CURRENT_OPERAND(); + if (!PyFunction_Check(callable)) goto deoptimize; + PyFunctionObject *func = (PyFunctionObject *)callable; + if (func->func_version != func_version) goto deoptimize; + PyCodeObject *code = (PyCodeObject *)func->func_code; + if (code->co_argcount != oparg + (self_or_null != NULL)) goto deoptimize; + } + // _CHECK_STACK_SPACE_3 + { + PyObject *callable; + oparg = 3; + assert(oparg == CURRENT_OPARG()); + callable = stack_pointer[-2 - oparg]; + PyFunctionObject *func = (PyFunctionObject *)callable; + PyCodeObject *code = (PyCodeObject *)func->func_code; + if (!_PyThreadState_HasStackSpace(tstate, code->co_framesize)) goto deoptimize; + if (tstate->py_recursion_remaining <= 1) goto deoptimize; + } + // _INIT_CALL_PY_EXACT_ARGS_3 + { + PyObject **args; + PyObject *self_or_null; + PyObject *callable; + _PyInterpreterFrame *new_frame; + oparg = 3; + assert(oparg == CURRENT_OPARG()); + args = &stack_pointer[-oparg]; + self_or_null = stack_pointer[-1 - oparg]; + callable = stack_pointer[-2 - oparg]; + int argcount = oparg; + if (self_or_null != NULL) { + args--; + argcount++; + } + STAT_INC(CALL, hit); + PyFunctionObject *func = (PyFunctionObject *)callable; + new_frame = _PyFrame_PushUnchecked(tstate, func, argcount); + for (int i = 0; i < argcount; i++) { + new_frame->localsplus[i] = args[i]; + } + stack_pointer[-2 - oparg] = (PyObject *)new_frame; + stack_pointer += -1 - oparg; + } + break; + } + + case _CHECK_CALL_PY_EXACT_ARGS_4: { + // _CHECK_FUNCTION_EXACT_ARGS_4 + { + PyObject *self_or_null; + PyObject *callable; + oparg = 4; + assert(oparg == CURRENT_OPARG()); + self_or_null = stack_pointer[-1 - oparg]; + callable = stack_pointer[-2 - oparg]; + uint32_t func_version = (uint32_t)CURRENT_OPERAND(); + if (!PyFunction_Check(callable)) goto deoptimize; + PyFunctionObject *func = (PyFunctionObject *)callable; + if (func->func_version != func_version) goto deoptimize; + PyCodeObject *code = (PyCodeObject *)func->func_code; + if (code->co_argcount != oparg + (self_or_null != NULL)) goto deoptimize; + } + // _CHECK_STACK_SPACE_4 + { + PyObject *callable; + oparg = 4; + assert(oparg == CURRENT_OPARG()); + callable = stack_pointer[-2 - oparg]; + PyFunctionObject *func = (PyFunctionObject *)callable; + PyCodeObject *code = (PyCodeObject *)func->func_code; + if (!_PyThreadState_HasStackSpace(tstate, code->co_framesize)) goto deoptimize; + if (tstate->py_recursion_remaining <= 1) goto deoptimize; + } + // _INIT_CALL_PY_EXACT_ARGS_4 + { + PyObject **args; + PyObject *self_or_null; + PyObject *callable; + _PyInterpreterFrame *new_frame; + oparg = 4; + assert(oparg == CURRENT_OPARG()); + args = &stack_pointer[-oparg]; + self_or_null = stack_pointer[-1 - oparg]; + callable = stack_pointer[-2 - oparg]; + int argcount = oparg; + if (self_or_null != NULL) { + args--; + argcount++; + } + STAT_INC(CALL, hit); + PyFunctionObject *func = (PyFunctionObject *)callable; + new_frame = _PyFrame_PushUnchecked(tstate, func, argcount); + for (int i = 0; i < argcount; i++) { + new_frame->localsplus[i] = args[i]; + } + stack_pointer[-2 - oparg] = (PyObject *)new_frame; + stack_pointer += -1 - oparg; + } + break; + } + + case _SAVE_RETURN_OFFSET__PUSH_FRAME: { + // _SAVE_RETURN_OFFSET + { + oparg = CURRENT_OPARG(); + #if TIER_ONE + frame->return_offset = (uint16_t)(next_instr - this_instr); + #endif + #if TIER_TWO + frame->return_offset = oparg; + #endif + } + // _PUSH_FRAME + { + _PyInterpreterFrame *new_frame; + new_frame = (_PyInterpreterFrame *)stack_pointer[-1]; + // Write it out explicitly because it's subtly different. + // Eventually this should be the only occurrence of this code. + assert(tstate->interp->eval_frame == NULL); + stack_pointer += -1; + _PyFrame_SetStackPointer(frame, stack_pointer); + new_frame->previous = frame; + CALL_STAT_INC(inlined_py_calls); + frame = tstate->current_frame = new_frame; + tstate->py_recursion_remaining--; + LOAD_SP(); + LOAD_IP(0); + #if LLTRACE && TIER_ONE + lltrace = maybe_lltrace_resume_frame(frame, &entry_frame, GLOBALS()); + if (lltrace < 0) { + goto exit_unwind; + } + #endif + } + break; + } + #undef TIER_TWO diff --git a/Python/optimizer.c b/Python/optimizer.c index acd6d52c4a885f..599b6b66e6e1dc 100644 --- a/Python/optimizer.c +++ b/Python/optimizer.c @@ -1018,21 +1018,6 @@ uop_optimize( } } assert(err == 1); - /* Fix up */ - for (int pc = 0; pc < UOP_MAX_TRACE_LENGTH; pc++) { - int opcode = buffer[pc].opcode; - int oparg = buffer[pc].oparg; - if (_PyUop_Flags[opcode] & HAS_OPARG_AND_1_FLAG) { - buffer[pc].opcode = opcode + 1 + (oparg & 1); - } - else if (oparg < _PyUop_Replication[opcode]) { - buffer[pc].opcode = opcode + oparg + 1; - } - else if (opcode == _JUMP_TO_TOP || opcode == _EXIT_TRACE) { - break; - } - assert(_PyOpcode_uop_name[buffer[pc].opcode]); - } _PyExecutorObject *executor = make_executor_from_uops(buffer, &dependencies); if (executor == NULL) { return -1; diff --git a/Python/optimizer_analysis.c b/Python/optimizer_analysis.c index a326e2249bb4de..5767b804f8c551 100644 --- a/Python/optimizer_analysis.c +++ b/Python/optimizer_analysis.c @@ -496,6 +496,40 @@ peephole_opt(_PyInterpreterFrame *frame, _PyUOpInstruction *buffer, int buffer_s } } +static void +replicate_and_split(_PyUOpInstruction *buffer, int buffer_size) +{ + /* Fix up */ + for (int pc = 0; pc < buffer_size; pc++) { + int opcode = buffer[pc].opcode; + int oparg = buffer[pc].oparg; + if (_PyUop_Flags[opcode] & HAS_OPARG_AND_1_FLAG) { + buffer[pc].opcode = opcode + 1 + (oparg & 1); + } + else if (oparg < _PyUop_Replication[opcode]) { + buffer[pc].opcode = opcode + oparg + 1; + } + else if (opcode == _JUMP_TO_TOP || opcode == _EXIT_TRACE) { + break; + } + assert(_PyOpcode_uop_name[buffer[pc].opcode]); + } +} + +static void +match_supers(_PyUOpInstruction *buffer, int buffer_size) +{ + _PyUOpInstruction *end = buffer + buffer_size; + _PyUOpInstruction *this_instr = buffer; + while (this_instr < end) { + switch(this_instr->opcode) { +#include "uop_super_matcher_cases.c.h" + default: + this_instr++; + } + } +} + // 0 - failure, no error raised, just fall back to Tier 1 // -1 - failure, and raise error // 1 - optimizer success @@ -530,6 +564,8 @@ _Py_uop_analyze_and_optimize( assert(err == 1); remove_unneeded_uops(buffer, buffer_size); + replicate_and_split(buffer, buffer_size); + match_supers(buffer, buffer_size); OPT_STAT_INC(optimizer_successes); return 1; diff --git a/Python/uop_super_matcher_cases.c.h b/Python/uop_super_matcher_cases.c.h new file mode 100644 index 00000000000000..5a48f0adca9524 --- /dev/null +++ b/Python/uop_super_matcher_cases.c.h @@ -0,0 +1,1182 @@ +// This file is generated by Tools/cases_generator/tier2_super_matcher_generator.py +// from: +// Python/bytecodes.c +// Do not edit! + +#ifdef TIER_ONE + #error "This file is for Tier 2 only" +#endif +#define TIER_TWO 2 + + case _LOAD_FAST_0: { + if ((this_instr[1].opcode == _LOAD_FAST_0)) { + DPRINTF(2, "Inserting super __LOAD_FAST_0__LOAD_FAST_0\n"); + REPLACE_OP(this_instr, __LOAD_FAST_0__LOAD_FAST_0, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_1)) { + DPRINTF(2, "Inserting super __LOAD_FAST_0__LOAD_FAST_1\n"); + REPLACE_OP(this_instr, __LOAD_FAST_0__LOAD_FAST_1, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_2)) { + DPRINTF(2, "Inserting super __LOAD_FAST_0__LOAD_FAST_2\n"); + REPLACE_OP(this_instr, __LOAD_FAST_0__LOAD_FAST_2, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_3)) { + DPRINTF(2, "Inserting super __LOAD_FAST_0__LOAD_FAST_3\n"); + REPLACE_OP(this_instr, __LOAD_FAST_0__LOAD_FAST_3, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_4)) { + DPRINTF(2, "Inserting super __LOAD_FAST_0__LOAD_FAST_4\n"); + REPLACE_OP(this_instr, __LOAD_FAST_0__LOAD_FAST_4, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_5)) { + DPRINTF(2, "Inserting super __LOAD_FAST_0__LOAD_FAST_5\n"); + REPLACE_OP(this_instr, __LOAD_FAST_0__LOAD_FAST_5, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_6)) { + DPRINTF(2, "Inserting super __LOAD_FAST_0__LOAD_FAST_6\n"); + REPLACE_OP(this_instr, __LOAD_FAST_0__LOAD_FAST_6, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_7)) { + DPRINTF(2, "Inserting super __LOAD_FAST_0__LOAD_FAST_7\n"); + REPLACE_OP(this_instr, __LOAD_FAST_0__LOAD_FAST_7, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + this_instr += 1; + break; + } + + case _LOAD_FAST_1: { + if ((this_instr[1].opcode == _LOAD_FAST_0)) { + DPRINTF(2, "Inserting super __LOAD_FAST_1__LOAD_FAST_0\n"); + REPLACE_OP(this_instr, __LOAD_FAST_1__LOAD_FAST_0, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_1)) { + DPRINTF(2, "Inserting super __LOAD_FAST_1__LOAD_FAST_1\n"); + REPLACE_OP(this_instr, __LOAD_FAST_1__LOAD_FAST_1, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_2)) { + DPRINTF(2, "Inserting super __LOAD_FAST_1__LOAD_FAST_2\n"); + REPLACE_OP(this_instr, __LOAD_FAST_1__LOAD_FAST_2, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_3)) { + DPRINTF(2, "Inserting super __LOAD_FAST_1__LOAD_FAST_3\n"); + REPLACE_OP(this_instr, __LOAD_FAST_1__LOAD_FAST_3, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_4)) { + DPRINTF(2, "Inserting super __LOAD_FAST_1__LOAD_FAST_4\n"); + REPLACE_OP(this_instr, __LOAD_FAST_1__LOAD_FAST_4, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_5)) { + DPRINTF(2, "Inserting super __LOAD_FAST_1__LOAD_FAST_5\n"); + REPLACE_OP(this_instr, __LOAD_FAST_1__LOAD_FAST_5, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_6)) { + DPRINTF(2, "Inserting super __LOAD_FAST_1__LOAD_FAST_6\n"); + REPLACE_OP(this_instr, __LOAD_FAST_1__LOAD_FAST_6, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_7)) { + DPRINTF(2, "Inserting super __LOAD_FAST_1__LOAD_FAST_7\n"); + REPLACE_OP(this_instr, __LOAD_FAST_1__LOAD_FAST_7, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + this_instr += 1; + break; + } + + case _LOAD_FAST_2: { + if ((this_instr[1].opcode == _LOAD_FAST_0)) { + DPRINTF(2, "Inserting super __LOAD_FAST_2__LOAD_FAST_0\n"); + REPLACE_OP(this_instr, __LOAD_FAST_2__LOAD_FAST_0, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_1)) { + DPRINTF(2, "Inserting super __LOAD_FAST_2__LOAD_FAST_1\n"); + REPLACE_OP(this_instr, __LOAD_FAST_2__LOAD_FAST_1, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_2)) { + DPRINTF(2, "Inserting super __LOAD_FAST_2__LOAD_FAST_2\n"); + REPLACE_OP(this_instr, __LOAD_FAST_2__LOAD_FAST_2, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_3)) { + DPRINTF(2, "Inserting super __LOAD_FAST_2__LOAD_FAST_3\n"); + REPLACE_OP(this_instr, __LOAD_FAST_2__LOAD_FAST_3, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_4)) { + DPRINTF(2, "Inserting super __LOAD_FAST_2__LOAD_FAST_4\n"); + REPLACE_OP(this_instr, __LOAD_FAST_2__LOAD_FAST_4, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_5)) { + DPRINTF(2, "Inserting super __LOAD_FAST_2__LOAD_FAST_5\n"); + REPLACE_OP(this_instr, __LOAD_FAST_2__LOAD_FAST_5, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_6)) { + DPRINTF(2, "Inserting super __LOAD_FAST_2__LOAD_FAST_6\n"); + REPLACE_OP(this_instr, __LOAD_FAST_2__LOAD_FAST_6, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_7)) { + DPRINTF(2, "Inserting super __LOAD_FAST_2__LOAD_FAST_7\n"); + REPLACE_OP(this_instr, __LOAD_FAST_2__LOAD_FAST_7, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + this_instr += 1; + break; + } + + case _LOAD_FAST_3: { + if ((this_instr[1].opcode == _LOAD_FAST_0)) { + DPRINTF(2, "Inserting super __LOAD_FAST_3__LOAD_FAST_0\n"); + REPLACE_OP(this_instr, __LOAD_FAST_3__LOAD_FAST_0, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_1)) { + DPRINTF(2, "Inserting super __LOAD_FAST_3__LOAD_FAST_1\n"); + REPLACE_OP(this_instr, __LOAD_FAST_3__LOAD_FAST_1, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_2)) { + DPRINTF(2, "Inserting super __LOAD_FAST_3__LOAD_FAST_2\n"); + REPLACE_OP(this_instr, __LOAD_FAST_3__LOAD_FAST_2, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_3)) { + DPRINTF(2, "Inserting super __LOAD_FAST_3__LOAD_FAST_3\n"); + REPLACE_OP(this_instr, __LOAD_FAST_3__LOAD_FAST_3, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_4)) { + DPRINTF(2, "Inserting super __LOAD_FAST_3__LOAD_FAST_4\n"); + REPLACE_OP(this_instr, __LOAD_FAST_3__LOAD_FAST_4, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_5)) { + DPRINTF(2, "Inserting super __LOAD_FAST_3__LOAD_FAST_5\n"); + REPLACE_OP(this_instr, __LOAD_FAST_3__LOAD_FAST_5, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_6)) { + DPRINTF(2, "Inserting super __LOAD_FAST_3__LOAD_FAST_6\n"); + REPLACE_OP(this_instr, __LOAD_FAST_3__LOAD_FAST_6, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_7)) { + DPRINTF(2, "Inserting super __LOAD_FAST_3__LOAD_FAST_7\n"); + REPLACE_OP(this_instr, __LOAD_FAST_3__LOAD_FAST_7, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + this_instr += 1; + break; + } + + case _LOAD_FAST_4: { + if ((this_instr[1].opcode == _LOAD_FAST_0)) { + DPRINTF(2, "Inserting super __LOAD_FAST_4__LOAD_FAST_0\n"); + REPLACE_OP(this_instr, __LOAD_FAST_4__LOAD_FAST_0, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_1)) { + DPRINTF(2, "Inserting super __LOAD_FAST_4__LOAD_FAST_1\n"); + REPLACE_OP(this_instr, __LOAD_FAST_4__LOAD_FAST_1, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_2)) { + DPRINTF(2, "Inserting super __LOAD_FAST_4__LOAD_FAST_2\n"); + REPLACE_OP(this_instr, __LOAD_FAST_4__LOAD_FAST_2, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_3)) { + DPRINTF(2, "Inserting super __LOAD_FAST_4__LOAD_FAST_3\n"); + REPLACE_OP(this_instr, __LOAD_FAST_4__LOAD_FAST_3, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_4)) { + DPRINTF(2, "Inserting super __LOAD_FAST_4__LOAD_FAST_4\n"); + REPLACE_OP(this_instr, __LOAD_FAST_4__LOAD_FAST_4, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_5)) { + DPRINTF(2, "Inserting super __LOAD_FAST_4__LOAD_FAST_5\n"); + REPLACE_OP(this_instr, __LOAD_FAST_4__LOAD_FAST_5, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_6)) { + DPRINTF(2, "Inserting super __LOAD_FAST_4__LOAD_FAST_6\n"); + REPLACE_OP(this_instr, __LOAD_FAST_4__LOAD_FAST_6, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_7)) { + DPRINTF(2, "Inserting super __LOAD_FAST_4__LOAD_FAST_7\n"); + REPLACE_OP(this_instr, __LOAD_FAST_4__LOAD_FAST_7, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + this_instr += 1; + break; + } + + case _LOAD_FAST_5: { + if ((this_instr[1].opcode == _LOAD_FAST_0)) { + DPRINTF(2, "Inserting super __LOAD_FAST_5__LOAD_FAST_0\n"); + REPLACE_OP(this_instr, __LOAD_FAST_5__LOAD_FAST_0, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_1)) { + DPRINTF(2, "Inserting super __LOAD_FAST_5__LOAD_FAST_1\n"); + REPLACE_OP(this_instr, __LOAD_FAST_5__LOAD_FAST_1, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_2)) { + DPRINTF(2, "Inserting super __LOAD_FAST_5__LOAD_FAST_2\n"); + REPLACE_OP(this_instr, __LOAD_FAST_5__LOAD_FAST_2, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_3)) { + DPRINTF(2, "Inserting super __LOAD_FAST_5__LOAD_FAST_3\n"); + REPLACE_OP(this_instr, __LOAD_FAST_5__LOAD_FAST_3, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_4)) { + DPRINTF(2, "Inserting super __LOAD_FAST_5__LOAD_FAST_4\n"); + REPLACE_OP(this_instr, __LOAD_FAST_5__LOAD_FAST_4, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_5)) { + DPRINTF(2, "Inserting super __LOAD_FAST_5__LOAD_FAST_5\n"); + REPLACE_OP(this_instr, __LOAD_FAST_5__LOAD_FAST_5, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_6)) { + DPRINTF(2, "Inserting super __LOAD_FAST_5__LOAD_FAST_6\n"); + REPLACE_OP(this_instr, __LOAD_FAST_5__LOAD_FAST_6, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_7)) { + DPRINTF(2, "Inserting super __LOAD_FAST_5__LOAD_FAST_7\n"); + REPLACE_OP(this_instr, __LOAD_FAST_5__LOAD_FAST_7, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + this_instr += 1; + break; + } + + case _LOAD_FAST_6: { + if ((this_instr[1].opcode == _LOAD_FAST_0)) { + DPRINTF(2, "Inserting super __LOAD_FAST_6__LOAD_FAST_0\n"); + REPLACE_OP(this_instr, __LOAD_FAST_6__LOAD_FAST_0, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_1)) { + DPRINTF(2, "Inserting super __LOAD_FAST_6__LOAD_FAST_1\n"); + REPLACE_OP(this_instr, __LOAD_FAST_6__LOAD_FAST_1, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_2)) { + DPRINTF(2, "Inserting super __LOAD_FAST_6__LOAD_FAST_2\n"); + REPLACE_OP(this_instr, __LOAD_FAST_6__LOAD_FAST_2, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_3)) { + DPRINTF(2, "Inserting super __LOAD_FAST_6__LOAD_FAST_3\n"); + REPLACE_OP(this_instr, __LOAD_FAST_6__LOAD_FAST_3, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_4)) { + DPRINTF(2, "Inserting super __LOAD_FAST_6__LOAD_FAST_4\n"); + REPLACE_OP(this_instr, __LOAD_FAST_6__LOAD_FAST_4, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_5)) { + DPRINTF(2, "Inserting super __LOAD_FAST_6__LOAD_FAST_5\n"); + REPLACE_OP(this_instr, __LOAD_FAST_6__LOAD_FAST_5, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_6)) { + DPRINTF(2, "Inserting super __LOAD_FAST_6__LOAD_FAST_6\n"); + REPLACE_OP(this_instr, __LOAD_FAST_6__LOAD_FAST_6, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_7)) { + DPRINTF(2, "Inserting super __LOAD_FAST_6__LOAD_FAST_7\n"); + REPLACE_OP(this_instr, __LOAD_FAST_6__LOAD_FAST_7, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + this_instr += 1; + break; + } + + case _LOAD_FAST_7: { + if ((this_instr[1].opcode == _LOAD_FAST_0)) { + DPRINTF(2, "Inserting super __LOAD_FAST_7__LOAD_FAST_0\n"); + REPLACE_OP(this_instr, __LOAD_FAST_7__LOAD_FAST_0, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_1)) { + DPRINTF(2, "Inserting super __LOAD_FAST_7__LOAD_FAST_1\n"); + REPLACE_OP(this_instr, __LOAD_FAST_7__LOAD_FAST_1, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_2)) { + DPRINTF(2, "Inserting super __LOAD_FAST_7__LOAD_FAST_2\n"); + REPLACE_OP(this_instr, __LOAD_FAST_7__LOAD_FAST_2, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_3)) { + DPRINTF(2, "Inserting super __LOAD_FAST_7__LOAD_FAST_3\n"); + REPLACE_OP(this_instr, __LOAD_FAST_7__LOAD_FAST_3, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_4)) { + DPRINTF(2, "Inserting super __LOAD_FAST_7__LOAD_FAST_4\n"); + REPLACE_OP(this_instr, __LOAD_FAST_7__LOAD_FAST_4, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_5)) { + DPRINTF(2, "Inserting super __LOAD_FAST_7__LOAD_FAST_5\n"); + REPLACE_OP(this_instr, __LOAD_FAST_7__LOAD_FAST_5, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_6)) { + DPRINTF(2, "Inserting super __LOAD_FAST_7__LOAD_FAST_6\n"); + REPLACE_OP(this_instr, __LOAD_FAST_7__LOAD_FAST_6, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_7)) { + DPRINTF(2, "Inserting super __LOAD_FAST_7__LOAD_FAST_7\n"); + REPLACE_OP(this_instr, __LOAD_FAST_7__LOAD_FAST_7, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + this_instr += 1; + break; + } + + case _STORE_FAST_0: { + if ((this_instr[1].opcode == _LOAD_FAST_0)) { + DPRINTF(2, "Inserting super __STORE_FAST_0__LOAD_FAST_0\n"); + REPLACE_OP(this_instr, __STORE_FAST_0__LOAD_FAST_0, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_1)) { + DPRINTF(2, "Inserting super __STORE_FAST_0__LOAD_FAST_1\n"); + REPLACE_OP(this_instr, __STORE_FAST_0__LOAD_FAST_1, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_2)) { + DPRINTF(2, "Inserting super __STORE_FAST_0__LOAD_FAST_2\n"); + REPLACE_OP(this_instr, __STORE_FAST_0__LOAD_FAST_2, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_3)) { + DPRINTF(2, "Inserting super __STORE_FAST_0__LOAD_FAST_3\n"); + REPLACE_OP(this_instr, __STORE_FAST_0__LOAD_FAST_3, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_4)) { + DPRINTF(2, "Inserting super __STORE_FAST_0__LOAD_FAST_4\n"); + REPLACE_OP(this_instr, __STORE_FAST_0__LOAD_FAST_4, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_5)) { + DPRINTF(2, "Inserting super __STORE_FAST_0__LOAD_FAST_5\n"); + REPLACE_OP(this_instr, __STORE_FAST_0__LOAD_FAST_5, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_6)) { + DPRINTF(2, "Inserting super __STORE_FAST_0__LOAD_FAST_6\n"); + REPLACE_OP(this_instr, __STORE_FAST_0__LOAD_FAST_6, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_7)) { + DPRINTF(2, "Inserting super __STORE_FAST_0__LOAD_FAST_7\n"); + REPLACE_OP(this_instr, __STORE_FAST_0__LOAD_FAST_7, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + this_instr += 1; + break; + } + + case _STORE_FAST_1: { + if ((this_instr[1].opcode == _LOAD_FAST_0)) { + DPRINTF(2, "Inserting super __STORE_FAST_1__LOAD_FAST_0\n"); + REPLACE_OP(this_instr, __STORE_FAST_1__LOAD_FAST_0, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_1)) { + DPRINTF(2, "Inserting super __STORE_FAST_1__LOAD_FAST_1\n"); + REPLACE_OP(this_instr, __STORE_FAST_1__LOAD_FAST_1, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_2)) { + DPRINTF(2, "Inserting super __STORE_FAST_1__LOAD_FAST_2\n"); + REPLACE_OP(this_instr, __STORE_FAST_1__LOAD_FAST_2, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_3)) { + DPRINTF(2, "Inserting super __STORE_FAST_1__LOAD_FAST_3\n"); + REPLACE_OP(this_instr, __STORE_FAST_1__LOAD_FAST_3, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_4)) { + DPRINTF(2, "Inserting super __STORE_FAST_1__LOAD_FAST_4\n"); + REPLACE_OP(this_instr, __STORE_FAST_1__LOAD_FAST_4, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_5)) { + DPRINTF(2, "Inserting super __STORE_FAST_1__LOAD_FAST_5\n"); + REPLACE_OP(this_instr, __STORE_FAST_1__LOAD_FAST_5, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_6)) { + DPRINTF(2, "Inserting super __STORE_FAST_1__LOAD_FAST_6\n"); + REPLACE_OP(this_instr, __STORE_FAST_1__LOAD_FAST_6, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_7)) { + DPRINTF(2, "Inserting super __STORE_FAST_1__LOAD_FAST_7\n"); + REPLACE_OP(this_instr, __STORE_FAST_1__LOAD_FAST_7, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + this_instr += 1; + break; + } + + case _STORE_FAST_2: { + if ((this_instr[1].opcode == _LOAD_FAST_0)) { + DPRINTF(2, "Inserting super __STORE_FAST_2__LOAD_FAST_0\n"); + REPLACE_OP(this_instr, __STORE_FAST_2__LOAD_FAST_0, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_1)) { + DPRINTF(2, "Inserting super __STORE_FAST_2__LOAD_FAST_1\n"); + REPLACE_OP(this_instr, __STORE_FAST_2__LOAD_FAST_1, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_2)) { + DPRINTF(2, "Inserting super __STORE_FAST_2__LOAD_FAST_2\n"); + REPLACE_OP(this_instr, __STORE_FAST_2__LOAD_FAST_2, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_3)) { + DPRINTF(2, "Inserting super __STORE_FAST_2__LOAD_FAST_3\n"); + REPLACE_OP(this_instr, __STORE_FAST_2__LOAD_FAST_3, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_4)) { + DPRINTF(2, "Inserting super __STORE_FAST_2__LOAD_FAST_4\n"); + REPLACE_OP(this_instr, __STORE_FAST_2__LOAD_FAST_4, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_5)) { + DPRINTF(2, "Inserting super __STORE_FAST_2__LOAD_FAST_5\n"); + REPLACE_OP(this_instr, __STORE_FAST_2__LOAD_FAST_5, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_6)) { + DPRINTF(2, "Inserting super __STORE_FAST_2__LOAD_FAST_6\n"); + REPLACE_OP(this_instr, __STORE_FAST_2__LOAD_FAST_6, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_7)) { + DPRINTF(2, "Inserting super __STORE_FAST_2__LOAD_FAST_7\n"); + REPLACE_OP(this_instr, __STORE_FAST_2__LOAD_FAST_7, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + this_instr += 1; + break; + } + + case _STORE_FAST_3: { + if ((this_instr[1].opcode == _LOAD_FAST_0)) { + DPRINTF(2, "Inserting super __STORE_FAST_3__LOAD_FAST_0\n"); + REPLACE_OP(this_instr, __STORE_FAST_3__LOAD_FAST_0, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_1)) { + DPRINTF(2, "Inserting super __STORE_FAST_3__LOAD_FAST_1\n"); + REPLACE_OP(this_instr, __STORE_FAST_3__LOAD_FAST_1, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_2)) { + DPRINTF(2, "Inserting super __STORE_FAST_3__LOAD_FAST_2\n"); + REPLACE_OP(this_instr, __STORE_FAST_3__LOAD_FAST_2, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_3)) { + DPRINTF(2, "Inserting super __STORE_FAST_3__LOAD_FAST_3\n"); + REPLACE_OP(this_instr, __STORE_FAST_3__LOAD_FAST_3, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_4)) { + DPRINTF(2, "Inserting super __STORE_FAST_3__LOAD_FAST_4\n"); + REPLACE_OP(this_instr, __STORE_FAST_3__LOAD_FAST_4, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_5)) { + DPRINTF(2, "Inserting super __STORE_FAST_3__LOAD_FAST_5\n"); + REPLACE_OP(this_instr, __STORE_FAST_3__LOAD_FAST_5, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_6)) { + DPRINTF(2, "Inserting super __STORE_FAST_3__LOAD_FAST_6\n"); + REPLACE_OP(this_instr, __STORE_FAST_3__LOAD_FAST_6, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_7)) { + DPRINTF(2, "Inserting super __STORE_FAST_3__LOAD_FAST_7\n"); + REPLACE_OP(this_instr, __STORE_FAST_3__LOAD_FAST_7, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + this_instr += 1; + break; + } + + case _STORE_FAST_4: { + if ((this_instr[1].opcode == _LOAD_FAST_0)) { + DPRINTF(2, "Inserting super __STORE_FAST_4__LOAD_FAST_0\n"); + REPLACE_OP(this_instr, __STORE_FAST_4__LOAD_FAST_0, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_1)) { + DPRINTF(2, "Inserting super __STORE_FAST_4__LOAD_FAST_1\n"); + REPLACE_OP(this_instr, __STORE_FAST_4__LOAD_FAST_1, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_2)) { + DPRINTF(2, "Inserting super __STORE_FAST_4__LOAD_FAST_2\n"); + REPLACE_OP(this_instr, __STORE_FAST_4__LOAD_FAST_2, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_3)) { + DPRINTF(2, "Inserting super __STORE_FAST_4__LOAD_FAST_3\n"); + REPLACE_OP(this_instr, __STORE_FAST_4__LOAD_FAST_3, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_4)) { + DPRINTF(2, "Inserting super __STORE_FAST_4__LOAD_FAST_4\n"); + REPLACE_OP(this_instr, __STORE_FAST_4__LOAD_FAST_4, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_5)) { + DPRINTF(2, "Inserting super __STORE_FAST_4__LOAD_FAST_5\n"); + REPLACE_OP(this_instr, __STORE_FAST_4__LOAD_FAST_5, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_6)) { + DPRINTF(2, "Inserting super __STORE_FAST_4__LOAD_FAST_6\n"); + REPLACE_OP(this_instr, __STORE_FAST_4__LOAD_FAST_6, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_7)) { + DPRINTF(2, "Inserting super __STORE_FAST_4__LOAD_FAST_7\n"); + REPLACE_OP(this_instr, __STORE_FAST_4__LOAD_FAST_7, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + this_instr += 1; + break; + } + + case _STORE_FAST_5: { + if ((this_instr[1].opcode == _LOAD_FAST_0)) { + DPRINTF(2, "Inserting super __STORE_FAST_5__LOAD_FAST_0\n"); + REPLACE_OP(this_instr, __STORE_FAST_5__LOAD_FAST_0, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_1)) { + DPRINTF(2, "Inserting super __STORE_FAST_5__LOAD_FAST_1\n"); + REPLACE_OP(this_instr, __STORE_FAST_5__LOAD_FAST_1, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_2)) { + DPRINTF(2, "Inserting super __STORE_FAST_5__LOAD_FAST_2\n"); + REPLACE_OP(this_instr, __STORE_FAST_5__LOAD_FAST_2, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_3)) { + DPRINTF(2, "Inserting super __STORE_FAST_5__LOAD_FAST_3\n"); + REPLACE_OP(this_instr, __STORE_FAST_5__LOAD_FAST_3, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_4)) { + DPRINTF(2, "Inserting super __STORE_FAST_5__LOAD_FAST_4\n"); + REPLACE_OP(this_instr, __STORE_FAST_5__LOAD_FAST_4, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_5)) { + DPRINTF(2, "Inserting super __STORE_FAST_5__LOAD_FAST_5\n"); + REPLACE_OP(this_instr, __STORE_FAST_5__LOAD_FAST_5, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_6)) { + DPRINTF(2, "Inserting super __STORE_FAST_5__LOAD_FAST_6\n"); + REPLACE_OP(this_instr, __STORE_FAST_5__LOAD_FAST_6, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_7)) { + DPRINTF(2, "Inserting super __STORE_FAST_5__LOAD_FAST_7\n"); + REPLACE_OP(this_instr, __STORE_FAST_5__LOAD_FAST_7, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + this_instr += 1; + break; + } + + case _STORE_FAST_6: { + if ((this_instr[1].opcode == _LOAD_FAST_0)) { + DPRINTF(2, "Inserting super __STORE_FAST_6__LOAD_FAST_0\n"); + REPLACE_OP(this_instr, __STORE_FAST_6__LOAD_FAST_0, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_1)) { + DPRINTF(2, "Inserting super __STORE_FAST_6__LOAD_FAST_1\n"); + REPLACE_OP(this_instr, __STORE_FAST_6__LOAD_FAST_1, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_2)) { + DPRINTF(2, "Inserting super __STORE_FAST_6__LOAD_FAST_2\n"); + REPLACE_OP(this_instr, __STORE_FAST_6__LOAD_FAST_2, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_3)) { + DPRINTF(2, "Inserting super __STORE_FAST_6__LOAD_FAST_3\n"); + REPLACE_OP(this_instr, __STORE_FAST_6__LOAD_FAST_3, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_4)) { + DPRINTF(2, "Inserting super __STORE_FAST_6__LOAD_FAST_4\n"); + REPLACE_OP(this_instr, __STORE_FAST_6__LOAD_FAST_4, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_5)) { + DPRINTF(2, "Inserting super __STORE_FAST_6__LOAD_FAST_5\n"); + REPLACE_OP(this_instr, __STORE_FAST_6__LOAD_FAST_5, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_6)) { + DPRINTF(2, "Inserting super __STORE_FAST_6__LOAD_FAST_6\n"); + REPLACE_OP(this_instr, __STORE_FAST_6__LOAD_FAST_6, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_7)) { + DPRINTF(2, "Inserting super __STORE_FAST_6__LOAD_FAST_7\n"); + REPLACE_OP(this_instr, __STORE_FAST_6__LOAD_FAST_7, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + this_instr += 1; + break; + } + + case _STORE_FAST_7: { + if ((this_instr[1].opcode == _LOAD_FAST_0)) { + DPRINTF(2, "Inserting super __STORE_FAST_7__LOAD_FAST_0\n"); + REPLACE_OP(this_instr, __STORE_FAST_7__LOAD_FAST_0, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_1)) { + DPRINTF(2, "Inserting super __STORE_FAST_7__LOAD_FAST_1\n"); + REPLACE_OP(this_instr, __STORE_FAST_7__LOAD_FAST_1, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_2)) { + DPRINTF(2, "Inserting super __STORE_FAST_7__LOAD_FAST_2\n"); + REPLACE_OP(this_instr, __STORE_FAST_7__LOAD_FAST_2, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_3)) { + DPRINTF(2, "Inserting super __STORE_FAST_7__LOAD_FAST_3\n"); + REPLACE_OP(this_instr, __STORE_FAST_7__LOAD_FAST_3, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_4)) { + DPRINTF(2, "Inserting super __STORE_FAST_7__LOAD_FAST_4\n"); + REPLACE_OP(this_instr, __STORE_FAST_7__LOAD_FAST_4, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_5)) { + DPRINTF(2, "Inserting super __STORE_FAST_7__LOAD_FAST_5\n"); + REPLACE_OP(this_instr, __STORE_FAST_7__LOAD_FAST_5, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_6)) { + DPRINTF(2, "Inserting super __STORE_FAST_7__LOAD_FAST_6\n"); + REPLACE_OP(this_instr, __STORE_FAST_7__LOAD_FAST_6, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _LOAD_FAST_7)) { + DPRINTF(2, "Inserting super __STORE_FAST_7__LOAD_FAST_7\n"); + REPLACE_OP(this_instr, __STORE_FAST_7__LOAD_FAST_7, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + this_instr += 1; + break; + } + + case _GUARD_BOTH_INT: { + if ((this_instr[1].opcode == _BINARY_OP_MULTIPLY_INT)) { + DPRINTF(2, "Inserting super _GUARD_BOTH_INT__BINARY_OP_MULTIPLY_INT\n"); + REPLACE_OP(this_instr, _GUARD_BOTH_INT__BINARY_OP_MULTIPLY_INT, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _BINARY_OP_ADD_INT)) { + DPRINTF(2, "Inserting super _GUARD_BOTH_INT__BINARY_OP_ADD_INT\n"); + REPLACE_OP(this_instr, _GUARD_BOTH_INT__BINARY_OP_ADD_INT, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _BINARY_OP_SUBTRACT_INT)) { + DPRINTF(2, "Inserting super _GUARD_BOTH_INT__BINARY_OP_SUBTRACT_INT\n"); + REPLACE_OP(this_instr, _GUARD_BOTH_INT__BINARY_OP_SUBTRACT_INT, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + this_instr += 1; + break; + } + + case _GUARD_BOTH_FLOAT: { + if ((this_instr[1].opcode == _BINARY_OP_MULTIPLY_FLOAT)) { + DPRINTF(2, "Inserting super _GUARD_BOTH_FLOAT__BINARY_OP_MULTIPLY_FLOAT\n"); + REPLACE_OP(this_instr, _GUARD_BOTH_FLOAT__BINARY_OP_MULTIPLY_FLOAT, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _BINARY_OP_ADD_FLOAT)) { + DPRINTF(2, "Inserting super _GUARD_BOTH_FLOAT__BINARY_OP_ADD_FLOAT\n"); + REPLACE_OP(this_instr, _GUARD_BOTH_FLOAT__BINARY_OP_ADD_FLOAT, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + if ((this_instr[1].opcode == _BINARY_OP_SUBTRACT_FLOAT)) { + DPRINTF(2, "Inserting super _GUARD_BOTH_FLOAT__BINARY_OP_SUBTRACT_FLOAT\n"); + REPLACE_OP(this_instr, _GUARD_BOTH_FLOAT__BINARY_OP_SUBTRACT_FLOAT, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + this_instr += 1; + break; + } + + case _GUARD_BOTH_UNICODE: { + if ((this_instr[1].opcode == _BINARY_OP_ADD_UNICODE)) { + DPRINTF(2, "Inserting super _GUARD_BOTH_UNICODE__BINARY_OP_ADD_UNICODE\n"); + REPLACE_OP(this_instr, _GUARD_BOTH_UNICODE__BINARY_OP_ADD_UNICODE, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + this_instr += 1; + break; + } + + case _CHECK_CALL_BOUND_METHOD_EXACT_ARGS: { + if ((this_instr[1].opcode == _INIT_CALL_BOUND_METHOD_EXACT_ARGS) && (this_instr[2].opcode == _CHECK_FUNCTION_EXACT_ARGS) && (this_instr[3].opcode == _CHECK_STACK_SPACE) && (this_instr[4].opcode == _INIT_CALL_PY_EXACT_ARGS)) { + DPRINTF(2, "Inserting super _CALL_BOUND_METHOD_EXACT_ARGS\n"); + REPLACE_OP(this_instr, _CALL_BOUND_METHOD_EXACT_ARGS, this_instr[4].oparg, this_instr[2].operand); + for (int i = 1; i < 5; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 5; + break; + } + if ((this_instr[1].opcode == _INIT_CALL_BOUND_METHOD_EXACT_ARGS) && (this_instr[2].opcode == _CHECK_FUNCTION_EXACT_ARGS_0) && (this_instr[3].opcode == _CHECK_STACK_SPACE_0) && (this_instr[4].opcode == _INIT_CALL_PY_EXACT_ARGS_0)) { + DPRINTF(2, "Inserting super _CALL_BOUND_METHOD_EXACT_ARGS_0\n"); + REPLACE_OP(this_instr, _CALL_BOUND_METHOD_EXACT_ARGS_0, this_instr[1].oparg, this_instr[2].operand); + for (int i = 1; i < 5; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 5; + break; + } + if ((this_instr[1].opcode == _INIT_CALL_BOUND_METHOD_EXACT_ARGS) && (this_instr[2].opcode == _CHECK_FUNCTION_EXACT_ARGS_1) && (this_instr[3].opcode == _CHECK_STACK_SPACE_1) && (this_instr[4].opcode == _INIT_CALL_PY_EXACT_ARGS_1)) { + DPRINTF(2, "Inserting super _CALL_BOUND_METHOD_EXACT_ARGS_1\n"); + REPLACE_OP(this_instr, _CALL_BOUND_METHOD_EXACT_ARGS_1, this_instr[1].oparg, this_instr[2].operand); + for (int i = 1; i < 5; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 5; + break; + } + if ((this_instr[1].opcode == _INIT_CALL_BOUND_METHOD_EXACT_ARGS) && (this_instr[2].opcode == _CHECK_FUNCTION_EXACT_ARGS_2) && (this_instr[3].opcode == _CHECK_STACK_SPACE_2) && (this_instr[4].opcode == _INIT_CALL_PY_EXACT_ARGS_2)) { + DPRINTF(2, "Inserting super _CALL_BOUND_METHOD_EXACT_ARGS_2\n"); + REPLACE_OP(this_instr, _CALL_BOUND_METHOD_EXACT_ARGS_2, this_instr[1].oparg, this_instr[2].operand); + for (int i = 1; i < 5; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 5; + break; + } + if ((this_instr[1].opcode == _INIT_CALL_BOUND_METHOD_EXACT_ARGS) && (this_instr[2].opcode == _CHECK_FUNCTION_EXACT_ARGS_3) && (this_instr[3].opcode == _CHECK_STACK_SPACE_3) && (this_instr[4].opcode == _INIT_CALL_PY_EXACT_ARGS_3)) { + DPRINTF(2, "Inserting super _CALL_BOUND_METHOD_EXACT_ARGS_3\n"); + REPLACE_OP(this_instr, _CALL_BOUND_METHOD_EXACT_ARGS_3, this_instr[1].oparg, this_instr[2].operand); + for (int i = 1; i < 5; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 5; + break; + } + if ((this_instr[1].opcode == _INIT_CALL_BOUND_METHOD_EXACT_ARGS) && (this_instr[2].opcode == _CHECK_FUNCTION_EXACT_ARGS_4) && (this_instr[3].opcode == _CHECK_STACK_SPACE_4) && (this_instr[4].opcode == _INIT_CALL_PY_EXACT_ARGS_4)) { + DPRINTF(2, "Inserting super _CALL_BOUND_METHOD_EXACT_ARGS_4\n"); + REPLACE_OP(this_instr, _CALL_BOUND_METHOD_EXACT_ARGS_4, this_instr[1].oparg, this_instr[2].operand); + for (int i = 1; i < 5; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 5; + break; + } + this_instr += 1; + break; + } + + case _CHECK_FUNCTION_EXACT_ARGS: { + if ((this_instr[1].opcode == _CHECK_STACK_SPACE) && (this_instr[2].opcode == _INIT_CALL_PY_EXACT_ARGS)) { + DPRINTF(2, "Inserting super _CHECK_CALL_PY_EXACT_ARGS\n"); + REPLACE_OP(this_instr, _CHECK_CALL_PY_EXACT_ARGS, this_instr[2].oparg, this_instr[0].operand); + for (int i = 1; i < 3; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 3; + break; + } + this_instr += 1; + break; + } + + case _CHECK_FUNCTION_EXACT_ARGS_0: { + if ((this_instr[1].opcode == _CHECK_STACK_SPACE_0) && (this_instr[2].opcode == _INIT_CALL_PY_EXACT_ARGS_0)) { + DPRINTF(2, "Inserting super _CHECK_CALL_PY_EXACT_ARGS_0\n"); + REPLACE_OP(this_instr, _CHECK_CALL_PY_EXACT_ARGS_0, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 3; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 3; + break; + } + this_instr += 1; + break; + } + + case _CHECK_FUNCTION_EXACT_ARGS_1: { + if ((this_instr[1].opcode == _CHECK_STACK_SPACE_1) && (this_instr[2].opcode == _INIT_CALL_PY_EXACT_ARGS_1)) { + DPRINTF(2, "Inserting super _CHECK_CALL_PY_EXACT_ARGS_1\n"); + REPLACE_OP(this_instr, _CHECK_CALL_PY_EXACT_ARGS_1, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 3; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 3; + break; + } + this_instr += 1; + break; + } + + case _CHECK_FUNCTION_EXACT_ARGS_2: { + if ((this_instr[1].opcode == _CHECK_STACK_SPACE_2) && (this_instr[2].opcode == _INIT_CALL_PY_EXACT_ARGS_2)) { + DPRINTF(2, "Inserting super _CHECK_CALL_PY_EXACT_ARGS_2\n"); + REPLACE_OP(this_instr, _CHECK_CALL_PY_EXACT_ARGS_2, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 3; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 3; + break; + } + this_instr += 1; + break; + } + + case _CHECK_FUNCTION_EXACT_ARGS_3: { + if ((this_instr[1].opcode == _CHECK_STACK_SPACE_3) && (this_instr[2].opcode == _INIT_CALL_PY_EXACT_ARGS_3)) { + DPRINTF(2, "Inserting super _CHECK_CALL_PY_EXACT_ARGS_3\n"); + REPLACE_OP(this_instr, _CHECK_CALL_PY_EXACT_ARGS_3, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 3; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 3; + break; + } + this_instr += 1; + break; + } + + case _CHECK_FUNCTION_EXACT_ARGS_4: { + if ((this_instr[1].opcode == _CHECK_STACK_SPACE_4) && (this_instr[2].opcode == _INIT_CALL_PY_EXACT_ARGS_4)) { + DPRINTF(2, "Inserting super _CHECK_CALL_PY_EXACT_ARGS_4\n"); + REPLACE_OP(this_instr, _CHECK_CALL_PY_EXACT_ARGS_4, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 3; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 3; + break; + } + this_instr += 1; + break; + } + + case _SAVE_RETURN_OFFSET: { + if ((this_instr[1].opcode == _PUSH_FRAME)) { + DPRINTF(2, "Inserting super _SAVE_RETURN_OFFSET__PUSH_FRAME\n"); + REPLACE_OP(this_instr, _SAVE_RETURN_OFFSET__PUSH_FRAME, this_instr[0].oparg, this_instr[0].operand); + for (int i = 1; i < 2; i++) { REPLACE_OP((&this_instr[i]), _NOP, 0, 0); } + this_instr += 2; + break; + } + this_instr += 1; + break; + } + +#undef TIER_TWO diff --git a/Tools/cases_generator/analyzer.py b/Tools/cases_generator/analyzer.py index b0a15e6d87c2c6..b1dc99f368cdb6 100644 --- a/Tools/cases_generator/analyzer.py +++ b/Tools/cases_generator/analyzer.py @@ -2,6 +2,7 @@ import lexer import parser import re +import itertools from typing import Optional @@ -24,6 +25,7 @@ class Properties: side_exit: bool pure: bool passthrough: bool + replicate_only: bool tier: int | None = None oparg_and_1: bool = False const_oparg: int = -1 @@ -53,6 +55,7 @@ def from_list(properties: list["Properties"]) -> "Properties": side_exit=any(p.side_exit for p in properties), pure=all(p.pure for p in properties), passthrough=all(p.passthrough for p in properties), + replicate_only=all(p.replicate_only for p in properties), ) @@ -74,6 +77,7 @@ def from_list(properties: list["Properties"]) -> "Properties": side_exit=False, pure=False, passthrough=False, + replicate_only=False, ) @@ -182,6 +186,13 @@ def is_super(self) -> bool: Part = Uop | Skip +@dataclass +class SuperUop: + name: str + parts: list[Uop] + is_replicates_only: bool = False + + @dataclass class Instruction: name: str @@ -247,6 +258,7 @@ def dump(self, indent: str) -> None: class Analysis: instructions: dict[str, Instruction] uops: dict[str, Uop] + super_uops: dict[str, SuperUop] families: dict[str, Family] pseudos: dict[str, PseudoInstruction] opmap: dict[str, int] @@ -513,6 +525,7 @@ def compute_properties(op: parser.InstDef) -> Properties: pure="pure" in op.annotations, passthrough=passthrough, tier=tier_variable(op), + replicate_only="replicate_only" in op.annotations, ) @@ -587,6 +600,13 @@ def add_instruction( instructions[name] = Instruction(name, parts, None) +def add_superuop( + name: str, parts: list[Uop], instructions: dict[str, SuperUop], + is_replicate_only: bool = False +) -> None: + instructions[name] = SuperUop(name, parts, is_replicate_only) + + def desugar_inst( inst: parser.InstDef, instructions: dict[str, Instruction], uops: dict[str, Uop] ) -> None: @@ -633,6 +653,70 @@ def add_macro( add_instruction(macro.name, parts, instructions) +def add_super( + super: parser.Super, super_uops: dict[str, SuperUop], uops: dict[str, Uop] +) -> None: + parts: list[Uop] = [] + for part in super.uops: + match part: + case parser.OpName(): + if part.name not in uops: + analysis_error(f"No Uop named {part.name}", super.tokens[0]) + parts.append(uops[part.name]) + case _: + assert False + assert parts + # All uop parts in a super-uop must respect the instruction format. + # 1. At most one operand can be used across all constituent uops (this can be repeated). + # 2. At most one oparg can be used across all constituent uops (we assume this, since it cannot be easily checked). + operand_uses = set() + for op in parts: + assert isinstance(op, Uop) + for cache_entry in op.caches: + if (cache_name := cache_entry.name) == "unused": + continue + operand_uses.add(cache_name) + if len(operand_uses) > 1: + analysis_error(f"Uop super {super.name}'s cache entry cannot fit in one operand.", super.tokens[0]) + + replicate_only = "replicate_only" in super.annotations + if not replicate_only: + add_superuop(super.name, parts, super_uops) + + replicates_count = [p.replicated for p in parts if p.replicated != 0] + if len(set(replicates_count)) > 1: + analysis_error(f"Uop super {super.name}'s replicates are not all the same count: {replicates_count}", super.tokens[0]) + + if replicates_count and not replicate_only: + replicate_count = replicates_count[0] + for i in range(replicate_count): + res = [] + for part in parts: + if part.replicated > 0: + assert part.replicated == replicate_count + res.append(uops[part.name + f"_{i}"]) + else: + res.append(part) + add_superuop(super.name + f"_{i}", res, super_uops) + elif replicate_only: + # For instructions consisting only of replicates, we can just make a cross + # product of all their replicates. Expanding the uops we cover. + # Since their oparg doesn't matter. + + replicate_count = replicates_count[0] + replicate_parts = [] + + for part in parts: + assert part.replicated > 0 + res = [] + for i in range(replicate_count): + res.append(uops[part.name + f"_{i}"]) + replicate_parts.append(res) + for permutation in itertools.product(*replicate_parts): + add_superuop('_' + '_'.join([op.name for op in permutation]), permutation, super_uops, is_replicate_only=True) + + + def add_family( pfamily: parser.Family, instructions: dict[str, Instruction], @@ -754,6 +838,7 @@ def add_instruction(name: str) -> None: def analyze_forest(forest: list[parser.AstNode]) -> Analysis: instructions: dict[str, Instruction] = {} uops: dict[str, Uop] = {} + super_uops: dict[str, SuperUop] = {} families: dict[str, Family] = {} pseudos: dict[str, PseudoInstruction] = {} for node in forest: @@ -766,6 +851,8 @@ def analyze_forest(forest: list[parser.AstNode]) -> Analysis: add_op(node, uops) case parser.Macro(): pass + case parser.Super(): + pass case parser.Family(): pass case parser.Pseudo(): @@ -775,6 +862,8 @@ def analyze_forest(forest: list[parser.AstNode]) -> Analysis: for node in forest: if isinstance(node, parser.Macro): add_macro(node, instructions, uops) + if isinstance(node, parser.Super): + add_super(node, super_uops, uops) for node in forest: match node: case parser.Family(): @@ -804,7 +893,7 @@ def analyze_forest(forest: list[parser.AstNode]) -> Analysis: families["BINARY_OP"].members.append(inst) opmap, first_arg, min_instrumented = assign_opcodes(instructions, families, pseudos) return Analysis( - instructions, uops, families, pseudos, opmap, first_arg, min_instrumented + instructions, uops, super_uops, families, pseudos, opmap, first_arg, min_instrumented ) diff --git a/Tools/cases_generator/lexer.py b/Tools/cases_generator/lexer.py index 13aee94f2b957c..9aa25cb2892bd2 100644 --- a/Tools/cases_generator/lexer.py +++ b/Tools/cases_generator/lexer.py @@ -213,6 +213,9 @@ def choice(*opts: str) -> str: # A macro in the DSL MACRO = "MACRO" kwds.append(MACRO) +SUPER = "SUPER" +kwds.append(SUPER) + keywords = {name.lower(): name for name in kwds} ANNOTATION = "ANNOTATION" @@ -224,6 +227,7 @@ def choice(*opts: str) -> str: "pure", "split", "replicate", + "replicate_only", "tier1", "tier2", } diff --git a/Tools/cases_generator/parser.py b/Tools/cases_generator/parser.py index 2b77d14d21143f..4e8687c095d85f 100644 --- a/Tools/cases_generator/parser.py +++ b/Tools/cases_generator/parser.py @@ -1,6 +1,7 @@ from parsing import ( InstDef, Macro, + Super, Pseudo, Family, Parser, diff --git a/Tools/cases_generator/parsing.py b/Tools/cases_generator/parsing.py index 0d54820e4e71fb..36a24fcf8d39f9 100644 --- a/Tools/cases_generator/parsing.py +++ b/Tools/cases_generator/parsing.py @@ -135,6 +135,13 @@ class Family(Node): members: list[str] +@dataclass +class Super(Node): + name: str + annotations: list[str] + uops: list[UOp] + + @dataclass class Pseudo(Node): name: str @@ -142,7 +149,7 @@ class Pseudo(Node): targets: list[str] # opcodes this can be replaced by -AstNode = InstDef | Macro | Pseudo | Family +AstNode = InstDef | Macro | Super | Pseudo | Family class Parser(PLexer): @@ -150,6 +157,8 @@ class Parser(PLexer): def definition(self) -> AstNode | None: if macro := self.macro_def(): return macro + if super := self.super_def(): + return super if family := self.family_def(): return family if pseudo := self.pseudo_def(): @@ -332,6 +341,22 @@ def macro_def(self) -> Macro | None: return res return None + @contextual + def super_def(self) -> Super | None: + annotations = [] + while anno := self.expect(lx.ANNOTATION): + annotations.append(anno.text) + if tkn := self.expect(lx.SUPER): + if self.expect(lx.LPAREN): + if tkn := self.expect(lx.IDENTIFIER): + if self.expect(lx.RPAREN): + if self.expect(lx.EQUALS): + if uops := self.uops(): + self.require(lx.SEMI) + res = Super(tkn.text, annotations, uops) + return res + return None + def uops(self) -> list[UOp] | None: if uop := self.uop(): uop = cast(UOp, uop) diff --git a/Tools/cases_generator/tier2_generator.py b/Tools/cases_generator/tier2_generator.py index d8eed1078b0914..cc63c2731d574e 100644 --- a/Tools/cases_generator/tier2_generator.py +++ b/Tools/cases_generator/tier2_generator.py @@ -146,7 +146,7 @@ def tier2_replace_oparg( TIER2_REPLACEMENT_FUNCTIONS["EXIT_IF"] = tier2_replace_exit_if -def write_uop(uop: Uop, out: CWriter, stack: Stack) -> None: +def write_uop(uop: Uop, out: CWriter, stack: Stack, is_replicates_only: bool = False) -> None: try: out.start_line() if uop.properties.oparg: @@ -154,7 +154,8 @@ def write_uop(uop: Uop, out: CWriter, stack: Stack) -> None: assert uop.properties.const_oparg < 0 elif uop.properties.const_oparg >= 0: out.emit(f"oparg = {uop.properties.const_oparg};\n") - out.emit(f"assert(oparg == CURRENT_OPARG());\n") + if not is_replicates_only: + out.emit(f"assert(oparg == CURRENT_OPARG());\n") for var in reversed(uop.stack.inputs): out.emit(stack.pop(var)) if not uop.properties.stores_sp: @@ -217,6 +218,22 @@ def generate_tier2( out.start_line() out.emit("}") out.emit("\n\n") + TIER2_REPLACEMENT_FUNCTIONS["EXIT_IF"] = tier2_replace_deopt + for name, super_uop in analysis.super_uops.items(): + out.emit(f"case {name}: {{\n") + stack = Stack() + for part in super_uop.parts: + out.emit(f"// {part.name}\n") + out.emit("{\n") + declare_variables(part, out) + write_uop(part, out, stack, super_uop.is_replicates_only) + stack.flush(out) + out.emit("}\n") + out.start_line() + out.emit("break;\n") + out.start_line() + out.emit("}") + out.emit("\n\n") outfile.write("#undef TIER_TWO\n") diff --git a/Tools/cases_generator/tier2_super_matcher_generator.py b/Tools/cases_generator/tier2_super_matcher_generator.py new file mode 100644 index 00000000000000..80ddb19480cec9 --- /dev/null +++ b/Tools/cases_generator/tier2_super_matcher_generator.py @@ -0,0 +1,115 @@ +"""Generate the cases for the matcher of the tier 2 super instructions. +""" + +import argparse +import os.path +import sys + +from analyzer import ( + Analysis, + Instruction, + Uop, + Part, + analyze_files, + Skip, + StackItem, + analysis_error, +) +from generators_common import ( + DEFAULT_INPUT, + ROOT, + write_header, + emit_tokens, + emit_to, + REPLACEMENT_FUNCTIONS, +) +from cwriter import CWriter +from typing import TextIO, Iterator +from lexer import Token +from stack import StackOffset, Stack, SizeMismatch + +DEFAULT_OUTPUT = ROOT / "Python/uop_super_matcher_cases.c.h" + + +def generate_tier2( + filenames: list[str], analysis: Analysis, outfile: TextIO, lines: bool +) -> None: + write_header(__file__, filenames, outfile) + outfile.write( + """ +#ifdef TIER_ONE + #error "This file is for Tier 2 only" +#endif +#define TIER_TWO 2 +""" + ) + out = CWriter(outfile, 2, lines) + out.emit("\n") + first_uops: dict[str, list[Instruction]] = {} + # Extract out common first uops + for name, super_uop in analysis.super_uops.items(): + first_uop = super_uop.parts[0] + if first_uop.name in first_uops: + first_uops[first_uop.name].append(super_uop) + continue + first_uops[first_uop.name] = [super_uop] + for first_uop_name, sub_op in first_uops.items(): + out.emit(f"case {first_uop_name}: ") + out.emit("{\n") + for super_uop in sub_op: + depth = 0 + rest_uops = super_uop.parts[1:] + + oparg = 0 + operand = 0 + for idx, part in enumerate(super_uop.parts): + if part.properties.oparg: + oparg = idx + if len(part.caches) > 0 and part.caches[0] != "unused": + operand = idx + + predicates: list[tuple[int, Uop]] = [] + for part in rest_uops: + depth += 1 + predicates.append((depth, part)) + predicate = " && ".join([f"(this_instr[{d}].opcode == {p.name})" for d, p in predicates]) + out.emit(f"if ({predicate}) {{\n") + out.emit(f'DPRINTF(2, "Inserting super {super_uop.name}\\n");\n') + out.emit(f"REPLACE_OP(this_instr, {super_uop.name}, this_instr[{oparg}].oparg, this_instr[{operand}].operand);\n") + out.emit(f"for (int i = 1; i < {depth + 1}; i++) {{ REPLACE_OP((&this_instr[i]), _NOP, 0, 0); }}\n") + out.emit(f"this_instr += {depth + 1};\n") + out.emit(f"break;\n") + out.emit("}\n") + + out.emit(f"this_instr += 1;\n") + out.emit("break;\n") + out.emit("}") + out.emit("\n\n") + + outfile.write("#undef TIER_TWO\n") + + +arg_parser = argparse.ArgumentParser( + description="Generate the code for the tier 2 interpreter.", + formatter_class=argparse.ArgumentDefaultsHelpFormatter, +) + +arg_parser.add_argument( + "-o", "--output", type=str, help="Generated code", default=DEFAULT_OUTPUT +) + +arg_parser.add_argument( + "-l", "--emit-line-directives", help="Emit #line directives", action="store_true" +) + +arg_parser.add_argument( + "input", nargs=argparse.REMAINDER, help="Instruction definition file(s)" +) + +if __name__ == "__main__": + args = arg_parser.parse_args() + if len(args.input) == 0: + args.input.append(DEFAULT_INPUT) + data = analyze_files(args.input) + with open(args.output, "w") as outfile: + generate_tier2(args.input, data, outfile, args.emit_line_directives) diff --git a/Tools/cases_generator/uop_id_generator.py b/Tools/cases_generator/uop_id_generator.py index eb5e3f4a324735..74c75356f0fe3f 100644 --- a/Tools/cases_generator/uop_id_generator.py +++ b/Tools/cases_generator/uop_id_generator.py @@ -51,6 +51,10 @@ def generate_uop_ids( out.emit(f"#define {name} {next_id}\n") next_id += 1 + for name, uop in sorted([(uop.name, uop) for uop in analysis.super_uops.values()]): + out.emit(f"#define {name} {next_id}\n") + next_id += 1 + out.emit(f"#define MAX_UOP_ID {next_id-1}\n") diff --git a/Tools/cases_generator/uop_metadata_generator.py b/Tools/cases_generator/uop_metadata_generator.py index 72eed3041c55c9..3378c9d15dfd93 100644 --- a/Tools/cases_generator/uop_metadata_generator.py +++ b/Tools/cases_generator/uop_metadata_generator.py @@ -43,6 +43,8 @@ def generate_names_and_flags(analysis: Analysis, out: CWriter) -> None: for uop in sorted(analysis.uops.values(), key=lambda t: t.name): if uop.is_viable() and uop.properties.tier != 1: out.emit(f'[{uop.name}] = "{uop.name}",\n') + for super_uop in sorted(analysis.super_uops.values(), key=lambda t: t.name): + out.emit(f'[{super_uop.name}] = "{super_uop.name}",\n') out.emit("};\n") out.emit("#endif // NEED_OPCODE_METADATA\n\n") diff --git a/Tools/jit/_writer.py b/Tools/jit/_writer.py index 8a2a42e75cfb9b..fddbe4b661e3c5 100644 --- a/Tools/jit/_writer.py +++ b/Tools/jit/_writer.py @@ -51,7 +51,7 @@ def _dump_footer(opnames: typing.Iterable[str]) -> typing.Iterator[str]: yield " .data = INIT_STENCIL(OP##_data), \\" yield "}" yield "" - yield "static const StencilGroup stencil_groups[512] = {" + yield "static const StencilGroup stencil_groups[MAX_UOP_ID + 1] = {" for opname in opnames: yield f" [{opname}] = INIT_STENCIL_GROUP({opname})," yield "};"