Bug 1225298 - Use GCHashSet for SavedStack set of frames, r=terrence
authorSteve Fink <sfink@mozilla.com>
Thu, 19 Nov 2015 11:20:44 -0800
changeset 309218 4cedcf1506cba07d3c72a3843f25b2c1c29eb1cf
parent 309217 caec8d45e0e85e58c9dbec964407bca292fbeedf
child 309219 d38ecc7f68f3fd401e75321d66ac601eccebf127
push id5513
push userraliiev@mozilla.com
push dateMon, 25 Jan 2016 13:55:34 +0000
treeherdermozilla-beta@5ee97dd05b5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersterrence
bugs1225298
milestone45.0a1
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
Bug 1225298 - Use GCHashSet for SavedStack set of frames, r=terrence
js/src/vm/SavedFrame.h
js/src/vm/SavedStacks.cpp
--- a/js/src/vm/SavedFrame.h
+++ b/js/src/vm/SavedFrame.h
@@ -4,16 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef vm_SavedFrame_h
 #define vm_SavedFrame_h
 
 #include "jswrapper.h"
 
+#include "js/GCHashTable.h"
 #include "js/UbiNode.h"
 
 namespace js {
 
 class SavedFrame : public NativeObject {
     friend class SavedStacks;
     friend struct ::JSStructuredCloneReader;
 
@@ -128,19 +129,19 @@ class SavedFrame : public NativeObject {
         if (!unwrapped)
             return false;
         return isSavedFrameAndNotProto(*unwrapped);
     }
 
     struct Lookup;
     struct HashPolicy;
 
-    typedef HashSet<js::ReadBarriered<SavedFrame*>,
-                    HashPolicy,
-                    SystemAllocPolicy> Set;
+    typedef GCHashSet<js::ReadBarriered<SavedFrame*>,
+                      HashPolicy,
+                      SystemAllocPolicy> Set;
 
     class AutoLookupVector;
 
     class MOZ_STACK_CLASS HandleLookup {
         friend class AutoLookupVector;
 
         Lookup& lookup;
 
--- a/js/src/vm/SavedStacks.cpp
+++ b/js/src/vm/SavedStacks.cpp
@@ -1030,23 +1030,17 @@ SavedStacks::copyAsyncStack(JSContext* c
     RootedSavedFrame frame(cx, &asyncStackObj->as<js::SavedFrame>());
 
     return adoptAsyncStack(cx, frame, asyncCause, adoptedStack, maxFrameCount);
 }
 
 void
 SavedStacks::sweep(JSRuntime* rt)
 {
-    if (frames.initialized()) {
-        for (SavedFrame::Set::Enum e(frames); !e.empty(); e.popFront()) {
-            if (IsAboutToBeFinalized(&e.mutableFront()))
-                e.removeFront();
-        }
-    }
-
+    frames.sweep();
     sweepPCLocationMap();
 }
 
 void
 SavedStacks::trace(JSTracer* trc)
 {
     if (pcLocationMap.initialized()) {
         // Mark each of the source strings in our pc to location cache.