@@ -137,8 +137,10 @@ bool GeneralParser<ParseHandler, Unit>::mustMatchTokenInternal(
137137
138138ParserSharedBase::ParserSharedBase (JSContext* cx, LifoAlloc& alloc,
139139 UsedNameTracker& usedNames,
140- ScriptSourceObject* sourceObject)
141- : JS ::AutoGCRooter(cx, AutoGCRooter::Tag::Parser),
140+ ScriptSourceObject* sourceObject, Kind kind)
141+ : JS ::AutoGCRooter(cx, kind == Kind::Parser
142+ ? JS ::AutoGCRooter::Tag::Parser
143+ : JS ::AutoGCRooter::Tag::BinASTParser),
142144 cx_ (cx),
143145 alloc_(alloc),
144146 traceListHead_(nullptr ),
@@ -167,7 +169,8 @@ ParserBase::ParserBase(JSContext* cx, LifoAlloc& alloc,
167169 const ReadOnlyCompileOptions& options,
168170 bool foldConstants, UsedNameTracker& usedNames,
169171 ScriptSourceObject* sourceObject, ParseGoal parseGoal)
170- : ParserSharedBase(cx, alloc, usedNames, sourceObject),
172+ : ParserSharedBase(cx, alloc, usedNames, sourceObject,
173+ ParserSharedBase::Kind::Parser),
171174 anyChars (cx, options, thisForCtor()),
172175 ss(nullptr ),
173176 foldConstants_(foldConstants),
0 commit comments