Bug 1556220 - Don't add CacheIR entries for typed bigint array access r=mgaudet

Differential Revision: https://phabricator.services.mozilla.com/D33459

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andy Wingo 2019-06-25 17:37:08 +00:00
parent 920ce17938
commit 1694e85a41

View File

@ -2260,6 +2260,12 @@ AttachDecision GetPropIRGenerator::tryAttachTypedElement(
return AttachDecision::NoAction;
}
// BigInt boxing not yet implemented.
if (obj->is<TypedArrayObject>() &&
Scalar::isBigIntType(obj->as<TypedArrayObject>().type())) {
return AttachDecision::NoAction;
}
// Don't attach typed object stubs if the underlying storage could be
// detached, as the stub will always bail out.
if (IsPrimitiveArrayTypedObject(obj) && cx_->zone()->detachedTypedObjects) {
@ -3883,6 +3889,12 @@ AttachDecision SetPropIRGenerator::tryAttachSetTypedElement(
return AttachDecision::NoAction;
}
// bigIntArray[index] = rhsVal_ will throw as the RHS is a number.
if (obj->is<TypedArrayObject>() &&
Scalar::isBigIntType(obj->as<TypedArrayObject>().type())) {
return AttachDecision::NoAction;
}
bool handleOutOfBounds = false;
if (obj->is<TypedArrayObject>()) {
handleOutOfBounds = (index >= obj->as<TypedArrayObject>().length());