Commit 9a0511b
authored
Align specialization guards and caching with CPython (#7341)
* vm: complete specialized opcode dispatch paths
* vm: cache LOAD_GLOBAL with dict entry hints
* vm: align adaptive specialization counters with CPython backoff
* vm: apply cooldown counter on specialization success paths
* vm: retain LOAD_GLOBAL specializations on misses
* vm: keep attr and call specializations on guard misses
* vm: retain store-attr and store-subscr specializations on misses
* vm: retain specialization opcodes on generic fallback paths
* vm: align jump-backward specialization defaults with CPython
* vm: retain exact-args call specializations on misses
* vm: retain SEND_GEN specialization on non-coroutine sends
* vm: specialize list.append calls like CPython CALL_LIST_APPEND
* vm: set cooldown on LOAD_ATTR_CLASS specialization
* vm: specialize bound method object CALL paths
* vm: specialize CALL_KW for bound method objects
* vm: use current-state function version for CALL_KW specialization
* vm: align CALL/CALL_KW pyfunction specialization with CPython
* vm: drop call-site identity caches in generic CALL specializations
* vm: align builtin type call specializations with CPython guards
* vm: align builtin CALL guards with CPython self_or_null semantics
* vm: require exact list in CALL_LIST_APPEND fast path
* vm: align CALL builtin/class specialization flow with CPython
* vm: tighten len/isinstance CALL specializations to builtin guards
* vm: gate CALL_BUILTIN_CLASS on type vectorcall like CPython
* vm: run non-py CALL specializations via direct vectorcall
* vm: align class-call specialization branching with CPython
* Fix CI: disable ForIterGen, tighten CALL guards
- Disable ForIterGen specialization (falls through to generic
path) because inline generator frame resumption is needed
for correct debugger StopIteration visibility (test_bdb)
- Use downcast_ref_if_exact for PyNativeFunction in CALL
specialization guards
- Add can_specialize_call guard for class __init__ specialization
- Remove expectedFailure for test_bad_newobj_args (now passing)1 parent 5c29074 commit 9a0511b
File tree
9 files changed
+1214
-713
lines changed- Lib/test
- crates
- compiler-core/src
- jit/src
- vm/src
- builtins
- stdlib/sys
9 files changed
+1214
-713
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | 88 | | |
93 | 89 | | |
94 | 90 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
349 | 349 | | |
350 | 350 | | |
351 | 351 | | |
352 | | - | |
353 | | - | |
354 | | - | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
355 | 393 | | |
356 | 394 | | |
357 | 395 | | |
| |||
370 | 408 | | |
371 | 409 | | |
372 | 410 | | |
373 | | - | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
374 | 415 | | |
375 | 416 | | |
376 | 417 | | |
377 | 418 | | |
378 | | - | |
| 419 | + | |
379 | 420 | | |
380 | 421 | | |
381 | 422 | | |
| |||
385 | 426 | | |
386 | 427 | | |
387 | 428 | | |
388 | | - | |
389 | | - | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
390 | 439 | | |
391 | 440 | | |
392 | 441 | | |
393 | 442 | | |
394 | 443 | | |
395 | 444 | | |
396 | | - | |
| 445 | + | |
397 | 446 | | |
398 | 447 | | |
399 | 448 | | |
| |||
406 | 455 | | |
407 | 456 | | |
408 | 457 | | |
409 | | - | |
| 458 | + | |
410 | 459 | | |
411 | 460 | | |
412 | | - | |
413 | | - | |
| 461 | + | |
| 462 | + | |
414 | 463 | | |
415 | 464 | | |
416 | 465 | | |
417 | 466 | | |
418 | 467 | | |
419 | | - | |
| 468 | + | |
420 | 469 | | |
421 | 470 | | |
422 | 471 | | |
423 | 472 | | |
424 | 473 | | |
425 | | - | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
426 | 483 | | |
427 | 484 | | |
428 | 485 | | |
429 | 486 | | |
430 | 487 | | |
431 | | - | |
| 488 | + | |
432 | 489 | | |
433 | 490 | | |
434 | 491 | | |
| |||
439 | 496 | | |
440 | 497 | | |
441 | 498 | | |
442 | | - | |
| 499 | + | |
443 | 500 | | |
444 | 501 | | |
445 | 502 | | |
| |||
452 | 509 | | |
453 | 510 | | |
454 | 511 | | |
455 | | - | |
| 512 | + | |
456 | 513 | | |
457 | 514 | | |
458 | 515 | | |
| |||
468 | 525 | | |
469 | 526 | | |
470 | 527 | | |
471 | | - | |
| 528 | + | |
472 | 529 | | |
473 | 530 | | |
474 | 531 | | |
| |||
483 | 540 | | |
484 | 541 | | |
485 | 542 | | |
486 | | - | |
| 543 | + | |
487 | 544 | | |
488 | 545 | | |
489 | 546 | | |
| |||
492 | 549 | | |
493 | 550 | | |
494 | 551 | | |
495 | | - | |
| 552 | + | |
496 | 553 | | |
497 | 554 | | |
498 | 555 | | |
| |||
505 | 562 | | |
506 | 563 | | |
507 | 564 | | |
508 | | - | |
| 565 | + | |
509 | 566 | | |
510 | 567 | | |
511 | 568 | | |
| |||
516 | 573 | | |
517 | 574 | | |
518 | 575 | | |
519 | | - | |
| 576 | + | |
520 | 577 | | |
521 | 578 | | |
522 | 579 | | |
| |||
564 | 621 | | |
565 | 622 | | |
566 | 623 | | |
567 | | - | |
| 624 | + | |
568 | 625 | | |
569 | | - | |
570 | | - | |
571 | | - | |
572 | | - | |
573 | | - | |
| 626 | + | |
| 627 | + | |
574 | 628 | | |
575 | 629 | | |
576 | | - | |
| 630 | + | |
577 | 631 | | |
578 | 632 | | |
579 | 633 | | |
580 | | - | |
581 | | - | |
582 | | - | |
583 | | - | |
584 | | - | |
585 | | - | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
586 | 637 | | |
587 | 638 | | |
588 | 639 | | |
| |||
611 | 662 | | |
612 | 663 | | |
613 | 664 | | |
614 | | - | |
| 665 | + | |
615 | 666 | | |
616 | 667 | | |
617 | 668 | | |
| |||
625 | 676 | | |
626 | 677 | | |
627 | 678 | | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
628 | 684 | | |
629 | | - | |
| 685 | + | |
630 | 686 | | |
631 | 687 | | |
632 | 688 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
213 | 222 | | |
214 | 223 | | |
215 | | - | |
| 224 | + | |
216 | 225 | | |
217 | 226 | | |
218 | 227 | | |
| |||
223 | 232 | | |
224 | 233 | | |
225 | 234 | | |
226 | | - | |
| 235 | + | |
227 | 236 | | |
228 | 237 | | |
229 | 238 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
668 | 668 | | |
669 | 669 | | |
670 | 670 | | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
671 | 698 | | |
672 | 699 | | |
673 | 700 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
727 | 727 | | |
728 | 728 | | |
729 | 729 | | |
| 730 | + | |
| 731 | + | |
730 | 732 | | |
731 | 733 | | |
732 | 734 | | |
733 | | - | |
| 735 | + | |
734 | 736 | | |
735 | 737 | | |
736 | 738 | | |
| |||
968 | 970 | | |
969 | 971 | | |
970 | 972 | | |
971 | | - | |
| 973 | + | |
| 974 | + | |
972 | 975 | | |
973 | 976 | | |
974 | 977 | | |
975 | 978 | | |
976 | 979 | | |
977 | 980 | | |
978 | 981 | | |
979 | | - | |
| 982 | + | |
980 | 983 | | |
981 | 984 | | |
982 | 985 | | |
| |||
1149 | 1152 | | |
1150 | 1153 | | |
1151 | 1154 | | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
1152 | 1165 | | |
1153 | 1166 | | |
1154 | 1167 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
327 | 327 | | |
328 | 328 | | |
329 | 329 | | |
330 | | - | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
331 | 337 | | |
332 | 338 | | |
333 | 339 | | |
| |||
0 commit comments