зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1534516 - Use correct AutoGCRooter::Tag in BinASTParserBase. r=Yoric
Differential Revision: https://phabricator.services.mozilla.com/D23083 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
1c0b93ac67
Коммит
c92d5c4af5
|
@ -911,7 +911,7 @@ class JS_PUBLIC_API AutoGCRooter {
|
|||
ValueArray, /* js::AutoValueArray */
|
||||
Parser, /* js::frontend::Parser */
|
||||
#if defined(JS_BUILD_BINAST)
|
||||
BinParser, /* js::frontend::BinSource */
|
||||
BinASTParser, /* js::frontend::BinASTParser */
|
||||
#endif // defined(JS_BUILD_BINAST)
|
||||
WrapperVector, /* js::AutoWrapperVector */
|
||||
Wrapper, /* js::AutoWrapperRooter */
|
||||
|
|
|
@ -14,7 +14,8 @@ namespace frontend {
|
|||
BinASTParserBase::BinASTParserBase(JSContext* cx, LifoAlloc& alloc,
|
||||
UsedNameTracker& usedNames,
|
||||
HandleScriptSourceObject sourceObject)
|
||||
: ParserSharedBase(cx, alloc, usedNames, sourceObject) {}
|
||||
: ParserSharedBase(cx, alloc, usedNames, sourceObject,
|
||||
ParserSharedBase::Kind::BinASTParser) {}
|
||||
|
||||
} // namespace frontend
|
||||
} // namespace js
|
||||
|
|
|
@ -769,7 +769,7 @@ bool BinASTParserPerTokenizer<Tok>::computeErrorMetadata(
|
|||
return true;
|
||||
}
|
||||
|
||||
void TraceBinParser(JSTracer* trc, JS::AutoGCRooter* parser) {
|
||||
void TraceBinASTParser(JSTracer* trc, JS::AutoGCRooter* parser) {
|
||||
static_cast<BinASTParserBase*>(parser)->trace(trc);
|
||||
}
|
||||
|
||||
|
|
|
@ -323,7 +323,7 @@ class BinParseContext : public ParseContext {
|
|||
newDirectives, /* isFull = */ true) {}
|
||||
};
|
||||
|
||||
void TraceBinParser(JSTracer* trc, JS::AutoGCRooter* parser);
|
||||
void TraceBinASTParser(JSTracer* trc, JS::AutoGCRooter* parser);
|
||||
|
||||
extern template class BinASTParserPerTokenizer<BinTokenReaderMultipart>;
|
||||
|
||||
|
|
|
@ -198,7 +198,7 @@ void TraceParser(JSTracer* trc, JS::AutoGCRooter* parser);
|
|||
|
||||
/* Trace all GC things reachable from binjs parser. Defined in
|
||||
* BinASTParserPerTokenizer.cpp. */
|
||||
void TraceBinParser(JSTracer* trc, JS::AutoGCRooter* parser);
|
||||
void TraceBinASTParser(JSTracer* trc, JS::AutoGCRooter* parser);
|
||||
|
||||
#endif // defined(JS_BUILD_BINAST)
|
||||
|
||||
|
|
|
@ -137,8 +137,10 @@ bool GeneralParser<ParseHandler, Unit>::mustMatchTokenInternal(
|
|||
|
||||
ParserSharedBase::ParserSharedBase(JSContext* cx, LifoAlloc& alloc,
|
||||
UsedNameTracker& usedNames,
|
||||
ScriptSourceObject* sourceObject)
|
||||
: JS::AutoGCRooter(cx, AutoGCRooter::Tag::Parser),
|
||||
ScriptSourceObject* sourceObject, Kind kind)
|
||||
: JS::AutoGCRooter(cx, kind == Kind::Parser
|
||||
? JS::AutoGCRooter::Tag::Parser
|
||||
: JS::AutoGCRooter::Tag::BinASTParser),
|
||||
cx_(cx),
|
||||
alloc_(alloc),
|
||||
traceListHead_(nullptr),
|
||||
|
@ -167,7 +169,8 @@ ParserBase::ParserBase(JSContext* cx, LifoAlloc& alloc,
|
|||
const ReadOnlyCompileOptions& options,
|
||||
bool foldConstants, UsedNameTracker& usedNames,
|
||||
ScriptSourceObject* sourceObject, ParseGoal parseGoal)
|
||||
: ParserSharedBase(cx, alloc, usedNames, sourceObject),
|
||||
: ParserSharedBase(cx, alloc, usedNames, sourceObject,
|
||||
ParserSharedBase::Kind::Parser),
|
||||
anyChars(cx, options, thisForCtor()),
|
||||
ss(nullptr),
|
||||
foldConstants_(foldConstants),
|
||||
|
|
|
@ -240,8 +240,10 @@ class AutoInParametersOfAsyncFunction;
|
|||
|
||||
class MOZ_STACK_CLASS ParserSharedBase : private JS::AutoGCRooter {
|
||||
public:
|
||||
enum class Kind { Parser, BinASTParser };
|
||||
|
||||
ParserSharedBase(JSContext* cx, LifoAlloc& alloc, UsedNameTracker& usedNames,
|
||||
ScriptSourceObject* sourceObject);
|
||||
ScriptSourceObject* sourceObject, Kind kind);
|
||||
~ParserSharedBase();
|
||||
|
||||
public:
|
||||
|
@ -271,8 +273,8 @@ class MOZ_STACK_CLASS ParserSharedBase : private JS::AutoGCRooter {
|
|||
JS::AutoGCRooter* parser);
|
||||
|
||||
#if defined(JS_BUILD_BINAST)
|
||||
friend void js::frontend::TraceBinParser(JSTracer* trc,
|
||||
JS::AutoGCRooter* parser);
|
||||
friend void js::frontend::TraceBinASTParser(JSTracer* trc,
|
||||
JS::AutoGCRooter* parser);
|
||||
#endif // JS_BUILD_BINAST
|
||||
|
||||
private:
|
||||
|
|
|
@ -159,8 +159,8 @@ inline void AutoGCRooter::trace(JSTracer* trc) {
|
|||
return;
|
||||
|
||||
#if defined(JS_BUILD_BINAST)
|
||||
case Tag::BinParser:
|
||||
frontend::TraceBinParser(trc, this);
|
||||
case Tag::BinASTParser:
|
||||
frontend::TraceBinASTParser(trc, this);
|
||||
return;
|
||||
#endif // defined(JS_BUILD_BINAST)
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче