Bug 1310744: Add NativeObject::denseElementsAreFrozen. r?nbp draft
authorEmilio Cobos Álvarez <ecoal95@gmail.com>
Wed, 19 Oct 2016 20:31:56 +0200
changeset 427199 fe215d8ae636dffde43b3d9c11fa5cb5be8058f0
parent 427069 f40960c63bfac865d510ec9da42eeed74c384082
child 427200 0eedc31c51d9fb608f09499791109e64ae8f84e1
child 427479 3c107e47d50553d7430bfa3158a9e9daf8f5be6e
push id32955
push userbmo:ecoal95@gmail.com
push dateThu, 20 Oct 2016 00:19:26 +0000
reviewersnbp
bugs1310744
milestone52.0a1
Bug 1310744: Add NativeObject::denseElementsAreFrozen. r?nbp We are going to use this in a few places now, so make it public. MozReview-Commit-ID: JvzZkIfWxAj
js/src/vm/NativeObject.h
--- a/js/src/vm/NativeObject.h
+++ b/js/src/vm/NativeObject.h
@@ -1123,16 +1123,20 @@ class NativeObject : public ShapedObject
 
     inline void setShouldConvertDoubleElements();
     inline void clearShouldConvertDoubleElements();
 
     bool denseElementsAreCopyOnWrite() {
         return getElementsHeader()->isCopyOnWrite();
     }
 
+    bool denseElementsAreFrozen() {
+        return getElementsHeader()->isFrozen();
+    }
+
     /* Packed information for this object's elements. */
     inline bool writeToIndexWouldMarkNotPacked(uint32_t index);
     inline void markDenseElementsNotPacked(ExclusiveContext* cx);
 
     // Ensures that the object can hold at least index + extra elements. This
     // returns DenseElement_Success on success, DenseElement_Failed on failure
     // to grow the array, or DenseElement_Incomplete when the object is too
     // sparse to grow (this includes the case of index + extra overflow). In