Bug 774607 - Remove JS_{Is,Make}SystemObject API. r=luke
authorBobby Holley <bobbyholley@gmail.com>
Thu, 23 Aug 2012 16:44:53 -0700
changeset 105284 134557d57e6e32ce80fa99e63b43e1e79b80335c
parent 105283 4ad52e488977dd381d2bf96ede2687e9b7f86363
child 105285 670c8a2695b3e729322627fb947df319b47c0a2a
push id55
push usershu@rfrn.org
push dateThu, 30 Aug 2012 01:33:09 +0000
reviewersluke
bugs774607
milestone17.0a1
Bug 774607 - Remove JS_{Is,Make}SystemObject API. r=luke
js/src/jsdbgapi.cpp
js/src/jsdbgapi.h
js/src/jsobj.cpp
js/src/jsobj.h
js/src/jsobjinlines.h
js/src/jsscope.h
--- a/js/src/jsdbgapi.cpp
+++ b/js/src/jsdbgapi.cpp
@@ -1057,28 +1057,16 @@ JS_GetScriptTotalSize(JSContext *cx, JSS
         if (principals->refcount > 1)
             pbytes = JS_HOWMANY(pbytes, principals->refcount);
         nbytes += pbytes;
     }
 
     return nbytes;
 }
 
-JS_PUBLIC_API(JSBool)
-JS_IsSystemObject(JSContext *cx, JSObject *obj)
-{
-    return obj->isSystem();
-}
-
-JS_PUBLIC_API(JSBool)
-JS_MakeSystemObject(JSContext *cx, JSObject *obj)
-{
-    return obj->setSystem(cx);
-}
-
 /************************************************************************/
 
 JS_FRIEND_API(void)
 js_RevertVersion(JSContext *cx)
 {
     cx->clearVersionOverride();
 }
 
--- a/js/src/jsdbgapi.h
+++ b/js/src/jsdbgapi.h
@@ -387,33 +387,16 @@ extern JS_PUBLIC_API(size_t)
 JS_GetObjectTotalSize(JSContext *cx, JSObject *obj);
 
 extern JS_PUBLIC_API(size_t)
 JS_GetFunctionTotalSize(JSContext *cx, JSFunction *fun);
 
 extern JS_PUBLIC_API(size_t)
 JS_GetScriptTotalSize(JSContext *cx, JSScript *script);
 
-/*
- * Return true if obj is a "system" object, that is, one created by
- * JS_NewSystemObject with the system flag set and not JS_NewObject.
- *
- * What "system" means is up to the API client.
- */
-extern JS_PUBLIC_API(JSBool)
-JS_IsSystemObject(JSContext *cx, JSObject *obj);
-
-/*
- * Mark an object as being a system object. This should be called immediately
- * after allocating the object. A system object is an object for which
- * JS_IsSystemObject returns true.
- */
-extern JS_PUBLIC_API(JSBool)
-JS_MakeSystemObject(JSContext *cx, JSObject *obj);
-
 /************************************************************************/
 
 extern JS_FRIEND_API(void)
 js_RevertVersion(JSContext *cx);
 
 extern JS_PUBLIC_API(const JSDebugHooks *)
 JS_GetGlobalDebugHooks(JSRuntime *rt);
 
--- a/js/src/jsobj.cpp
+++ b/js/src/jsobj.cpp
@@ -5651,17 +5651,16 @@ JSObject::dump()
 {
     JSObject *obj = this;
     fprintf(stderr, "object %p\n", (void *) obj);
     Class *clasp = obj->getClass();
     fprintf(stderr, "class %p %s\n", (void *)clasp, clasp->name);
 
     fprintf(stderr, "flags:");
     if (obj->isDelegate()) fprintf(stderr, " delegate");
-    if (obj->isSystem()) fprintf(stderr, " system");
     if (!obj->isExtensible()) fprintf(stderr, " not_extensible");
     if (obj->isIndexed()) fprintf(stderr, " indexed");
 
     if (obj->isNative()) {
         if (obj->inDictionaryMode())
             fprintf(stderr, " inDictionaryMode");
         if (obj->hasShapeTable())
             fprintf(stderr, " hasShapeTable");
--- a/js/src/jsobj.h
+++ b/js/src/jsobj.h
@@ -321,24 +321,16 @@ struct JSObject : public js::ObjectImpl
     /* Upper bound on the number of elements in an object. */
     static const uint32_t NELEMENTS_LIMIT = JS_BIT(28);
 
   public:
     inline bool setDelegate(JSContext *cx);
 
     inline bool isBoundFunction() const;
 
-    /*
-     * The meaning of the system object bit is defined by the API client. It is
-     * set in JS_NewSystemObject and is queried by JS_IsSystemObject, but it
-     * has no intrinsic meaning to SpiderMonkey.
-     */
-    inline bool isSystem() const;
-    inline bool setSystem(JSContext *cx);
-
     inline bool hasSpecialEquality() const;
 
     inline bool watched() const;
     inline bool setWatched(JSContext *cx);
 
     /* See StackFrame::varObj. */
     inline bool isVarObj();
     inline bool setVarObj(JSContext *cx);
--- a/js/src/jsobjinlines.h
+++ b/js/src/jsobjinlines.h
@@ -687,26 +687,16 @@ JSObject::setType(js::types::TypeObject 
     type_ = newType;
 }
 
 inline bool JSObject::setIteratedSingleton(JSContext *cx)
 {
     return setFlag(cx, js::BaseShape::ITERATED_SINGLETON);
 }
 
-inline bool JSObject::isSystem() const
-{
-    return lastProperty()->hasObjectFlag(js::BaseShape::SYSTEM);
-}
-
-inline bool JSObject::setSystem(JSContext *cx)
-{
-    return setFlag(cx, js::BaseShape::SYSTEM);
-}
-
 inline bool JSObject::setDelegate(JSContext *cx)
 {
     return setFlag(cx, js::BaseShape::DELEGATE, GENERATE_SHAPE);
 }
 
 inline bool JSObject::isVarObj()
 {
     if (isDebugScope())
--- a/js/src/jsscope.h
+++ b/js/src/jsscope.h
@@ -250,25 +250,24 @@ class BaseShape : public js::gc::Cell
 
         /*
          * Flags set which describe the referring object. Once set these cannot
          * be unset, and are transferred from shape to shape as the object's
          * last property changes.
          */
 
         DELEGATE           =    0x8,
-        SYSTEM             =   0x10,
-        NOT_EXTENSIBLE     =   0x20,
-        INDEXED            =   0x40,
-        BOUND_FUNCTION     =   0x80,
-        VAROBJ             =  0x100,
-        WATCHED            =  0x200,
-        ITERATED_SINGLETON =  0x400,
-        NEW_TYPE_UNKNOWN   =  0x800,
-        UNCACHEABLE_PROTO  = 0x1000,
+        NOT_EXTENSIBLE     =   0x10,
+        INDEXED            =   0x20,
+        BOUND_FUNCTION     =   0x40,
+        VAROBJ             =   0x80,
+        WATCHED            =  0x100,
+        ITERATED_SINGLETON =  0x200,
+        NEW_TYPE_UNKNOWN   =  0x400,
+        UNCACHEABLE_PROTO  =  0x800,
 
         OBJECT_FLAG_MASK   = 0x1ff8
     };
 
   private:
     Class               *clasp;         /* Class of referring object. */
     HeapPtrObject       parent;         /* Parent of referring object. */
     uint32_t            flags;          /* Vector of above flags. */