Bug 1030083 - IonMonkey: Eliminate 'index in array' checks for packed arrays, r=jandem

This commit is contained in:
Hannes Verschore 2014-07-04 19:43:24 +02:00
parent 59a8c1f0c5
commit df11430899

View File

@ -10146,6 +10146,12 @@ IonBuilder::jsop_in_dense()
MInitializedLength *initLength = MInitializedLength::New(alloc(), elements);
current->add(initLength);
// If there are no holes, speculate the InArray check will not fail.
if (!needsHoleCheck && !failedBoundsCheck_) {
addBoundsCheck(idInt32, initLength);
return pushConstant(BooleanValue(true));
}
// Check if id < initLength and elem[id] not a hole.
MInArray *ins = MInArray::New(alloc(), elements, id, initLength, obj, needsHoleCheck);