Bug 1886849: Remove MObjectKeysLength::computeRange r=jandem, a=dsmith
authorIain Ireland <iireland@mozilla.com>
Thu, 21 Mar 2024 18:48:46 +0000 (16 months ago)
changeset 776741 83c1d327323c6929ffe96fd5dc4868f968b5fb16
parent 776740 00dc57b4677aa1872b2d4dd8caf38fda8e084f2c
child 776742 f0a24d8f29033faf04f6fe98453cdb5c2ac4a96f
push id3335
push userdsmith@mozilla.com
push dateThu, 21 Mar 2024 22:58:55 +0000 (16 months ago)
treeherdermozilla-release@83c1d327323c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem, dsmith
bugs1886849
milestone124.0.1
Bug 1886849: Remove MObjectKeysLength::computeRange r=jandem, a=dsmith Differential Revision: https://phabricator.services.mozilla.com/D205375
js/src/jit/MIROps.yaml
js/src/jit/RangeAnalysis.cpp
--- a/js/src/jit/MIROps.yaml
+++ b/js/src/jit/MIROps.yaml
@@ -1660,17 +1660,16 @@
 # part of MArrayLength::foldsTo.
 - name: ObjectKeysLength
   operands:
     object: Object
   result_type: Int32
   movable: false
   congruent_to: if_operands_equal
   alias_set: custom
-  compute_range: custom
   clone: true
 
 - name: LoadUnboxedScalar
   gen_boilerplate: false
 
 - name: LoadDataViewElement
   gen_boilerplate: false
 
--- a/js/src/jit/RangeAnalysis.cpp
+++ b/js/src/jit/RangeAnalysis.cpp
@@ -1797,23 +1797,16 @@ void MArrayBufferViewLength::computeRang
 }
 
 void MArrayBufferViewByteOffset::computeRange(TempAllocator& alloc) {
   if constexpr (ArrayBufferObject::ByteLengthLimit <= INT32_MAX) {
     setRange(Range::NewUInt32Range(alloc, 0, INT32_MAX));
   }
 }
 
-void MObjectKeysLength::computeRange(TempAllocator& alloc) {
-  // Object.keys(..) returns an array, but this array is bounded by the number
-  // of slots / elements that can be encoded in a single object.
-  MOZ_ASSERT(type() == MIRType::Int32);
-  setRange(Range::NewUInt32Range(alloc, 0, NativeObject::MAX_SLOTS_COUNT));
-}
-
 void MTypedArrayElementSize::computeRange(TempAllocator& alloc) {
   constexpr auto MaxTypedArraySize = sizeof(double);
 
 #define ASSERT_MAX_SIZE(_, T, N)                \
   static_assert(sizeof(T) <= MaxTypedArraySize, \
                 "unexpected typed array type exceeding 64-bits storage");
   JS_FOR_EACH_TYPED_ARRAY(ASSERT_MAX_SIZE)
 #undef ASSERT_MAX_SIZE