Commit ee67399
committed
[jvm] drop functional_interface_lut; compute SAM field on demand
The LUT memoized get_singular_interface_field per class, populated by
typeloadFields.check_functional_interface and re-checked lazily by
AbstractCast (#11549, for display-mode flows where init_class hadn't
run yet by the time a SAM conversion was queried). It was a global
mutable hashtbl on common.context whose only reader was AbstractCast.
The cached computation is a walk over a SAM interface's field list —
typically under 10 entries, and short-circuits on the second non-default
method, so the perf delta from recomputing is well below noise. Doing
that directly in AbstractCast collapses the two load paths into one and
removes the field from common.context.
Also drops the now-no-op typeloadFields.check_functional_interface
(its only effect was populating the LUT) and the bridge call that
re-invoked it from init_class when the flag was set via @:functionalInterface
meta in typeloadModule.1 parent cbd81b1 commit ee67399
3 files changed
Lines changed: 4 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
99 | 94 | | |
100 | 95 | | |
101 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
345 | 345 | | |
346 | 346 | | |
347 | 347 | | |
348 | | - | |
349 | 348 | | |
350 | 349 | | |
351 | 350 | | |
| |||
810 | 809 | | |
811 | 810 | | |
812 | 811 | | |
813 | | - | |
814 | 812 | | |
815 | 813 | | |
816 | 814 | | |
| |||
935 | 933 | | |
936 | 934 | | |
937 | 935 | | |
938 | | - | |
939 | 936 | | |
940 | 937 | | |
941 | 938 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1644 | 1644 | | |
1645 | 1645 | | |
1646 | 1646 | | |
1647 | | - | |
1648 | | - | |
1649 | | - | |
1650 | | - | |
1651 | | - | |
1652 | | - | |
1653 | | - | |
1654 | | - | |
1655 | 1647 | | |
1656 | 1648 | | |
1657 | 1649 | | |
| |||
1793 | 1785 | | |
1794 | 1786 | | |
1795 | 1787 | | |
1796 | | - | |
| 1788 | + | |
1797 | 1789 | | |
1798 | 1790 | | |
1799 | 1791 | | |
| |||
0 commit comments