Bug 1301301, part 2 - Add Scope as an AddToCCKind. r=smaug a=gchang
authorAndrew McCreight <continuation@gmail.com>
Fri, 23 Sep 2016 15:42:13 -0700
changeset 355901 55842eb51ab146662abf938022a1d8d97c5d2630
parent 355900 bf207c1c6ee40a198bfd2138c647b2a3bf05d70b
child 355902 6414a3001705218a78ca1a24b7ddffd689742ed3
push id6570
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:26:13 +0000
treeherdermozilla-beta@f455459b2ae5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug, gchang
bugs1301301, 1263355
milestone51.0a2
Bug 1301301, part 2 - Add Scope as an AddToCCKind. r=smaug a=gchang Bug 1263355 changed scopes from JSObjects (which are represented in the CC graph) to a new kind of GC thing. Many objects can share the same scope, so they will end up calling the scope trace method repeatedly, causing cycle collections to become much slower in some cases. MozReview-Commit-ID: CFO87zXjwgu
xpcom/base/CycleCollectedJSContext.h
--- a/xpcom/base/CycleCollectedJSContext.h
+++ b/xpcom/base/CycleCollectedJSContext.h
@@ -477,17 +477,17 @@ private:
   EnvironmentPreparer mEnvironmentPreparer;
 };
 
 void TraceScriptHolder(nsISupports* aHolder, JSTracer* aTracer);
 
 // Returns true if the JS::TraceKind is one the cycle collector cares about.
 inline bool AddToCCKind(JS::TraceKind aKind)
 {
-  return aKind == JS::TraceKind::Object || aKind == JS::TraceKind::Script;
+  return aKind == JS::TraceKind::Object || aKind == JS::TraceKind::Script || aKind == JS::TraceKind::Scope;
 }
 
 bool
 GetBuildId(JS::BuildIdCharVector* aBuildID);
 
 } // namespace mozilla
 
 #endif // mozilla_CycleCollectedJSContext_h__