@@ -317,9 +317,8 @@ boolean doBoolSequence(VirtualFrame frame,
317
317
BoolSequenceStorage sequenceStorage ,
318
318
NodeType nodeType ) {
319
319
boolean [] internalArray = sequenceStorage .getInternalBoolArray ();
320
- int i = 0 ;
321
320
322
- while ( loopConditionProfile .profile (i < sequenceStorage .length ())) {
321
+ for ( int i = 0 ; loopConditionProfile .profile (i < sequenceStorage .length ()); i ++ ) {
323
322
if (nodeType == NodeType .ALL && !isTrueNode .execute (frame , internalArray [i ])) {
324
323
return false ;
325
324
} else if (nodeType == NodeType .ANY && isTrueNode .execute (frame , internalArray [i ])) {
@@ -336,9 +335,8 @@ boolean doIntSequence(VirtualFrame frame,
336
335
IntSequenceStorage sequenceStorage ,
337
336
NodeType nodeType ) {
338
337
int [] internalArray = sequenceStorage .getInternalIntArray ();
339
- int i = 0 ;
340
338
341
- while ( loopConditionProfile .profile (i < sequenceStorage .length ())) {
339
+ for ( int i = 0 ; loopConditionProfile .profile (i < sequenceStorage .length ()); i ++ ) {
342
340
if (nodeType == NodeType .ALL && !isTrueNode .execute (frame , internalArray [i ])) {
343
341
return false ;
344
342
} else if (nodeType == NodeType .ANY && isTrueNode .execute (frame , internalArray [i ])) {
@@ -355,10 +353,9 @@ boolean doGenericSequence(VirtualFrame frame,
355
353
NodeType nodeType ,
356
354
@ Cached SequenceStorageNodes .LenNode lenNode ) {
357
355
Object [] internalArray = sequenceStorage .getInternalArray ();
358
- int i = 0 ;
359
356
int seqLength = lenNode .execute (sequenceStorage );
360
357
361
- while ( loopConditionProfile .profile (i < seqLength )) {
358
+ for ( int i = 0 ; loopConditionProfile .profile (i < seqLength ); i ++ ) {
362
359
if (nodeType == NodeType .ALL && !isTrueNode .execute (frame , internalArray [i ])) {
363
360
return false ;
364
361
} else if (nodeType == NodeType .ANY && isTrueNode .execute (frame , internalArray [i ])) {
@@ -374,8 +371,10 @@ protected boolean doHashStorage(VirtualFrame frame,
374
371
HashingStorage hashingStorage ,
375
372
NodeType nodeType ,
376
373
@ CachedLibrary ("hashingStorage" ) HashingStorageLibrary hlib ) {
377
- for (Object key : hlib .keys (hashingStorage )) {
378
- LoopNode .reportLoopCount (this , 1 );
374
+ HashingStorageLibrary .HashingStorageIterator <Object > keysIter = hlib .keys (hashingStorage ).iterator ();
375
+
376
+ for (int i = 0 ; loopConditionProfile .profile (i < hlib .length (hashingStorage )); i ++) {
377
+ Object key = keysIter .next ();
379
378
if (nodeType == NodeType .ALL ) {
380
379
if (!isTrueNode .execute (frame , key )) {
381
380
return false ;
0 commit comments