Bug 1179063 - Cleanup: remove dead argument to Parser::parse. (r=efaust)
authorShu-yu Guo <shu@rfrn.org>
Thu, 30 Jul 2015 22:17:04 -0700
changeset 255609 ab699f666b06a1e75a7efb55a243b6746610b4f7
parent 255608 b25c64b684911e6ab59e43aee7f7af581f464440
child 255610 856f588ad29e8bd7c29b12f6d5fca4c7b125ccc4
push id14346
push usercbook@mozilla.com
push dateFri, 31 Jul 2015 12:21:03 +0000
treeherderfx-team@97c79f717d2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersefaust
bugs1179063
milestone42.0a1
Bug 1179063 - Cleanup: remove dead argument to Parser::parse. (r=efaust)
js/src/builtin/ReflectParse.cpp
js/src/frontend/Parser.cpp
js/src/frontend/Parser.h
js/src/jsapi.cpp
js/src/shell/js.cpp
--- a/js/src/builtin/ReflectParse.cpp
+++ b/js/src/builtin/ReflectParse.cpp
@@ -3779,17 +3779,17 @@ reflect_parse(JSContext* cx, uint32_t ar
     mozilla::Range<const char16_t> chars = linearChars.twoByteRange();
     Parser<FullParseHandler> parser(cx, &cx->tempLifoAlloc(), options, chars.start().get(),
                                     chars.length(), /* foldConstants = */ false, nullptr, nullptr);
     if (!parser.checkOptions())
         return false;
 
     serialize.setParser(&parser);
 
-    ParseNode* pn = parser.parse(nullptr);
+    ParseNode* pn = parser.parse();
     if (!pn)
         return false;
 
     RootedValue val(cx);
     if (!serialize.program(pn, &val)) {
         args.rval().setNull();
         return false;
     }
--- a/js/src/frontend/Parser.cpp
+++ b/js/src/frontend/Parser.cpp
@@ -681,17 +681,17 @@ MarkParser(JSTracer* trc, AutoGCRooter* 
     static_cast<Parser<FullParseHandler>*>(parser)->trace(trc);
 }
 
 /*
  * Parse a top-level JS script.
  */
 template <typename ParseHandler>
 typename ParseHandler::Node
-Parser<ParseHandler>::parse(JSObject* chain)
+Parser<ParseHandler>::parse()
 {
     MOZ_ASSERT(checkOptionsCalled);
 
     /*
      * Protect atoms from being collected by a GC activation, which might
      * - nest on this thread due to out of memory (the so-called "last ditch"
      *   GC attempted within js_NewGCThing), or
      * - run for any reason on another thread if this thread is suspended on
--- a/js/src/frontend/Parser.h
+++ b/js/src/frontend/Parser.h
@@ -451,17 +451,17 @@ class Parser : private JS::AutoGCRooter,
     friend void js::frontend::MarkParser(JSTracer* trc, JS::AutoGCRooter* parser);
 
     const char* getFilename() const { return tokenStream.getFilename(); }
     JSVersion versionNumber() const { return tokenStream.versionNumber(); }
 
     /*
      * Parse a top-level JS script.
      */
-    Node parse(JSObject* chain);
+    Node parse();
 
     /*
      * Allocate a new parsed object or function container from
      * cx->tempLifoAlloc.
      */
     ObjectBox* newObjectBox(JSObject* obj);
     FunctionBox* newFunctionBox(Node fn, JSFunction* fun, ParseContext<ParseHandler>* pc,
                                 Directives directives, GeneratorKind generatorKind);
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -4166,17 +4166,17 @@ JS_BufferIsCompilableUnit(JSContext* cx,
     // caller doesn't try to collect more buffered source.
     bool result = true;
 
     CompileOptions options(cx);
     Parser<frontend::FullParseHandler> parser(cx, &cx->tempLifoAlloc(),
                                               options, chars, length,
                                               /* foldConstants = */ true, nullptr, nullptr);
     JSErrorReporter older = JS_SetErrorReporter(cx->runtime(), nullptr);
-    if (!parser.checkOptions() || !parser.parse(obj)) {
+    if (!parser.checkOptions() || !parser.parse()) {
         // We ran into an error. If it was because we ran out of source, we
         // return false so our caller knows to try to collect more buffered
         // source.
         if (parser.isUnexpectedEOF())
             result = false;
 
         cx->clearPendingException();
     }
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -3089,17 +3089,17 @@ Parse(JSContext* cx, unsigned argc, Valu
     CompileOptions options(cx);
     options.setIntroductionType("js shell parse")
            .setFileAndLine("<string>", 1);
     Parser<FullParseHandler> parser(cx, &cx->tempLifoAlloc(), options, chars, length,
                                     /* foldConstants = */ true, nullptr, nullptr);
     if (!parser.checkOptions())
         return false;
 
-    ParseNode* pn = parser.parse(nullptr);
+    ParseNode* pn = parser.parse();
     if (!pn)
         return false;
 #ifdef DEBUG
     DumpParseTree(pn);
     fputc('\n', stderr);
 #endif
     args.rval().setUndefined();
     return true;
@@ -3136,17 +3136,17 @@ SyntaxParse(JSContext* cx, unsigned argc
 
     const char16_t* chars = stableChars.twoByteRange().start().get();
     size_t length = scriptContents->length();
     Parser<frontend::SyntaxParseHandler> parser(cx, &cx->tempLifoAlloc(),
                                                 options, chars, length, false, nullptr, nullptr);
     if (!parser.checkOptions())
         return false;
 
-    bool succeeded = parser.parse(nullptr);
+    bool succeeded = parser.parse();
     if (cx->isExceptionPending())
         return false;
 
     if (!succeeded && !parser.hadAbortedSyntaxParse()) {
         // If no exception is posted, either there was an OOM or a language
         // feature unhandled by the syntax parser was encountered.
         MOZ_ASSERT(cx->runtime()->hadOutOfMemory);
         return false;