Bug 1424946 - Move GeneralParser::declareFunctionArgumentsObject into a baser class. r=arai
authorJeff Walden <jwalden@mit.edu>
Tue, 12 Dec 2017 15:20:59 -0600
changeset 448158 8de7ca55eae49ddef44e76294d8758b159e46b8b
parent 448157 4daa95c889080272786d3874cf9c1a02e34688bc
child 448159 f7119db72646c44ffbdc44310597348b378e0551
push id8527
push userCallek@gmail.com
push dateThu, 11 Jan 2018 21:05:50 +0000
treeherdermozilla-beta@95342d212a7a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersarai
bugs1424946
milestone59.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 1424946 - Move GeneralParser::declareFunctionArgumentsObject into a baser class. r=arai
js/src/frontend/Parser.cpp
js/src/frontend/Parser.h
--- a/js/src/frontend/Parser.cpp
+++ b/js/src/frontend/Parser.cpp
@@ -2576,19 +2576,19 @@ Parser<FullParseHandler, CharT>::standal
     }
 
     if (!FoldConstants(context, &fn, this))
         return null();
 
     return fn;
 }
 
-template <class ParseHandler, typename CharT>
+template <class ParseHandler>
 bool
-GeneralParser<ParseHandler, CharT>::declareFunctionArgumentsObject()
+PerHandlerParser<ParseHandler>::declareFunctionArgumentsObject()
 {
     FunctionBox* funbox = pc->functionBox();
     ParseContext::Scope& funScope = pc->functionScope();
     ParseContext::Scope& varScope = pc->varScope();
 
     bool hasExtraBodyVarScope = &funScope != &varScope;
 
     // Time to implement the odd semantics of 'arguments'.
--- a/js/src/frontend/Parser.h
+++ b/js/src/frontend/Parser.h
@@ -332,16 +332,17 @@ class PerHandlerParser
     // Required on Scope exit.
     bool propagateFreeNamesAndMarkClosedOverBindings(ParseContext::Scope& scope);
 
     bool finishFunctionScopes(bool isStandaloneFunction);
     Node finishLexicalScope(ParseContext::Scope& scope, Node body);
     bool finishFunction(bool isStandaloneFunction = false);
 
     bool declareFunctionThis();
+    bool declareFunctionArgumentsObject();
 
     inline Node newName(PropertyName* name);
     inline Node newName(PropertyName* name, TokenPos pos);
 
     Node newInternalDotName(HandlePropertyName name);
     Node newThisName();
     Node newDotGeneratorName();
 
@@ -521,16 +522,17 @@ class GeneralParser
     using Base::context;
     using Base::handler;
     using Base::isValidSimpleAssignmentTarget;
     using Base::pc;
     using Base::usedNames;
 
   private:
     using Base::declareDotGeneratorName;
+    using Base::declareFunctionArgumentsObject;
     using Base::declareFunctionThis;
     using Base::finishFunction;
     using Base::hasUsedName;
     using Base::newDotGeneratorName;
     using Base::newInternalDotName;
     using Base::newThisName;
     using Base::noteDestructuredPositionalFormalParameter;
     using Base::noteUsedName;
@@ -1003,18 +1005,16 @@ class GeneralParser
     Node identifierReference(Handle<PropertyName*> name);
 
     bool matchLabel(YieldHandling yieldHandling, MutableHandle<PropertyName*> label);
 
     // Indicate if the next token (tokenized as Operand) is |in| or |of|.  If
     // so, consume it.
     bool matchInOrOf(bool* isForInp, bool* isForOfp);
 
-    bool declareFunctionArgumentsObject();
-
     bool leaveInnerFunction(ParseContext* outerpc);
 
   private:
     bool checkIncDecOperand(Node operand, uint32_t operandOffset);
     bool checkStrictAssignment(Node lhs);
 
     void reportMissingClosing(unsigned errorNumber, unsigned noteNumber, uint32_t openedPos);