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
--- 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