Bug 1498320 - Define BytecodeCompiler::sourceObjectPtr() inline, closer to the top of BytecodeCompiler's definition. r=tcampbell
authorJeff Walden <jwalden@mit.edu>
Thu, 01 Nov 2018 17:34:54 -0700
changeset 445953 0db3c534950cc51af7e106971113ff718170d352
parent 445952 49b72ccc968279c7264d47b8e9b609c25ece0650
child 445954 17243a560006c6db1f9e4cc0fea57a8ae29b1dbc
push id109805
push userjwalden@mit.edu
push dateTue, 13 Nov 2018 01:51:46 +0000
treeherdermozilla-inbound@17243a560006 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstcampbell
bugs1498320
milestone65.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 1498320 - Define BytecodeCompiler::sourceObjectPtr() inline, closer to the top of BytecodeCompiler's definition. r=tcampbell
js/src/frontend/BytecodeCompiler.cpp
--- a/js/src/frontend/BytecodeCompiler.cpp
+++ b/js/src/frontend/BytecodeCompiler.cpp
@@ -64,16 +64,20 @@ class MOZ_STACK_CLASS BytecodeCompiler
 
   public:
     // Construct an object passing mandatory arguments.
     BytecodeCompiler(JSContext* cx,
                      const ReadOnlyCompileOptions& options,
                      SourceBufferHolder& sourceBuffer,
                      HandleScope enclosingScope);
 
+    ScriptSourceObject* sourceObjectPtr() const {
+        return sourceObject.get();
+    }
+
     // Call this before calling compile{Global,Eval}Script.
     MOZ_MUST_USE bool prepareScriptParse() {
         return createSourceAndParser(ParseGoal::Script) && createCompleteScript();
     }
 
     JSScript* compileGlobalScript(ScopeKind scopeKind);
     JSScript* compileEvalScript(HandleObject environment, HandleScope enclosingScope);
 
@@ -91,18 +95,16 @@ class MOZ_STACK_CLASS BytecodeCompiler
 
     // Call this before calling compileStandaloneFunction.
     CodeNode* parseStandaloneFunction(MutableHandleFunction fun, GeneratorKind generatorKind,
                                       FunctionAsyncKind asyncKind,
                                       const Maybe<uint32_t>& parameterListEnd);
 
     bool compileStandaloneFunction(CodeNode* parsedFunction, MutableHandleFunction fun);
 
-    ScriptSourceObject* sourceObjectPtr() const;
-
   private:
     void assertSourceAndParserCreated() const {
         MOZ_ASSERT(sourceObject != nullptr);
         MOZ_ASSERT(scriptSource != nullptr);
         MOZ_ASSERT(usedNames.isSome());
         MOZ_ASSERT(parser.isSome());
     }
 
@@ -554,22 +556,16 @@ BytecodeCompiler::compileStandaloneFunct
         MOZ_ASSERT(IsAsmJSModule(fun));
     }
 
     // Enqueue an off-thread source compression task after finishing parsing.
     return scriptSource->tryCompressOffThread(cx);
 }
 
 ScriptSourceObject*
-BytecodeCompiler::sourceObjectPtr() const
-{
-    return sourceObject.get();
-}
-
-ScriptSourceObject*
 frontend::CreateScriptSourceObject(JSContext* cx, const ReadOnlyCompileOptions& options,
                                    const Maybe<uint32_t>& parameterListEnd /* = Nothing() */)
 {
     ScriptSource* ss = cx->new_<ScriptSource>();
     if (!ss) {
         return nullptr;
     }
     ScriptSourceHolder ssHolder(ss);