Bug 1428863 - Remove unused chars/length arguments from the ParserBase and PerHandlerParser constructors. r=arai
authorJeff Walden <jwalden@mit.edu>
Thu, 21 Dec 2017 16:07:38 -0500
changeset 399885 2a4be20ecde238347d030c522b2e24741ce8a3d4
parent 399884 d01ca5c5f3d06aef7c40b59335302de83bfcdb62
child 399886 98378bbaf80721b363d52d77601ca8738142da71
push id33279
push useraciure@mozilla.com
push dateThu, 18 Jan 2018 21:53:37 +0000
treeherdermozilla-central@cffb3cd9dbb1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersarai
bugs1428863
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 1428863 - Remove unused chars/length arguments from the ParserBase and PerHandlerParser constructors. r=arai
js/src/frontend/Parser.cpp
js/src/frontend/Parser.h
--- a/js/src/frontend/Parser.cpp
+++ b/js/src/frontend/Parser.cpp
@@ -791,17 +791,16 @@ ParserBase::errorNoOffset(unsigned error
 
     ReportCompileError(context, Move(metadata), nullptr, JSREPORT_ERROR, errorNumber, args);
 
     va_end(args);
 }
 
 ParserBase::ParserBase(JSContext* cx, LifoAlloc& alloc,
                        const ReadOnlyCompileOptions& options,
-                       const char16_t* chars, size_t length,
                        bool foldConstants,
                        UsedNameTracker& usedNames)
   : AutoGCRooter(cx, PARSER),
     context(cx),
     alloc(alloc),
     anyChars(cx, options, thisForCtor()),
     traceListHead(nullptr),
     pc(nullptr),
@@ -843,34 +842,33 @@ ParserBase::~ParserBase()
     alloc.freeAllIfHugeAndUnused();
 
     context->frontendCollectionPool().removeActiveCompilation();
 }
 
 template <class ParseHandler>
 PerHandlerParser<ParseHandler>::PerHandlerParser(JSContext* cx, LifoAlloc& alloc,
                                                  const ReadOnlyCompileOptions& options,
-                                                 const char16_t* chars, size_t length,
                                                  bool foldConstants, UsedNameTracker& usedNames,
                                                  LazyScript* lazyOuterFunction)
-  : ParserBase(cx, alloc, options, chars, length, foldConstants, usedNames),
+  : ParserBase(cx, alloc, options, foldConstants, usedNames),
     handler(cx, alloc, lazyOuterFunction)
 {
 
 }
 
 template <class ParseHandler, typename CharT>
 GeneralParser<ParseHandler, CharT>::GeneralParser(JSContext* cx, LifoAlloc& alloc,
                                                   const ReadOnlyCompileOptions& options,
                                                   const CharT* chars, size_t length,
                                                   bool foldConstants,
                                                   UsedNameTracker& usedNames,
                                                   SyntaxParser* syntaxParser,
                                                   LazyScript* lazyOuterFunction)
-  : Base(cx, alloc, options, chars, length, foldConstants, usedNames, lazyOuterFunction),
+  : Base(cx, alloc, options, foldConstants, usedNames, lazyOuterFunction),
     tokenStream(cx, options, chars, length)
 {
     // The Mozilla specific JSOPTION_EXTRA_WARNINGS option adds extra warnings
     // which are not generated if functions are parsed lazily. Note that the
     // standard "use strict" does not inhibit lazy parsing.
     if (options.extraWarningsOption)
         disableSyntaxParser();
     else
--- a/js/src/frontend/Parser.h
+++ b/js/src/frontend/Parser.h
@@ -299,18 +299,17 @@ class ParserBase
   public:
     bool awaitIsKeyword() const {
       return awaitHandling_ != AwaitIsName;
     }
 
     template<class, typename> friend class AutoAwaitIsKeyword;
 
     ParserBase(JSContext* cx, LifoAlloc& alloc, const ReadOnlyCompileOptions& options,
-               const char16_t* chars, size_t length, bool foldConstants,
-               UsedNameTracker& usedNames);
+               bool foldConstants, UsedNameTracker& usedNames);
     ~ParserBase();
 
     bool checkOptions();
 
     void trace(JSTracer* trc);
 
     const char* getFilename() const { return anyChars.getFilename(); }
     TokenPos pos() const { return anyChars.currentToken().pos; }
@@ -464,18 +463,18 @@ class PerHandlerParser
     // template class doesn't have access to |CharT|, so we store a |void*|
     // here, then intermediate all access to this field through accessors in
     // |GeneralParser<ParseHandler, CharT>| that impose the real type on this
     // field.
     void* internalSyntaxParser_;
 
   protected:
     PerHandlerParser(JSContext* cx, LifoAlloc& alloc, const ReadOnlyCompileOptions& options,
-                     const char16_t* chars, size_t length, bool foldConstants,
-                     UsedNameTracker& usedNames, LazyScript* lazyOuterFunction);
+                     bool foldConstants, UsedNameTracker& usedNames,
+                     LazyScript* lazyOuterFunction);
 
     static Node null() { return ParseHandler::null(); }
 
     Node stringLiteral();
 
     const char* nameIsArgumentsOrEval(Node node);
 
     bool noteDestructuredPositionalFormalParameter(Node fn, Node destruct);