Bug 1556220 - Don't add CacheIR entries for typed bigint array access. r=mgaudet, a=RyanVM
authorAndy Wingo <wingo@igalia.com>
Tue, 25 Jun 2019 17:37:08 +0000
changeset 537165 49b397671d0f6ed01b98acfc89493b2c70a849de
parent 537164 6d5726d8218286096bd1b47a2edb99d57ed4ce16
child 537166 12c9d3b85c14cefe91e938b72c63e79f4f722e5d
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmgaudet, RyanVM
bugs1556220
milestone68.0
Bug 1556220 - Don't add CacheIR entries for typed bigint array access. r=mgaudet, a=RyanVM 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;