Backed out changeset a5c748f78e97 (bug 1188445)
authorWes Kocher <wkocher@mozilla.com>
Wed, 29 Jul 2015 16:46:19 -0700
changeset 287007 5738b6629d1451ef0cd4e708a13108d0e81302ef
parent 287006 cb821c634326bf02d05c673c6a4f614f19a9ae67
child 287008 35e191320db8d8385eec8ee768b06236a4305fb4
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1188445
milestone42.0a1
backs outa5c748f78e97f11a3354ce7142bad4a11c02fafc
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset a5c748f78e97 (bug 1188445)
js/public/RootingAPI.h
js/src/gc/RootMarking.cpp
js/src/jsapi-tests/testGCExactRooting.cpp
js/src/jsgc.cpp
--- a/js/public/RootingAPI.h
+++ b/js/public/RootingAPI.h
@@ -1016,17 +1016,16 @@ class PersistentRooted : public js::Pers
         roots.heapRoots_[kind].insertBack(reinterpret_cast<JS::PersistentRooted<void*>*>(this));
         // Until marking and destruction support the full set, we assert that
         // we don't try to add any unsupported types.
         MOZ_ASSERT(kind == js::THING_ROOT_OBJECT ||
                    kind == js::THING_ROOT_SCRIPT ||
                    kind == js::THING_ROOT_STRING ||
                    kind == js::THING_ROOT_ID ||
                    kind == js::THING_ROOT_VALUE ||
-                   kind == js::THING_ROOT_STATIC_TRACEABLE ||
                    kind == js::THING_ROOT_DYNAMIC_TRACEABLE);
     }
 
   public:
     PersistentRooted() : ptr(js::GCMethods<T>::initial()) {}
 
     template <typename RootingContext>
     explicit PersistentRooted(const RootingContext& cx)
@@ -1097,23 +1096,17 @@ class PersistentRooted : public js::Pers
     }
 
   private:
     void set(T value) {
         MOZ_ASSERT(initialized());
         ptr = value;
     }
 
-    // See the comment above Rooted::ptr.
-    using MaybeWrapped = typename mozilla::Conditional<
-        mozilla::IsBaseOf<StaticTraceable, T>::value,
-        js::DispatchWrapper<T>,
-        T>::Type;
-
-    MaybeWrapped ptr;
+    T ptr;
 };
 
 class JS_PUBLIC_API(ObjectPtr)
 {
     Heap<JSObject*> value;
 
   public:
     ObjectPtr() : value(nullptr) {}
--- a/js/src/gc/RootMarking.cpp
+++ b/js/src/gc/RootMarking.cpp
@@ -328,25 +328,20 @@ js::gc::MarkPersistentRootedChainsInList
     PersistentRootedMarker<JSString*>::markChain(trc, roots.getPersistentRootedList<JSString*>(),
                                                  "PersistentRooted<JSString*>");
 
     PersistentRootedMarker<jsid>::markChain(trc, roots.getPersistentRootedList<jsid>(),
                                             "PersistentRooted<jsid>");
     PersistentRootedMarker<Value>::markChain(trc, roots.getPersistentRootedList<Value>(),
                                              "PersistentRooted<Value>");
 
-    PersistentRootedMarker<JS::StaticTraceable>::markChain<
-        js::DispatchWrapper<JS::StaticTraceable>::TraceWrapped>(trc,
-            reinterpret_cast<mozilla::LinkedList<JS::PersistentRooted<JS::StaticTraceable>>&>(
-                roots.heapRoots_[THING_ROOT_STATIC_TRACEABLE]),
-            "PersistentRooted<StaticTraceable>");
     PersistentRootedMarker<ConcreteTraceable>::markChain<MarkDynamicTraceable>(trc,
         reinterpret_cast<mozilla::LinkedList<JS::PersistentRooted<ConcreteTraceable>>&>(
             roots.heapRoots_[THING_ROOT_DYNAMIC_TRACEABLE]),
-        "PersistentRooted<DynamicTraceable>");
+        "PersistentRooted<Value>");
 }
 
 void
 js::gc::MarkPersistentRootedChains(JSTracer* trc)
 {
     for (ContextIter cx(trc->runtime()); !cx.done(); cx.next())
         MarkPersistentRootedChainsInLists(cx->roots, trc);
     MarkPersistentRootedChainsInLists(trc->runtime()->mainThread.roots, trc);
--- a/js/src/jsapi-tests/testGCExactRooting.cpp
+++ b/js/src/jsapi-tests/testGCExactRooting.cpp
@@ -55,25 +55,16 @@ struct MyContainer : public JS::StaticTr
 };
 
 namespace js {
 template <>
 struct RootedBase<MyContainer> {
     RelocatablePtrObject& obj() { return static_cast<Rooted<MyContainer>*>(this)->get().obj; }
     RelocatablePtrString& str() { return static_cast<Rooted<MyContainer>*>(this)->get().str; }
 };
-template <>
-struct PersistentRootedBase<MyContainer> {
-    RelocatablePtrObject& obj() {
-        return static_cast<PersistentRooted<MyContainer>*>(this)->get().obj;
-    }
-    RelocatablePtrString& str() {
-        return static_cast<PersistentRooted<MyContainer>*>(this)->get().str;
-    }
-};
 } // namespace js
 
 BEGIN_TEST(testGCRootedStaticStructInternalStackStorage)
 {
     JS::Rooted<MyContainer> container(cx);
     container.get().obj = JS_NewObject(cx, nullptr);
     container.get().str = JS_NewStringCopyZ(cx, "Hello");
 
@@ -94,50 +85,16 @@ BEGIN_TEST(testGCRootedStaticStructInter
     container.str() = JS_NewStringCopyZ(cx, "Hello");
 
     JS_GC(cx->runtime());
     JS_GC(cx->runtime());
 
     JS::RootedObject obj(cx, container.obj());
     JS::RootedValue val(cx, StringValue(container.str()));
     CHECK(JS_SetProperty(cx, obj, "foo", val));
-    obj = nullptr;
-    val = UndefinedValue();
-
-    {
-        JS::RootedString actual(cx);
-        bool same;
-
-        // Automatic move from stack to heap.
-        JS::PersistentRooted<MyContainer> heap(cx, container);
-
-        // clear prior rooting.
-        container.obj() = nullptr;
-        container.str() = nullptr;
-
-        obj = heap.obj();
-        CHECK(JS_GetProperty(cx, obj, "foo", &val));
-        actual = val.toString();
-        CHECK(JS_StringEqualsAscii(cx, actual, "Hello", &same));
-        CHECK(same);
-        obj = nullptr;
-        actual = nullptr;
-
-        JS_GC(cx->runtime());
-        JS_GC(cx->runtime());
-
-        obj = heap.obj();
-        CHECK(JS_GetProperty(cx, obj, "foo", &val));
-        actual = val.toString();
-        CHECK(JS_StringEqualsAscii(cx, actual, "Hello", &same));
-        CHECK(same);
-        obj = nullptr;
-        actual = nullptr;
-    }
-
     return true;
 }
 END_TEST(testGCRootedStaticStructInternalStackStorageAugmented)
 
 struct DynamicBase : public JS::DynamicTraceable
 {
     RelocatablePtrObject obj;
     DynamicBase() : obj(nullptr) {}
--- a/js/src/jsgc.cpp
+++ b/js/src/jsgc.cpp
@@ -1366,17 +1366,16 @@ FinishPersistentRootedChain(mozilla::Lin
 void
 js::gc::FinishPersistentRootedChains(RootLists& roots)
 {
     FinishPersistentRootedChain(roots.getPersistentRootedList<JSObject*>());
     FinishPersistentRootedChain(roots.getPersistentRootedList<JSScript*>());
     FinishPersistentRootedChain(roots.getPersistentRootedList<JSString*>());
     FinishPersistentRootedChain(roots.getPersistentRootedList<jsid>());
     FinishPersistentRootedChain(roots.getPersistentRootedList<Value>());
-    FinishPersistentRootedChain(roots.heapRoots_[THING_ROOT_STATIC_TRACEABLE]);
     FinishPersistentRootedChain(roots.heapRoots_[THING_ROOT_DYNAMIC_TRACEABLE]);
 }
 
 void
 GCRuntime::finishRoots()
 {
     if (rootsHash.initialized())
         rootsHash.clear();