Bug 1498320 - Compute script start position after creating the script proper, in BC::compileScript. r=tcampbell
authorJeff Walden <jwalden@mit.edu>
Thu, 11 Oct 2018 13:54:42 -0700
changeset 445944 e6b6326c593d9a8c1095b2c872056df7f8ff088f
parent 445943 15d7f3fb96d5337164049be2fbd49bac97a04f8a
child 445945 2052c58dfe9835eb4451a1cc02ff9b566419e2e2
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 - Compute script start position after creating the script proper, in BC::compileScript. r=tcampbell
js/src/frontend/BytecodeCompiler.cpp
--- a/js/src/frontend/BytecodeCompiler.cpp
+++ b/js/src/frontend/BytecodeCompiler.cpp
@@ -324,22 +324,22 @@ BytecodeCompiler::deoptimizeArgumentsInE
 
 JSScript*
 BytecodeCompiler::compileScript(HandleObject environment, SharedContext* sc)
 {
     if (!createSourceAndParser(ParseGoal::Script)) {
         return nullptr;
     }
 
-    TokenStreamPosition startPosition(keepAtoms, parser->tokenStream);
-
     if (!createScript()) {
         return nullptr;
     }
 
+    TokenStreamPosition startPosition(keepAtoms, parser->tokenStream);
+
     Maybe<BytecodeEmitter> emitter;
     if (!emplaceEmitter(emitter, sc)) {
         return nullptr;
     }
 
     for (;;) {
         ParseNode* pn;
         {