We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 93a7284 commit 0b3c038Copy full SHA for 0b3c038
src/trufflesom/interpreter/nodes/MessageSendNode.java
@@ -182,12 +182,6 @@ public NodeCost getCost() {
182
return NodeCost.UNINITIALIZED;
183
}
184
185
- GuardedDispatchNode cache = dispatchCache;
186
-
187
- if (cache instanceof GenericDispatchNode) {
188
- return NodeCost.MEGAMORPHIC;
189
- }
190
191
int cacheSize = numCacheNodes;
192
193
if (cacheSize == 0) {
@@ -198,7 +192,10 @@ public NodeCost getCost() {
198
return NodeCost.MONOMORPHIC;
199
200
194
201
- return NodeCost.POLYMORPHIC;
195
+ if (cacheSize < AbstractDispatchNode.INLINE_CACHE_SIZE) {
196
+ return NodeCost.POLYMORPHIC;
197
+ }
+ return NodeCost.MEGAMORPHIC;
202
203
204
private PreevaluatedExpression specialize(final Object[] arguments) {
0 commit comments