Commit 9ddcc59
committed
Omit non-needs_drop drop_in_place in vtables
This replaces the drop_in_place reference with null in vtables. On
librustc_driver.so, this drops about ~17k dynamic relocations from the
output, since many vtables can now be placed in read-only memory, rather
than having a relocated pointer included.
This makes a tradeoff by adding a null check at vtable call sites.
That's hard to avoid without changing the vtable format (e.g., to use a
pc-relative relocation instead of an absolute address, and avoid the
dynamic relocation that way). But it seems likely that the check is
cheap at runtime.1 parent 05b1415 commit 9ddcc59
2 files changed
+17
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
593 | 593 | | |
594 | 594 | | |
595 | 595 | | |
| 596 | + | |
596 | 597 | | |
597 | 598 | | |
598 | 599 | | |
| |||
620 | 621 | | |
621 | 622 | | |
622 | 623 | | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
623 | 630 | | |
624 | 631 | | |
625 | 632 | | |
| |||
659 | 666 | | |
660 | 667 | | |
661 | 668 | | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
662 | 675 | | |
663 | 676 | | |
664 | 677 | | |
| |||
697 | 710 | | |
698 | 711 | | |
699 | 712 | | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
700 | 716 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
548 | 548 | | |
549 | 549 | | |
550 | 550 | | |
551 | | - | |
552 | | - | |
553 | | - | |
554 | | - | |
| 551 | + | |
555 | 552 | | |
556 | 553 | | |
557 | 554 | | |
| |||
0 commit comments