Backed out changeset 29b1d70e8032 (bug 1534430) for build bustage. CLOSED TREE
authorDorel Luca <dluca@mozilla.com>
Tue, 12 Mar 2019 04:00:31 +0200
changeset 521471 0a3a2f8340e3
parent 521470 ee1ceae66888
child 521472 662d2392cb01
push id10866
push usernerli@mozilla.com
push dateTue, 12 Mar 2019 18:59:09 +0000
treeherdermozilla-beta@445c24a51727 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1534430
milestone67.0a1
backs out29b1d70e8032
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 29b1d70e8032 (bug 1534430) for build bustage. CLOSED TREE
js/public/TraceKind.h
js/src/jit/RematerializedFrame.h
js/src/jsapi-tests/testGCGrayMarking.cpp
js/src/jsapi-tests/testGCHeapPostBarriers.cpp
js/src/vm/Scope.h
--- a/js/public/TraceKind.h
+++ b/js/public/TraceKind.h
@@ -151,32 +151,30 @@ struct MapTraceKindToRootKind {};
     static const JS::RootKind kind = JS::RootKind::name; \
   };
 JS_FOR_EACH_TRACEKIND(JS_EXPAND_DEF)
 #undef JS_EXPAND_DEF
 
 // Specify the RootKind for all types. Value and jsid map to special cases;
 // Cell pointer types we can derive directly from the TraceKind; everything else
 // should go in the Traceable list and use GCPolicy<T>::trace for tracing.
-//
-// The second, defaulted template parameter here is purely so a specialization
-// can get a soft (SFINAE) failure to fall back on this default of Traceable.
-template <typename T, typename = void>
+template <typename T>
 struct MapTypeToRootKind {
   static const JS::RootKind kind = JS::RootKind::Traceable;
 };
-// For any type for which MapTypeToTraceKind<T> exists, map that trace kind to
-// the appropriate root kind and use it for pointers to that type. For anything
-// else, the second template parameter will cause a failure and thus fall back
-// to the generic RootKind::Traceable version above.
 template <typename T>
-struct MapTypeToRootKind<T*, JS::MapTypeToTraceKind<T>> {
+struct MapTypeToRootKind<T*> {
   static const JS::RootKind kind =
       JS::MapTraceKindToRootKind<JS::MapTypeToTraceKind<T>::kind>::kind;
 };
+template <>
+struct MapTypeToRootKind<JS::Realm*> {
+  // Not a pointer to a GC cell. Use GCPolicy.
+  static const JS::RootKind kind = JS::RootKind::Traceable;
+};
 template <typename T>
 struct MapTypeToRootKind<mozilla::UniquePtr<T>> {
   static const JS::RootKind kind = JS::MapTypeToRootKind<T>::kind;
 };
 template <>
 struct MapTypeToRootKind<JS::Value> {
   static const JS::RootKind kind = JS::RootKind::Value;
 };
--- a/js/src/jit/RematerializedFrame.h
+++ b/js/src/jit/RematerializedFrame.h
@@ -199,14 +199,19 @@ class RematerializedFrame {
 };
 
 }  // namespace jit
 }  // namespace js
 
 namespace JS {
 
 template <>
+struct MapTypeToRootKind<js::jit::RematerializedFrame*> {
+  static const RootKind kind = RootKind::Traceable;
+};
+
+template <>
 struct GCPolicy<js::jit::RematerializedFrame*>
     : public NonGCPointerPolicy<js::jit::RematerializedFrame*> {};
 
 }  // namespace JS
 
 #endif  // jit_RematerializedFrame_h
--- a/js/src/jsapi-tests/testGCGrayMarking.cpp
+++ b/js/src/jsapi-tests/testGCGrayMarking.cpp
@@ -24,16 +24,21 @@ struct GCManagedObjectWeakMap : public O
 
 namespace JS {
 
 template <>
 struct DeletePolicy<js::GCManagedObjectWeakMap>
     : public js::GCManagedDeletePolicy<js::GCManagedObjectWeakMap> {};
 
 template <>
+struct MapTypeToRootKind<js::GCManagedObjectWeakMap*> {
+  static const JS::RootKind kind = JS::RootKind::Traceable;
+};
+
+template <>
 struct GCPolicy<js::GCManagedObjectWeakMap*>
     : public NonGCPointerPolicy<js::GCManagedObjectWeakMap*> {};
 
 }  // namespace JS
 
 class AutoNoAnalysisForTest {
  public:
   AutoNoAnalysisForTest() {}
--- a/js/src/jsapi-tests/testGCHeapPostBarriers.cpp
+++ b/js/src/jsapi-tests/testGCHeapPostBarriers.cpp
@@ -17,17 +17,17 @@
 
 // A heap-allocated structure containing one of our barriered pointer wrappers
 // to test.
 template <typename W>
 struct TestStruct {
   W wrapper;
 };
 
-// A specialized version for GCPtr that adds a trace() method.
+// A specialized version for GCPtr that adds a zone() method.
 template <typename T>
 struct TestStruct<js::GCPtr<T>> {
   js::GCPtr<T> wrapper;
 
   void trace(JSTracer* trc) {
     TraceNullableEdge(trc, &wrapper, "TestStruct::wrapper");
   }
 };
--- a/js/src/vm/Scope.h
+++ b/js/src/vm/Scope.h
@@ -1461,16 +1461,20 @@ namespace JS {
 template <>
 struct GCPolicy<js::ScopeKind> : public IgnoreGCPolicy<js::ScopeKind> {};
 
 template <typename T>
 struct ScopeDataGCPolicy : public NonGCPointerPolicy<T> {};
 
 #define DEFINE_SCOPE_DATA_GCPOLICY(Data)              \
   template <>                                         \
+  struct MapTypeToRootKind<Data*> {                   \
+    static const RootKind kind = RootKind::Traceable; \
+  };                                                  \
+  template <>                                         \
   struct GCPolicy<Data*> : public ScopeDataGCPolicy<Data*> {}
 
 DEFINE_SCOPE_DATA_GCPOLICY(js::LexicalScope::Data);
 DEFINE_SCOPE_DATA_GCPOLICY(js::FunctionScope::Data);
 DEFINE_SCOPE_DATA_GCPOLICY(js::VarScope::Data);
 DEFINE_SCOPE_DATA_GCPOLICY(js::GlobalScope::Data);
 DEFINE_SCOPE_DATA_GCPOLICY(js::EvalScope::Data);
 DEFINE_SCOPE_DATA_GCPOLICY(js::ModuleScope::Data);