Bug 1556220 - Don't add CacheIR entries for typed bigint array access r=mgaudet
authorAndy Wingo <wingo@igalia.com>
Tue, 25 Jun 2019 17:37:08 +0000
changeset 543159 701877184a2e951648cf47299559733b1489af9b
parent 543158 abb8b01b3ed2056ea28857d8e9f85960f7e19558
child 543160 3be455e67a2ca279d8723b9270872a6b2a4c2e2d
push id2131
push userffxbld-merge
push dateMon, 26 Aug 2019 18:30:20 +0000
treeherdermozilla-release@b19ffb3ca153 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmgaudet
bugs1556220
milestone69.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1556220 - Don't add CacheIR entries for typed bigint array access r=mgaudet Differential Revision: https://phabricator.services.mozilla.com/D33459
js/src/jit/CacheIR.cpp
--- a/js/src/jit/CacheIR.cpp
+++ b/js/src/jit/CacheIR.cpp
@@ -2255,16 +2255,22 @@ AttachDecision GetPropIRGenerator::tryAt
   }
 
   // Ensure the index is in-bounds so the element type gets monitored.
   if (obj->is<TypedArrayObject>() &&
       index >= obj->as<TypedArrayObject>().length()) {
     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) {
     return AttachDecision::NoAction;
   }
 
   TypedThingLayout layout = GetTypedThingLayout(obj->getClass());
 
@@ -3878,16 +3884,22 @@ AttachDecision SetPropIRGenerator::tryAt
   if (!obj->is<TypedArrayObject>() && !IsPrimitiveArrayTypedObject(obj)) {
     return AttachDecision::NoAction;
   }
 
   if (!rhsVal_.isNumber()) {
     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());
   } else {
     // Typed objects throw on out of bounds accesses. Don't attach
     // a stub in this case.
     if (index >= obj->as<TypedObject>().length()) {
       return AttachDecision::NoAction;