File tree 1 file changed +5
-5
lines changed
src/trufflesom/interpreter/nodes
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -201,21 +201,20 @@ public NodeCost getCost() {
201
201
private PreevaluatedExpression specialize (final Object [] arguments ) {
202
202
int cacheSize = numCacheNodes ;
203
203
if (cacheSize < 0 ) {
204
- cacheSize = numCacheNodes = 0 ;
205
204
PreevaluatedExpression eager = attemptEagerSpecialization (arguments );
206
205
if (eager != null ) {
207
206
return eager ;
208
207
}
209
- }
210
208
211
- final GuardedDispatchNode first = dispatchCache ;
209
+ cacheSize = numCacheNodes = 0 ;
210
+ }
212
211
213
212
Object rcvr = arguments [0 ];
214
213
assert rcvr != null ;
215
214
216
215
if (rcvr instanceof SObject ) {
217
216
SObject r = (SObject ) rcvr ;
218
- if (r .updateLayoutToMatchClass () && first != null ) {
217
+ if (r .updateLayoutToMatchClass () && cacheSize > 0 ) {
219
218
// if the dispatchCache is null, we end up here, so continue directly below instead
220
219
// otherwise, let's retry the cache!
221
220
return this ;
@@ -247,8 +246,9 @@ private PreevaluatedExpression specialize(final Object[] arguments) {
247
246
node = new CachedDnuNode (rcvrClass , guard , selector );
248
247
}
249
248
250
- if (first != null ) {
249
+ if (cacheSize > 0 ) {
251
250
reportPolymorphicSpecialize ();
251
+ final AbstractDispatchNode first = dispatchCache ;
252
252
node .next = node .insertHere (first );
253
253
}
254
254
dispatchCache = insert (node );
You can’t perform that action at this time.
0 commit comments