summaryrefslogtreecommitdiffstats
path: root/js/src/vm/NativeObject.h
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/vm/NativeObject.h')
-rw-r--r--js/src/vm/NativeObject.h28
1 files changed, 13 insertions, 15 deletions
diff --git a/js/src/vm/NativeObject.h b/js/src/vm/NativeObject.h
index 9cc6d5436..3a3e50244 100644
--- a/js/src/vm/NativeObject.h
+++ b/js/src/vm/NativeObject.h
@@ -339,19 +339,16 @@ IsObjectValueInCompartment(const Value& v, JSCompartment* comp);
#endif
// Operations which change an object's dense elements can either succeed, fail,
-// or be unable to complete. The latter is used when the object's elements must
-// become sparse instead. The enum below is used for such operations.
+// or be unable to complete. For native objects, the latter is used when the
+// object's elements must become sparse instead. The enum below is used for
+// such operations, and for similar operations on unboxed arrays and methods
+// that work on both kinds of objects.
enum class DenseElementResult {
Failure,
Success,
Incomplete
};
-enum class ShouldUpdateTypes {
- Update,
- DontUpdate
-};
-
/*
* NativeObject specifies the internal implementation of a native object.
*
@@ -470,6 +467,11 @@ class NativeObject : public ShapedObject
// that are (temporarily) inconsistent.
void setLastPropertyMakeNonNative(Shape* shape);
+ // As for setLastProperty(), but changes the class associated with the
+ // object to a native one. The object's type has already been changed, and
+ // this brings the shape into sync with it.
+ void setLastPropertyMakeNative(ExclusiveContext* cx, Shape* shape);
+
// Newly-created TypedArrays that map a SharedArrayBuffer are
// marked as shared by giving them an ObjectElements that has the
// ObjectElements::SHARED_MEMORY flag set.
@@ -744,10 +746,10 @@ class NativeObject : public ShapedObject
bool allowDictionary = true);
/* Add a data property whose id is not yet in this scope. */
- static Shape* addDataProperty(ExclusiveContext* cx, HandleNativeObject obj,
- jsid id_, uint32_t slot, unsigned attrs);
- static Shape* addDataProperty(ExclusiveContext* cx, HandleNativeObject obj,
- HandlePropertyName name, uint32_t slot, unsigned attrs);
+ Shape* addDataProperty(ExclusiveContext* cx,
+ jsid id_, uint32_t slot, unsigned attrs);
+ Shape* addDataProperty(ExclusiveContext* cx, HandlePropertyName name,
+ uint32_t slot, unsigned attrs);
/* Add or overwrite a property for id in this scope. */
static Shape*
@@ -1149,10 +1151,6 @@ class NativeObject : public ShapedObject
elementsRangeWriteBarrierPost(dstStart, count);
}
- inline DenseElementResult
- setOrExtendDenseElements(ExclusiveContext* cx, uint32_t start, const Value* vp, uint32_t count,
- ShouldUpdateTypes updateTypes = ShouldUpdateTypes::Update);
-
bool shouldConvertDoubleElements() {
return getElementsHeader()->shouldConvertDoubleElements();
}