@@ -317,8 +317,10 @@ boolean doBoolSequence(VirtualFrame frame,
317
317
BoolSequenceStorage sequenceStorage ,
318
318
NodeType nodeType ) {
319
319
boolean [] internalArray = sequenceStorage .getInternalBoolArray ();
320
+ int seqLength = sequenceStorage .length ();
320
321
321
- for (int i = 0 ; loopConditionProfile .profile (i < sequenceStorage .length ()); i ++) {
322
+ loopConditionProfile .profileCounted (seqLength );
323
+ for (int i = 0 ; loopConditionProfile .inject (i < seqLength ); i ++) {
322
324
if (nodeType == NodeType .ALL && !isTrueNode .execute (frame , internalArray [i ])) {
323
325
return false ;
324
326
} else if (nodeType == NodeType .ANY && isTrueNode .execute (frame , internalArray [i ])) {
@@ -335,8 +337,10 @@ boolean doIntSequence(VirtualFrame frame,
335
337
IntSequenceStorage sequenceStorage ,
336
338
NodeType nodeType ) {
337
339
int [] internalArray = sequenceStorage .getInternalIntArray ();
340
+ int seqLength = sequenceStorage .length ();
338
341
339
- for (int i = 0 ; loopConditionProfile .profile (i < sequenceStorage .length ()); i ++) {
342
+ loopConditionProfile .profileCounted (seqLength );
343
+ for (int i = 0 ; loopConditionProfile .inject (i < seqLength ); i ++) {
340
344
if (nodeType == NodeType .ALL && !isTrueNode .execute (frame , internalArray [i ])) {
341
345
return false ;
342
346
} else if (nodeType == NodeType .ANY && isTrueNode .execute (frame , internalArray [i ])) {
@@ -355,7 +359,8 @@ boolean doGenericSequence(VirtualFrame frame,
355
359
Object [] internalArray = sequenceStorage .getInternalArray ();
356
360
int seqLength = lenNode .execute (sequenceStorage );
357
361
358
- for (int i = 0 ; loopConditionProfile .profile (i < seqLength ); i ++) {
362
+ loopConditionProfile .profileCounted (seqLength );
363
+ for (int i = 0 ; loopConditionProfile .inject (i < seqLength ); i ++) {
359
364
if (nodeType == NodeType .ALL && !isTrueNode .execute (frame , internalArray [i ])) {
360
365
return false ;
361
366
} else if (nodeType == NodeType .ANY && isTrueNode .execute (frame , internalArray [i ])) {
@@ -372,8 +377,10 @@ protected boolean doHashStorage(VirtualFrame frame,
372
377
NodeType nodeType ,
373
378
@ CachedLibrary ("hashingStorage" ) HashingStorageLibrary hlib ) {
374
379
HashingStorageLibrary .HashingStorageIterator <Object > keysIter = hlib .keys (hashingStorage ).iterator ();
380
+ int seqLength = hlib .length (hashingStorage );
375
381
376
- for (int i = 0 ; loopConditionProfile .profile (i < hlib .length (hashingStorage )); i ++) {
382
+ loopConditionProfile .profileCounted (seqLength );
383
+ for (int i = 0 ; loopConditionProfile .inject (i < seqLength ); i ++) {
377
384
Object key = keysIter .next ();
378
385
if (nodeType == NodeType .ALL ) {
379
386
if (!isTrueNode .execute (frame , key )) {
0 commit comments