Commit dd5a685
committed
SI-7475 findMember and findMembers: estranged no more
Swathes of important logic are duplicated between `findMember`
and `findMembers` after they separated on grounds of irreconcilable
differences about how fast they should run:
d905558 Variation #10 to optimze findMember
fcb0c01 Attempt #9 to opimize findMember.
71d2ceb Attempt #8 to opimize findMember.
77e5692 Attempty #7 to optimize findMember
275115e Fixing problem that caused fingerprints to fail in
e94252e Attemmpt #6 to optimize findMember
73e61b8 Attempt #5 to optimize findMember.
04f0b65 Attempt #4 to optimize findMember
0e3c70f Attempt #3 to optimize findMember
41f4497 Attempt #2 to optimize findMember
1a73aa0 Attempt #1 to optimize findMember
This didn't actually bear fruit, and the intervening years have
seen the implementations drift.
Now is the time to reunite them under the banner of `FindMemberBase`.
Each has a separate subclass to customise the behaviour. This is
primarily used by `findMember` to cache member types and to assemble
the resulting list of symbols in an low-allocation manner.
While there I have introduced some polymorphic calls, the call sites
are only bi-morphic, and our typical pattern of compilation involves
far more `findMember` calls, so I expect that JIT will keep the
virtual call cost to an absolute minimum.
Test results have been updated now that `findMembers` correctly
excludes constructors and doesn't inherit privates.
Coming up next: we can actually fix SI-7475!1 parent 779f08d commit dd5a685
File tree
4 files changed
+70
-169
lines changed- src/reflect/scala/reflect
- internal
- tpe
- runtime
- test/files/run
4 files changed
+70
-169
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
990 | 990 | | |
991 | 991 | | |
992 | 992 | | |
993 | | - | |
994 | | - | |
995 | | - | |
996 | | - | |
997 | | - | |
998 | | - | |
999 | | - | |
1000 | | - | |
1001 | | - | |
1002 | | - | |
1003 | | - | |
1004 | | - | |
1005 | | - | |
1006 | | - | |
1007 | | - | |
1008 | | - | |
1009 | | - | |
1010 | | - | |
1011 | | - | |
1012 | | - | |
1013 | | - | |
1014 | | - | |
1015 | | - | |
1016 | | - | |
1017 | | - | |
1018 | | - | |
1019 | | - | |
1020 | | - | |
1021 | | - | |
1022 | | - | |
1023 | | - | |
1024 | | - | |
1025 | | - | |
1026 | | - | |
1027 | | - | |
1028 | | - | |
1029 | | - | |
1030 | | - | |
1031 | | - | |
1032 | | - | |
1033 | | - | |
1034 | | - | |
1035 | | - | |
1036 | | - | |
1037 | | - | |
1038 | | - | |
1039 | | - | |
1040 | | - | |
1041 | | - | |
1042 | | - | |
1043 | | - | |
1044 | | - | |
1045 | | - | |
1046 | | - | |
1047 | | - | |
1048 | | - | |
1049 | | - | |
1050 | | - | |
1051 | | - | |
| 993 | + | |
1052 | 994 | | |
1053 | 995 | | |
1054 | 996 | | |
| |||
1063 | 1005 | | |
1064 | 1006 | | |
1065 | 1007 | | |
1066 | | - | |
1067 | | - | |
1068 | | - | |
1069 | | - | |
1070 | | - | |
1071 | | - | |
1072 | | - | |
1073 | | - | |
1074 | | - | |
1075 | | - | |
1076 | | - | |
1077 | | - | |
1078 | | - | |
1079 | | - | |
1080 | | - | |
1081 | | - | |
1082 | | - | |
1083 | | - | |
1084 | | - | |
1085 | | - | |
1086 | | - | |
1087 | | - | |
1088 | | - | |
1089 | | - | |
1090 | | - | |
1091 | | - | |
1092 | | - | |
1093 | | - | |
1094 | | - | |
1095 | | - | |
1096 | | - | |
1097 | | - | |
1098 | | - | |
1099 | | - | |
1100 | | - | |
1101 | | - | |
1102 | | - | |
1103 | | - | |
1104 | | - | |
1105 | | - | |
1106 | | - | |
1107 | | - | |
1108 | | - | |
1109 | | - | |
1110 | | - | |
1111 | | - | |
1112 | | - | |
1113 | | - | |
1114 | | - | |
1115 | | - | |
1116 | | - | |
1117 | | - | |
1118 | | - | |
1119 | | - | |
1120 | | - | |
1121 | | - | |
1122 | | - | |
1123 | | - | |
1124 | | - | |
1125 | | - | |
1126 | | - | |
1127 | | - | |
1128 | | - | |
1129 | | - | |
1130 | | - | |
1131 | | - | |
1132 | | - | |
1133 | | - | |
1134 | | - | |
1135 | | - | |
1136 | | - | |
1137 | | - | |
1138 | | - | |
1139 | | - | |
1140 | | - | |
1141 | | - | |
1142 | | - | |
1143 | | - | |
1144 | | - | |
1145 | | - | |
1146 | | - | |
1147 | | - | |
1148 | | - | |
1149 | | - | |
1150 | | - | |
1151 | | - | |
1152 | | - | |
1153 | | - | |
1154 | | - | |
1155 | | - | |
1156 | | - | |
1157 | | - | |
1158 | | - | |
1159 | | - | |
1160 | | - | |
1161 | | - | |
1162 | | - | |
1163 | | - | |
1164 | | - | |
1165 | | - | |
1166 | | - | |
1167 | | - | |
1168 | | - | |
1169 | | - | |
1170 | | - | |
1171 | | - | |
1172 | | - | |
1173 | | - | |
1174 | | - | |
| 1008 | + | |
1175 | 1009 | | |
1176 | 1010 | | |
1177 | 1011 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
153 | 178 | | |
154 | 179 | | |
155 | 180 | | |
| |||
Lines changed: 43 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
30 | 50 | | |
31 | 51 | | |
| 52 | + | |
32 | 53 | | |
33 | 54 | | |
34 | 55 | | |
| |||
40 | 61 | | |
41 | 62 | | |
42 | 63 | | |
| 64 | + | |
43 | 65 | | |
44 | 66 | | |
45 | 67 | | |
46 | 68 | | |
47 | 69 | | |
| 70 | + | |
48 | 71 | | |
49 | 72 | | |
50 | 73 | | |
| 74 | + | |
51 | 75 | | |
52 | 76 | | |
53 | 77 | | |
54 | 78 | | |
55 | 79 | | |
| 80 | + | |
56 | 81 | | |
57 | 82 | | |
58 | 83 | | |
| 84 | + | |
59 | 85 | | |
60 | 86 | | |
61 | 87 | | |
| |||
64 | 90 | | |
65 | 91 | | |
66 | 92 | | |
| 93 | + | |
67 | 94 | | |
68 | 95 | | |
69 | 96 | | |
70 | 97 | | |
| 98 | + | |
71 | 99 | | |
| 100 | + | |
72 | 101 | | |
| 102 | + | |
73 | 103 | | |
74 | 104 | | |
75 | 105 | | |
| |||
78 | 108 | | |
79 | 109 | | |
80 | 110 | | |
| 111 | + | |
81 | 112 | | |
| 113 | + | |
82 | 114 | | |
83 | 115 | | |
84 | 116 | | |
85 | 117 | | |
86 | 118 | | |
87 | 119 | | |
| 120 | + | |
88 | 121 | | |
89 | 122 | | |
90 | 123 | | |
| |||
95 | 128 | | |
96 | 129 | | |
97 | 130 | | |
| 131 | + | |
98 | 132 | | |
99 | 133 | | |
100 | 134 | | |
| |||
114 | 148 | | |
115 | 149 | | |
116 | 150 | | |
| 151 | + | |
117 | 152 | | |
118 | 153 | | |
119 | 154 | | |
| |||
150 | 185 | | |
151 | 186 | | |
152 | 187 | | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
153 | 191 | | |
154 | 192 | | |
155 | 193 | | |
| |||
161 | 199 | | |
162 | 200 | | |
163 | 201 | | |
| 202 | + | |
164 | 203 | | |
165 | 204 | | |
166 | 205 | | |
167 | 206 | | |
| 207 | + | |
168 | 208 | | |
169 | 209 | | |
170 | 210 | | |
171 | 211 | | |
172 | 212 | | |
| 213 | + | |
173 | 214 | | |
174 | 215 | | |
175 | 216 | | |
| |||
386 | 427 | | |
387 | 428 | | |
388 | 429 | | |
| 430 | + | |
389 | 431 | | |
390 | 432 | | |
391 | 433 | | |
392 | 434 | | |
393 | 435 | | |
394 | 436 | | |
| 437 | + | |
395 | 438 | | |
396 | 439 | | |
397 | 440 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
86 | 85 | | |
87 | 86 | | |
88 | 87 | | |
| |||
0 commit comments