diff --git a/js/src/devtools/rootAnalysis/annotations.js b/js/src/devtools/rootAnalysis/annotations.js index e1de86219a0..a99d437babd 100644 --- a/js/src/devtools/rootAnalysis/annotations.js +++ b/js/src/devtools/rootAnalysis/annotations.js @@ -63,6 +63,7 @@ var ignoreCallees = { "js::ion::MDefinition.opName" : true, // macro generated virtuals just return a constant "js::ion::LInstruction.getDef" : true, // virtual but no implementation can GC "js::ion::IonCache.kind" : true, // macro generated virtuals just return a constant + "icu_50::UObject.__deleting_dtor" : true, // destructors in ICU code can't cause GC }; function fieldCallCannotGC(csu, fullfield) @@ -133,7 +134,8 @@ function isRootedTypeName(name) { if (name == "mozilla::ErrorResult" || name == "js::frontend::TokenStream" || - name == "js::frontend::TokenStream::Position") + name == "js::frontend::TokenStream::Position" || + name == "ModuleCompiler") { return true; } diff --git a/js/src/frontend/TokenStream.h b/js/src/frontend/TokenStream.h index 8c1503a2081..3c5e2f7a85c 100644 --- a/js/src/frontend/TokenStream.h +++ b/js/src/frontend/TokenStream.h @@ -436,7 +436,7 @@ class StrictModeGetter { // // The methods seek() and tell() allow to rescan from a previous visited // location of the buffer. -class TokenStream +class MOZ_STACK_CLASS TokenStream { /* Unicode separators that are treated as line terminators, in addition to \n, \r */ enum { diff --git a/js/src/ion/AsmJS.cpp b/js/src/ion/AsmJS.cpp index bcfc585359d..4a9b863775e 100644 --- a/js/src/ion/AsmJS.cpp +++ b/js/src/ion/AsmJS.cpp @@ -894,7 +894,16 @@ typedef Vector CaseVector; // to add a new exit or reuse an existing one. The key is an ExitDescriptor // (which holds the exit pairing) and the value is an index into the // Vector stored in the AsmJSModule. -class ModuleCompiler +// +// Rooting note: ModuleCompiler is a stack class that contains unrooted +// PropertyName (JSAtom) pointers. This is safe because it cannot be +// constructed without a TokenStream reference. TokenStream is itself a stack +// class that cannot be constructed without an AutoKeepAtoms being live on the +// stack, which prevents collection of atoms. +// +// ModuleCompiler is marked as rooted in the rooting analysis. Don't add +// non-JSAtom pointers, or this will break! +class MOZ_STACK_CLASS ModuleCompiler { public: class Func