summaryrefslogtreecommitdiffstats
path: root/js/src/jsobj.h
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jsobj.h')
-rw-r--r--js/src/jsobj.h67
1 files changed, 24 insertions, 43 deletions
diff --git a/js/src/jsobj.h b/js/src/jsobj.h
index af79131af..01845d7e6 100644
--- a/js/src/jsobj.h
+++ b/js/src/jsobj.h
@@ -141,8 +141,6 @@ class JSObject : public js::gc::Cell
js::GetOwnPropertyOp getOpsGetOwnPropertyDescriptor()
const { return getClass()->getOpsGetOwnPropertyDescriptor(); }
js::DeletePropertyOp getOpsDeleteProperty() const { return getClass()->getOpsDeleteProperty(); }
- js::WatchOp getOpsWatch() const { return getClass()->getOpsWatch(); }
- js::UnwatchOp getOpsUnwatch() const { return getClass()->getOpsUnwatch(); }
js::GetElementsOp getOpsGetElements() const { return getClass()->getOpsGetElements(); }
JSNewEnumerateOp getOpsEnumerate() const { return getClass()->getOpsEnumerate(); }
JSFunToStringOp getOpsFunToString() const { return getClass()->getOpsFunToString(); }
@@ -200,8 +198,8 @@ class JSObject : public js::gc::Cell
GENERATE_SHAPE
};
- bool setFlags(js::ExclusiveContext* cx, js::BaseShape::Flag flags,
- GenerateShape generateShape = GENERATE_NONE);
+ static bool setFlags(js::ExclusiveContext* cx, JS::HandleObject obj, js::BaseShape::Flag flags,
+ GenerateShape generateShape = GENERATE_NONE);
inline bool hasAllFlags(js::BaseShape::Flag flags) const;
/*
@@ -214,18 +212,13 @@ class JSObject : public js::gc::Cell
* (see Purge{Scope,Proto}Chain in jsobj.cpp).
*/
inline bool isDelegate() const;
- bool setDelegate(js::ExclusiveContext* cx) {
- return setFlags(cx, js::BaseShape::DELEGATE, GENERATE_SHAPE);
+ static bool setDelegate(js::ExclusiveContext* cx, JS::HandleObject obj) {
+ return setFlags(cx, obj, js::BaseShape::DELEGATE, GENERATE_SHAPE);
}
inline bool isBoundFunction() const;
inline bool hasSpecialEquality() const;
- inline bool watched() const;
- bool setWatched(js::ExclusiveContext* cx) {
- return setFlags(cx, js::BaseShape::WATCHED, GENERATE_SHAPE);
- }
-
// A "qualified" varobj is the object on which "qualified" variable
// declarations (i.e., those defined with "var") are kept.
//
@@ -247,8 +240,8 @@ class JSObject : public js::gc::Cell
// (e.g., Gecko and XPConnect), as they often wish to run scripts under a
// scope that captures var bindings.
inline bool isQualifiedVarObj() const;
- bool setQualifiedVarObj(js::ExclusiveContext* cx) {
- return setFlags(cx, js::BaseShape::QUALIFIED_VAROBJ);
+ static bool setQualifiedVarObj(js::ExclusiveContext* cx, JS::HandleObject obj) {
+ return setFlags(cx, obj, js::BaseShape::QUALIFIED_VAROBJ);
}
// An "unqualified" varobj is the object on which "unqualified"
@@ -262,11 +255,11 @@ class JSObject : public js::gc::Cell
// generate a new shape when their prototype changes, regardless of this
// hasUncacheableProto flag.
inline bool hasUncacheableProto() const;
- bool setUncacheableProto(js::ExclusiveContext* cx) {
- MOZ_ASSERT(hasStaticPrototype(),
+ static bool setUncacheableProto(js::ExclusiveContext* cx, JS::HandleObject obj) {
+ MOZ_ASSERT(obj->hasStaticPrototype(),
"uncacheability as a concept is only applicable to static "
"(not dynamically-computed) prototypes");
- return setFlags(cx, js::BaseShape::UNCACHEABLE_PROTO, GENERATE_SHAPE);
+ return setFlags(cx, obj, js::BaseShape::UNCACHEABLE_PROTO, GENERATE_SHAPE);
}
/*
@@ -274,8 +267,8 @@ class JSObject : public js::gc::Cell
* PropertyTree::MAX_HEIGHT.
*/
inline bool hadElementsAccess() const;
- bool setHadElementsAccess(js::ExclusiveContext* cx) {
- return setFlags(cx, js::BaseShape::HAD_ELEMENTS_ACCESS);
+ static bool setHadElementsAccess(js::ExclusiveContext* cx, JS::HandleObject obj) {
+ return setFlags(cx, obj, js::BaseShape::HAD_ELEMENTS_ACCESS);
}
/*
@@ -288,7 +281,8 @@ class JSObject : public js::gc::Cell
* If this object was instantiated with `new Ctor`, return the constructor's
* display atom. Otherwise, return nullptr.
*/
- bool constructorDisplayAtom(JSContext* cx, js::MutableHandleAtom name);
+ static bool constructorDisplayAtom(JSContext* cx, js::HandleObject obj,
+ js::MutableHandleAtom name);
/*
* The same as constructorDisplayAtom above, however if this object has a
@@ -348,7 +342,7 @@ class JSObject : public js::gc::Cell
// Change an existing object to have a singleton group.
static bool changeToSingleton(JSContext* cx, js::HandleObject obj);
- inline js::ObjectGroup* getGroup(JSContext* cx);
+ static inline js::ObjectGroup* getGroup(JSContext* cx, js::HandleObject obj);
const js::GCPtrObjectGroup& groupFromGC() const {
/* Direct field access for use by GC. */
@@ -420,8 +414,8 @@ class JSObject : public js::gc::Cell
* is purged on GC.
*/
inline bool isIteratedSingleton() const;
- bool setIteratedSingleton(js::ExclusiveContext* cx) {
- return setFlags(cx, js::BaseShape::ITERATED_SINGLETON);
+ static bool setIteratedSingleton(js::ExclusiveContext* cx, JS::HandleObject obj) {
+ return setFlags(cx, obj, js::BaseShape::ITERATED_SINGLETON);
}
/*
@@ -433,18 +427,19 @@ class JSObject : public js::gc::Cell
// Mark an object as having its 'new' script information cleared.
inline bool wasNewScriptCleared() const;
- bool setNewScriptCleared(js::ExclusiveContext* cx) {
- return setFlags(cx, js::BaseShape::NEW_SCRIPT_CLEARED);
+ static bool setNewScriptCleared(js::ExclusiveContext* cx, JS::HandleObject obj) {
+ return setFlags(cx, obj, js::BaseShape::NEW_SCRIPT_CLEARED);
}
/* Set a new prototype for an object with a singleton type. */
- bool splicePrototype(JSContext* cx, const js::Class* clasp, js::Handle<js::TaggedProto> proto);
+ static bool splicePrototype(JSContext* cx, js::HandleObject obj, const js::Class* clasp,
+ js::Handle<js::TaggedProto> proto);
/*
* For bootstrapping, whether to splice a prototype for Function.prototype
* or the global object.
*/
- bool shouldSplicePrototype(JSContext* cx);
+ bool shouldSplicePrototype();
/*
* Environment chains.
@@ -518,8 +513,9 @@ class JSObject : public js::gc::Cell
public:
static bool reportReadOnly(JSContext* cx, jsid id, unsigned report = JSREPORT_ERROR);
- bool reportNotConfigurable(JSContext* cx, jsid id, unsigned report = JSREPORT_ERROR);
- bool reportNotExtensible(JSContext* cx, unsigned report = JSREPORT_ERROR);
+ static bool reportNotConfigurable(JSContext* cx, jsid id, unsigned report = JSREPORT_ERROR);
+ static bool reportNotExtensible(JSContext* cx, js::HandleObject obj,
+ unsigned report = JSREPORT_ERROR);
static bool nonNativeSetProperty(JSContext* cx, js::HandleObject obj, js::HandleId id,
js::HandleValue v, js::HandleValue receiver,
@@ -1029,21 +1025,6 @@ extern bool
DefineFunctions(JSContext* cx, HandleObject obj, const JSFunctionSpec* fs,
DefineAsIntrinsic intrinsic);
-/*
- * Set a watchpoint: a synchronous callback when the given property of the
- * given object is set.
- *
- * Watchpoints are nonstandard and do not fit in well with the way ES6
- * specifies [[Set]]. They are also insufficient for implementing
- * Object.observe.
- */
-extern bool
-WatchProperty(JSContext* cx, HandleObject obj, HandleId id, HandleObject callable);
-
-/* Clear a watchpoint. */
-extern bool
-UnwatchProperty(JSContext* cx, HandleObject obj, HandleId id);
-
/* ES6 draft rev 36 (2015 March 17) 7.1.1 ToPrimitive(vp[, preferredType]) */
extern bool
ToPrimitiveSlow(JSContext* cx, JSType hint, MutableHandleValue vp);