Bug 641170 - Remove vestiges of AutoIdRooter. r=terrence
authorChris Peterson <cpeterson@mozilla.com>
Wed, 30 Apr 2014 20:01:30 -0700
changeset 181711 5c399b6e1368151e4c0b626d693d8e2f21beb38b
parent 181710 0b0ef55acde375686be7c76e671ed32173591b00
child 181712 2df94d46bc5ab57278be1f06d371ec2122326d15
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewersterrence
bugs641170
milestone32.0a1
Bug 641170 - Remove vestiges of AutoIdRooter. r=terrence
js/src/gc/RootMarking.cpp
js/src/jsapi.h
--- a/js/src/gc/RootMarking.cpp
+++ b/js/src/gc/RootMarking.cpp
@@ -397,20 +397,16 @@ AutoGCRooter::trace(JSTracer *trc)
             MarkValueRoot(trc, &desc.pd_, "PropDesc::pd_");
             MarkValueRoot(trc, &desc.value_, "PropDesc::value_");
             MarkValueRoot(trc, &desc.get_, "PropDesc::get_");
             MarkValueRoot(trc, &desc.set_, "PropDesc::set_");
         }
         return;
       }
 
-      case ID:
-        MarkIdRoot(trc, &static_cast<AutoIdRooter *>(this)->id_, "JS::AutoIdRooter.id_");
-        return;
-
       case VALVECTOR: {
         AutoValueVector::VectorImpl &vector = static_cast<AutoValueVector *>(this)->vector;
         MarkValueRootRange(trc, vector.length(), vector.begin(), "js::AutoValueVector.vector");
         return;
       }
 
       case IDVECTOR: {
         AutoIdVector::VectorImpl &vector = static_cast<AutoIdVector *>(this)->vector;
--- a/js/src/jsapi.h
+++ b/js/src/jsapi.h
@@ -102,17 +102,16 @@ class JS_PUBLIC_API(AutoGCRooter) {
     ptrdiff_t tag_;
 
     enum {
         VALARRAY =     -2, /* js::AutoValueArray */
         PARSER =       -3, /* js::frontend::Parser */
         SHAPEVECTOR =  -4, /* js::AutoShapeVector */
         IDARRAY =      -6, /* js::AutoIdArray */
         DESCRIPTORS =  -7, /* js::AutoPropDescArrayRooter */
-        ID =           -9, /* js::AutoIdRooter */
         VALVECTOR =   -10, /* js::AutoValueVector */
         IDVECTOR =    -13, /* js::AutoIdVector */
         OBJVECTOR =   -14, /* js::AutoObjectVector */
         STRINGVECTOR =-15, /* js::AutoStringVector */
         SCRIPTVECTOR =-16, /* js::AutoScriptVector */
         NAMEVECTOR =  -17, /* js::AutoNameVector */
         HASHABLEVALUE=-18, /* js::HashableValue */
         IONMASM =     -19, /* js::jit::MacroAssembler */
@@ -834,41 +833,16 @@ JS_StringHasBeenInterned(JSContext *cx, 
  * N.B. if a jsid is backed by a string which has not been interned, that
  * string must be appropriately rooted to avoid being collected by the GC.
  */
 JS_PUBLIC_API(jsid)
 INTERNED_STRING_TO_JSID(JSContext *cx, JSString *str);
 
 namespace JS {
 
-class AutoIdRooter : private AutoGCRooter
-{
-  public:
-    explicit AutoIdRooter(JSContext *cx, jsid aId = INT_TO_JSID(0)
-                          MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
-      : AutoGCRooter(cx, ID), id_(aId)
-    {
-        MOZ_GUARD_OBJECT_NOTIFIER_INIT;
-    }
-
-    jsid id() {
-        return id_;
-    }
-
-    jsid * addr() {
-        return &id_;
-    }
-
-    friend void AutoGCRooter::trace(JSTracer *trc);
-
-  private:
-    jsid id_;
-    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
-};
-
 // Container class for passing in script source buffers to the JS engine.  This
 // not only groups the buffer and length values, it also provides a way to
 // optionally pass ownership of the buffer to the JS engine without copying.
 // Rules for use:
 //
 //  1) The data array must be allocated with js_malloc() or js_realloc() if
 //     ownership is being granted to the SourceBufferHolder.
 //  2) If ownership is not given to the SourceBufferHolder, then the memory