Bug 1515221 - remove GeneralParser::thisForCtor() r=khyperia
authoryulia <ystartsev@mozilla.com>
Mon, 24 Jun 2019 15:21:43 +0000
changeset 542990 27065077859fcd0f70f8d165071ab13894655ad9
parent 542989 9f45982e7800871078d5b707bcfcc6c12000bbc0
child 542991 115a611f83a363a24d7f84b9c67404d490e83c81
push id2131
push userffxbld-merge
push dateMon, 26 Aug 2019 18:30:20 +0000
treeherdermozilla-release@b19ffb3ca153 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhyperia
bugs1515221
milestone69.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1515221 - remove GeneralParser::thisForCtor() r=khyperia Differential Revision: https://phabricator.services.mozilla.com/D35581
js/src/frontend/Parser.cpp
js/src/frontend/Parser.h
--- a/js/src/frontend/Parser.cpp
+++ b/js/src/frontend/Parser.cpp
@@ -178,17 +178,17 @@ ParserSharedBase::~ParserSharedBase() {
 }
 
 ParserBase::ParserBase(JSContext* cx, LifoAlloc& alloc,
                        const ReadOnlyCompileOptions& options,
                        bool foldConstants, UsedNameTracker& usedNames,
                        ScriptSourceObject* sourceObject, ParseGoal parseGoal)
     : ParserSharedBase(cx, alloc, usedNames, sourceObject,
                        ParserSharedBase::Kind::Parser),
-      anyChars(cx, options, thisForCtor()),
+      anyChars(cx, options, this),
       ss(nullptr),
       foldConstants_(foldConstants),
 #ifdef DEBUG
       checkOptionsCalled_(false),
 #endif
       isUnexpectedEOF_(false),
       awaitHandling_(AwaitIsName),
       inParametersOfAsyncFunction_(false),
--- a/js/src/frontend/Parser.h
+++ b/js/src/frontend/Parser.h
@@ -289,19 +289,16 @@ class MOZ_STACK_CLASS ParserSharedBase :
   // Create a new BigInt and store it into the trace list.
   BigIntBox* newBigIntBox(BigInt* val);
 };
 
 class MOZ_STACK_CLASS ParserBase : public ParserSharedBase,
                                    public ErrorReportMixin {
   using Base = ErrorReportMixin;
 
- private:
-  ParserBase* thisForCtor() { return this; }
-
  public:
   TokenStreamAnyChars anyChars;
 
   ScriptSource* ss;
 
   // Perform constant-folding; must be true when interfacing with the emitter.
   const bool foldConstants_ : 1;
 
@@ -1032,18 +1029,16 @@ class MOZ_STACK_CLASS GeneralParser : pu
   MOZ_MUST_USE bool mustMatchToken(TokenKind expected,
                                    ErrorReportT errorReport) {
     return mustMatchTokenInternal(
         [expected](TokenKind actual) { return actual == expected; },
         errorReport);
   }
 
  private:
-  GeneralParser* thisForCtor() { return this; }
-
   NameNodeType noSubstitutionUntaggedTemplate();
   ListNodeType templateLiteral(YieldHandling yieldHandling);
   bool taggedTemplate(YieldHandling yieldHandling, ListNodeType tagArgsList,
                       TokenKind tt);
   bool appendToCallSiteObj(CallSiteNodeType callSiteObj);
   bool addExprAndGetNextTemplStrToken(YieldHandling yieldHandling,
                                       ListNodeType nodeList, TokenKind* ttp);