зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1528837 - Part 1: Rename {ParserBase,SharedContext}::context field to cx_. r=Yoric
Differential Revision: https://phabricator.services.mozilla.com/D20211 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
7ac585a93e
Коммит
a89251e758
|
@ -93,7 +93,7 @@ BytecodeEmitter::BytecodeEmitter(BytecodeEmitter* parent, SharedContext* sc,
|
|||
Handle<LazyScript*> lazyScript,
|
||||
uint32_t lineNum, EmitterMode emitterMode)
|
||||
: sc(sc),
|
||||
cx(sc->context),
|
||||
cx(sc->cx_),
|
||||
parent(parent),
|
||||
script(cx, script),
|
||||
lazyScript(cx, lazyScript),
|
||||
|
|
|
@ -41,8 +41,8 @@ inline ParseContext::Scope::BindingIter ParseContext::Scope::bindings(
|
|||
|
||||
inline ParseContext::Scope::Scope(ParserBase* parser)
|
||||
: Nestable<Scope>(&parser->pc->innermostScope_),
|
||||
declared_(parser->context->frontendCollectionPool()),
|
||||
possibleAnnexBFunctionBoxes_(parser->context->frontendCollectionPool()),
|
||||
declared_(parser->cx_->frontendCollectionPool()),
|
||||
possibleAnnexBFunctionBoxes_(parser->cx_->frontendCollectionPool()),
|
||||
id_(parser->usedNames.nextScopeId()) {}
|
||||
|
||||
inline ParseContext::Scope::Scope(JSContext* cx, ParseContext* pc,
|
||||
|
|
|
@ -100,7 +100,7 @@ void UsedNameTracker::rewind(RewindToken token) {
|
|||
}
|
||||
|
||||
void ParseContext::Scope::dump(ParseContext* pc) {
|
||||
JSContext* cx = pc->sc()->context;
|
||||
JSContext* cx = pc->sc()->cx_;
|
||||
|
||||
fprintf(stdout, "ParseScope %p", this);
|
||||
|
||||
|
@ -121,7 +121,7 @@ void ParseContext::Scope::dump(ParseContext* pc) {
|
|||
bool ParseContext::Scope::addPossibleAnnexBFunctionBox(ParseContext* pc,
|
||||
FunctionBox* funbox) {
|
||||
if (!possibleAnnexBFunctionBoxes_) {
|
||||
if (!possibleAnnexBFunctionBoxes_.acquire(pc->sc()->context)) {
|
||||
if (!possibleAnnexBFunctionBoxes_.acquire(pc->sc()->cx_)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -140,7 +140,7 @@ bool ParseContext::Scope::propagateAndMarkAnnexBFunctionBoxes(
|
|||
if (this == &pc->varScope()) {
|
||||
// Base case: actually declare the Annex B vars and mark applicable
|
||||
// function boxes as Annex B.
|
||||
RootedPropertyName name(pc->sc()->context);
|
||||
RootedPropertyName name(pc->sc()->cx_);
|
||||
Maybe<DeclarationKind> redeclaredKind;
|
||||
uint32_t unused;
|
||||
for (FunctionBox* funbox : *possibleAnnexBFunctionBoxes_) {
|
||||
|
@ -222,7 +222,7 @@ ParseContext::ParseContext(JSContext* cx, ParseContext*& parent,
|
|||
class UsedNameTracker& usedNames,
|
||||
Directives* newDirectives, bool isFull)
|
||||
: Nestable<ParseContext>(&parent),
|
||||
traceLog_(sc->context,
|
||||
traceLog_(sc->cx_,
|
||||
isFull ? TraceLogger_ParsingFull : TraceLogger_ParsingSyntax,
|
||||
errorReporter),
|
||||
sc_(sc),
|
||||
|
@ -253,7 +253,7 @@ bool ParseContext::init() {
|
|||
return false;
|
||||
}
|
||||
|
||||
JSContext* cx = sc()->context;
|
||||
JSContext* cx = sc()->cx_;
|
||||
|
||||
if (isFunctionBox()) {
|
||||
// Named lambdas always need a binding for their own name. If this
|
||||
|
@ -295,7 +295,7 @@ bool ParseContext::annexBAppliesToLexicalFunctionInInnermostScope(
|
|||
FunctionBox* funbox) {
|
||||
MOZ_ASSERT(!sc()->strict());
|
||||
|
||||
RootedPropertyName name(sc()->context,
|
||||
RootedPropertyName name(sc()->cx_,
|
||||
funbox->function()->explicitName()->asPropertyName());
|
||||
Maybe<DeclarationKind> redeclaredKind = isVarRedeclaredInInnermostScope(
|
||||
name, DeclarationKind::VarForAnnexBLexicalFunction);
|
||||
|
@ -313,7 +313,7 @@ bool ParseContext::annexBAppliesToLexicalFunctionInInnermostScope(
|
|||
if (DeclarationKindIsParameter(declaredKind)) {
|
||||
redeclaredKind = Some(declaredKind);
|
||||
} else {
|
||||
MOZ_ASSERT(FunctionScope::isSpecialName(sc()->context, name));
|
||||
MOZ_ASSERT(FunctionScope::isSpecialName(sc()->cx_, name));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -209,8 +209,7 @@ class ParseContext : public Nestable<ParseContext> {
|
|||
|
||||
public:
|
||||
LabelStatement(ParseContext* pc, JSAtom* label)
|
||||
: Statement(pc, StatementKind::Label),
|
||||
label_(pc->sc_->context, label) {}
|
||||
: Statement(pc, StatementKind::Label), label_(pc->sc_->cx_, label) {}
|
||||
|
||||
HandleAtom label() const { return label_; }
|
||||
};
|
||||
|
@ -246,7 +245,7 @@ class ParseContext : public Nestable<ParseContext> {
|
|||
|
||||
bool maybeReportOOM(ParseContext* pc, bool result) {
|
||||
if (!result) {
|
||||
ReportOutOfMemory(pc->sc()->context);
|
||||
ReportOutOfMemory(pc->sc()->cx_);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -271,7 +270,7 @@ class ParseContext : public Nestable<ParseContext> {
|
|||
return false;
|
||||
}
|
||||
|
||||
return declared_.acquire(pc->sc()->context);
|
||||
return declared_.acquire(pc->sc()->cx_);
|
||||
}
|
||||
|
||||
bool isEmpty() const { return declared_->all().empty(); }
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -201,8 +201,8 @@ class SourceParseContext : public ParseContext {
|
|||
template <typename ParseHandler, typename Unit>
|
||||
SourceParseContext(GeneralParser<ParseHandler, Unit>* prs, SharedContext* sc,
|
||||
Directives* newDirectives)
|
||||
: ParseContext(prs->context, prs->pc, sc, prs->tokenStream,
|
||||
prs->usedNames, newDirectives,
|
||||
: ParseContext(prs->cx_, prs->pc, sc, prs->tokenStream, prs->usedNames,
|
||||
newDirectives,
|
||||
mozilla::IsSame<ParseHandler, FullParseHandler>::value) {}
|
||||
};
|
||||
|
||||
|
@ -247,7 +247,7 @@ class MOZ_STACK_CLASS ParserBase : private JS::AutoGCRooter,
|
|||
JS::AutoGCRooter* parser);
|
||||
|
||||
public:
|
||||
JSContext* const context;
|
||||
JSContext* const cx_;
|
||||
|
||||
LifoAlloc& alloc;
|
||||
|
||||
|
@ -326,7 +326,7 @@ class MOZ_STACK_CLASS ParserBase : private JS::AutoGCRooter,
|
|||
public:
|
||||
// Implement ErrorReportMixin.
|
||||
|
||||
JSContext* getContext() const override { return context; }
|
||||
JSContext* getContext() const override { return cx_; }
|
||||
|
||||
bool strictMode() const override { return pc->sc()->strict(); }
|
||||
|
||||
|
@ -783,7 +783,7 @@ class MOZ_STACK_CLASS GeneralParser : public PerHandlerParser<ParseHandler> {
|
|||
|
||||
public:
|
||||
using Base::anyChars;
|
||||
using Base::context;
|
||||
using Base::cx_;
|
||||
using Base::handler;
|
||||
using Base::isValidSimpleAssignmentTarget;
|
||||
using Base::pc;
|
||||
|
@ -1453,7 +1453,7 @@ class MOZ_STACK_CLASS Parser<SyntaxParseHandler, Unit> final
|
|||
public:
|
||||
using Base::anyChars;
|
||||
using Base::clearAbortedSyntaxParse;
|
||||
using Base::context;
|
||||
using Base::cx_;
|
||||
using Base::hadAbortedSyntaxParse;
|
||||
using Base::innerFunctionForFunctionBox;
|
||||
using Base::tokenStream;
|
||||
|
@ -1641,7 +1641,7 @@ class MOZ_STACK_CLASS Parser<FullParseHandler, Unit> final
|
|||
#if DEBUG
|
||||
using Base::checkOptionsCalled;
|
||||
#endif
|
||||
using Base::context;
|
||||
using Base::cx_;
|
||||
using Base::finishFunctionScopes;
|
||||
using Base::finishLexicalScope;
|
||||
using Base::innerFunction;
|
||||
|
|
|
@ -106,7 +106,7 @@ EvalSharedContext::EvalSharedContext(JSContext* cx, JSObject* enclosingEnv,
|
|||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
bool FunctionBox::atomsAreKept() { return context->zone()->hasKeptAtoms(); }
|
||||
bool FunctionBox::atomsAreKept() { return cx_->zone()->hasKeptAtoms(); }
|
||||
#endif
|
||||
|
||||
FunctionBox::FunctionBox(JSContext* cx, TraceListNode* traceListHead,
|
||||
|
|
|
@ -97,7 +97,7 @@ class ModuleSharedContext;
|
|||
*/
|
||||
class SharedContext {
|
||||
public:
|
||||
JSContext* const context;
|
||||
JSContext* const cx_;
|
||||
|
||||
protected:
|
||||
enum class Kind : uint8_t { FunctionBox, Global, Eval, Module };
|
||||
|
@ -155,7 +155,7 @@ class SharedContext {
|
|||
public:
|
||||
SharedContext(JSContext* cx, Kind kind, Directives directives,
|
||||
bool extraWarnings)
|
||||
: context(cx),
|
||||
: cx_(cx),
|
||||
kind_(kind),
|
||||
thisBinding_(ThisBinding::Global),
|
||||
strictScript(directives.strict()),
|
||||
|
|
Загрузка…
Ссылка в новой задаче