Backed out 2 changesets (bug 1257982) for causing multiple ProtectedData.cpp asertion failures CLOSED TREE
authorCiure Andrei <aciure@mozilla.com>
Wed, 20 Mar 2019 02:00:10 +0200
changeset 465075 58f85a29cee1e7ef51a860b683fb5c93366495e8
parent 465074 732a78e6fc4fe6d6745917de00433ab4dd438899
child 465076 487ede41ade2cf105784224623ef131cebcb680a
push id112491
push useraciure@mozilla.com
push dateWed, 20 Mar 2019 00:01:00 +0000
treeherdermozilla-inbound@58f85a29cee1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1257982
milestone68.0a1
backs outa62af21dfc4b03f04bc5d2cf1237c8187959545c
0ce0c7c9a1b6fcddd54643ff05599f3b2ce1d6c7
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 2 changesets (bug 1257982) for causing multiple ProtectedData.cpp asertion failures CLOSED TREE Backed out changeset a62af21dfc4b (bug 1257982) Backed out changeset 0ce0c7c9a1b6 (bug 1257982)
js/src/frontend/ParseContext.h
js/src/vm/Debugger.cpp
js/src/vm/EnvironmentObject.cpp
mfbt/HashTable.h
--- a/js/src/frontend/ParseContext.h
+++ b/js/src/frontend/ParseContext.h
@@ -8,17 +8,16 @@
 #define frontend_ParseContext_h
 
 #include "ds/Nestable.h"
 
 #include "frontend/BytecodeCompiler.h"
 #include "frontend/ErrorReporter.h"
 #include "frontend/NameCollections.h"
 #include "frontend/SharedContext.h"
-#include "js/GCPolicyAPI.h"
 
 namespace js {
 
 namespace frontend {
 
 class ParserBase;
 
 const char* DeclarationKindString(DeclarationKind kind);
@@ -74,21 +73,16 @@ class UsedNameTracker {
 
     void resetToScope(uint32_t scriptId, uint32_t scopeId);
 
    public:
     explicit UsedNameInfo(JSContext* cx) : uses_(cx) {}
 
     UsedNameInfo(UsedNameInfo&& other) : uses_(std::move(other.uses_)) {}
 
-    UsedNameInfo& operator=(UsedNameInfo&& other) {
-      uses_ = std::move(other.uses_);
-      return *this;
-    }
-
     bool noteUsedInScope(uint32_t scriptId, uint32_t scopeId) {
       if (uses_.empty() || uses_.back().scopeId < scopeId) {
         return uses_.append(Use{scriptId, scopeId});
       }
       return true;
     }
 
     void noteBoundInScope(uint32_t scriptId, uint32_t scopeId,
@@ -106,33 +100,31 @@ class UsedNameTracker {
       }
     }
 
     bool isUsedInScript(uint32_t scriptId) const {
       return !uses_.empty() && uses_.back().scriptId >= scriptId;
     }
   };
 
-  using UsedNameMap = GCHashMap<JSAtom*, UsedNameInfo, DefaultHasher<JSAtom*>>;
+  using UsedNameMap = HashMap<JSAtom*, UsedNameInfo, DefaultHasher<JSAtom*>>;
 
  private:
-  // The map of names to chains of uses. UsedNameTracker is not used in LIFO
-  // order with Rooteds, so must use PersistentRooted (for the arbitrary
-  // ordering capability, not for persistence.)
-  PersistentRooted<UsedNameMap> map_;
+  // The map of names to chains of uses.
+  UsedNameMap map_;
 
   // Monotonically increasing id for all nested scripts.
   uint32_t scriptCounter_;
 
   // Monotonically increasing id for all nested scopes.
   uint32_t scopeCounter_;
 
  public:
   explicit UsedNameTracker(JSContext* cx)
-      : map_(cx, cx), scriptCounter_(0), scopeCounter_(0) {}
+      : map_(cx), scriptCounter_(0), scopeCounter_(0) {}
 
   uint32_t nextScriptId() {
     MOZ_ASSERT(scriptCounter_ != UINT32_MAX,
                "ParseContext::Scope::init should have prevented wraparound");
     return scriptCounter_++;
   }
 
   uint32_t nextScopeId() {
@@ -668,17 +660,9 @@ class ParseContext : public Nestable<Par
                            mozilla::Maybe<DeclarationKind>* redeclaredKind,
                            uint32_t* prevPos);
 };
 
 }  // namespace frontend
 
 }  // namespace js
 
-namespace JS {
-
-template <>
-struct GCPolicy<js::frontend::UsedNameTracker::UsedNameInfo>
-    : public IgnoreGCPolicy<js::frontend::UsedNameTracker::UsedNameInfo> {};
-
-}  // namespace JS
-
 #endif  // frontend_ParseContext_h
--- a/js/src/vm/Debugger.cpp
+++ b/js/src/vm/Debugger.cpp
@@ -4533,17 +4533,17 @@ class MOZ_STACK_CLASS Debugger::ScriptQu
       : QueryBase(cx, dbg),
         url(cx),
         displayURLString(cx),
         hasSource(false),
         source(cx, AsVariant(static_cast<ScriptSourceObject*>(nullptr))),
         hasLine(false),
         line(0),
         innermost(false),
-        innermostForRealm(cx, cx->zone()),
+        innermostForRealm(cx->zone()),
         scriptVector(cx, ScriptVector(cx)),
         lazyScriptVector(cx, LazyScriptVector(cx)),
         wasmInstanceVector(cx, WasmInstanceObjectVector(cx)) {}
 
   /*
    * Parse the query object |query|, and prepare to match only the scripts
    * it specifies.
    */
@@ -4801,24 +4801,24 @@ class MOZ_STACK_CLASS Debugger::ScriptQu
 
   /* The line matching scripts must cover. */
   unsigned int line;
 
   /* True if the query has an 'innermost' property whose value is true. */
   bool innermost;
 
   using RealmToScriptMap =
-      GCHashMap<Realm*, JSScript*, DefaultHasher<Realm*>, ZoneAllocPolicy>;
+      HashMap<Realm*, JSScript*, DefaultHasher<Realm*>, ZoneAllocPolicy>;
 
   /*
    * For 'innermost' queries, a map from realms to the innermost script
    * we've seen so far in that realm. (Template instantiation code size
    * explosion ho!)
    */
-  Rooted<RealmToScriptMap> innermostForRealm;
+  RealmToScriptMap innermostForRealm;
 
   /*
    * Accumulate the scripts in an Rooted<ScriptVector> and
    * Rooted<LazyScriptVector>, instead of creating the JS array as we go,
    * because we mustn't allocate JS objects or GC while we use the CellIter.
    */
   Rooted<ScriptVector> scriptVector;
   Rooted<LazyScriptVector> lazyScriptVector;
--- a/js/src/vm/EnvironmentObject.cpp
+++ b/js/src/vm/EnvironmentObject.cpp
@@ -3714,17 +3714,17 @@ bool js::GetFrameEnvironmentAndScope(JSC
   } else {
     scope.set(frame.script()->innermostScope(pc));
   }
   return true;
 }
 
 #ifdef DEBUG
 
-using PropertyNameSet = GCHashSet<PropertyName*>;
+typedef HashSet<PropertyName*> PropertyNameSet;
 
 static bool RemoveReferencedNames(JSContext* cx, HandleScript script,
                                   PropertyNameSet& remainingNames) {
   // Remove from remainingNames --- the closure variables in some outer
   // script --- any free variables in this script. This analysis isn't perfect:
   //
   // - It will not account for free variables in an inner script which are
   //   actually accessing some name in an intermediate script between the
@@ -3792,29 +3792,29 @@ static bool RemoveReferencedNames(JSCont
   }
 
   return true;
 }
 
 static bool AnalyzeEntrainedVariablesInScript(JSContext* cx,
                                               HandleScript script,
                                               HandleScript innerScript) {
-  Rooted<PropertyNameSet> remainingNames(cx, cx);
+  PropertyNameSet remainingNames(cx);
 
   for (BindingIter bi(script); bi; bi++) {
     if (bi.closedOver()) {
       PropertyName* name = bi.name()->asPropertyName();
       PropertyNameSet::AddPtr p = remainingNames.lookupForAdd(name);
       if (!p && !remainingNames.add(p, name)) {
         return false;
       }
     }
   }
 
-  if (!RemoveReferencedNames(cx, innerScript, remainingNames.get())) {
+  if (!RemoveReferencedNames(cx, innerScript, remainingNames)) {
     return false;
   }
 
   if (!remainingNames.empty()) {
     Sprinter buf(cx);
     if (!buf.init()) {
       return false;
     }
--- a/mfbt/HashTable.h
+++ b/mfbt/HashTable.h
@@ -403,17 +403,17 @@ class HashMap {
   using ModIterator = typename Impl::ModIterator;
   ModIterator modIter() { return mImpl.modIter(); }
 
   // These are similar to Iterator/ModIterator/iter(), but use different
   // terminology.
   using Range = typename Impl::Range;
   using Enum = typename Impl::Enum;
   Range all() const { return mImpl.all(); }
-} MOZ_INHERIT_TYPE_ANNOTATIONS_FROM_TEMPLATE_ARGS;
+};
 
 //---------------------------------------------------------------------------
 // HashSet
 //---------------------------------------------------------------------------
 
 // HashSet is a fast hash-based set of values.
 //
 // Template parameter requirements:
@@ -694,17 +694,17 @@ class HashSet {
   using ModIterator = typename Impl::ModIterator;
   ModIterator modIter() { return mImpl.modIter(); }
 
   // These are similar to Iterator/ModIterator/iter(), but use different
   // terminology.
   using Range = typename Impl::Range;
   using Enum = typename Impl::Enum;
   Range all() const { return mImpl.all(); }
-} MOZ_INHERIT_TYPE_ANNOTATIONS_FROM_TEMPLATE_ARGS;
+};
 
 //---------------------------------------------------------------------------
 // Hash Policy
 //---------------------------------------------------------------------------
 
 // A hash policy |HP| for a hash table with key-type |Key| must provide:
 //
 //  - a type |HP::Lookup| to use to lookup table entries;