Bug 1522075 part 2 - Move prepareVMCall calls into lambdas because prepareVMCall and callVM have to be balanced. r=djvj
authorJan de Mooij <jdemooij@mozilla.com>
Thu, 24 Jan 2019 17:35:47 +0000
changeset 515315 59e188c6e83500abb433777237af9ba231901445
parent 515314 a2e14bfdfb0076b2bc425689873e36d5d3987ec2
child 515316 eff43158adb80f26363c448b52f5d37dbfae7575
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdjvj
bugs1522075
milestone66.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 1522075 part 2 - Move prepareVMCall calls into lambdas because prepareVMCall and callVM have to be balanced. r=djvj This fixes some assertion failures when generating the interpreter. Differential Revision: https://phabricator.services.mozilla.com/D17366
js/src/jit/BaselineCompiler.cpp
--- a/js/src/jit/BaselineCompiler.cpp
+++ b/js/src/jit/BaselineCompiler.cpp
@@ -4052,26 +4052,28 @@ static const VMFunction PopLexicalEnvInf
 typedef bool (*DebugLeaveThenPopLexicalEnvFn)(JSContext*, BaselineFrame*,
                                               jsbytecode*);
 static const VMFunction DebugLeaveThenPopLexicalEnvInfo =
     FunctionInfo<DebugLeaveThenPopLexicalEnvFn>(
         jit::DebugLeaveThenPopLexicalEnv, "DebugLeaveThenPopLexicalEnv");
 
 template <typename Handler>
 bool BaselineCodeGen<Handler>::emit_JSOP_POPLEXICALENV() {
-  prepareVMCall();
+  frame.syncStack(0);
 
   masm.loadBaselineFramePtr(BaselineFrameReg, R0.scratchReg());
 
   auto ifDebuggee = [this]() {
+    prepareVMCall();
     pushBytecodePCArg();
     pushArg(R0.scratchReg());
     return callVM(DebugLeaveThenPopLexicalEnvInfo);
   };
   auto ifNotDebuggee = [this]() {
+    prepareVMCall();
     pushArg(R0.scratchReg());
     return callVM(PopLexicalEnvInfo);
   };
   return emitDebugInstrumentation(ifDebuggee, mozilla::Some(ifNotDebuggee));
 }
 
 typedef bool (*FreshenLexicalEnvFn)(JSContext*, BaselineFrame*);
 static const VMFunction FreshenLexicalEnvInfo =
@@ -4082,26 +4084,28 @@ typedef bool (*DebugLeaveThenFreshenLexi
                                                   jsbytecode*);
 static const VMFunction DebugLeaveThenFreshenLexicalEnvInfo =
     FunctionInfo<DebugLeaveThenFreshenLexicalEnvFn>(
         jit::DebugLeaveThenFreshenLexicalEnv,
         "DebugLeaveThenFreshenLexicalEnv");
 
 template <typename Handler>
 bool BaselineCodeGen<Handler>::emit_JSOP_FRESHENLEXICALENV() {
-  prepareVMCall();
+  frame.syncStack(0);
 
   masm.loadBaselineFramePtr(BaselineFrameReg, R0.scratchReg());
 
   auto ifDebuggee = [this]() {
+    prepareVMCall();
     pushBytecodePCArg();
     pushArg(R0.scratchReg());
     return callVM(DebugLeaveThenFreshenLexicalEnvInfo);
   };
   auto ifNotDebuggee = [this]() {
+    prepareVMCall();
     pushArg(R0.scratchReg());
     return callVM(FreshenLexicalEnvInfo);
   };
   return emitDebugInstrumentation(ifDebuggee, mozilla::Some(ifNotDebuggee));
 }
 
 typedef bool (*RecreateLexicalEnvFn)(JSContext*, BaselineFrame*);
 static const VMFunction RecreateLexicalEnvInfo =
@@ -4112,26 +4116,28 @@ typedef bool (*DebugLeaveThenRecreateLex
                                                    jsbytecode*);
 static const VMFunction DebugLeaveThenRecreateLexicalEnvInfo =
     FunctionInfo<DebugLeaveThenRecreateLexicalEnvFn>(
         jit::DebugLeaveThenRecreateLexicalEnv,
         "DebugLeaveThenRecreateLexicalEnv");
 
 template <typename Handler>
 bool BaselineCodeGen<Handler>::emit_JSOP_RECREATELEXICALENV() {
-  prepareVMCall();
+  frame.syncStack(0);
 
   masm.loadBaselineFramePtr(BaselineFrameReg, R0.scratchReg());
 
   auto ifDebuggee = [this]() {
+    prepareVMCall();
     pushBytecodePCArg();
     pushArg(R0.scratchReg());
     return callVM(DebugLeaveThenRecreateLexicalEnvInfo);
   };
   auto ifNotDebuggee = [this]() {
+    prepareVMCall();
     pushArg(R0.scratchReg());
     return callVM(RecreateLexicalEnvInfo);
   };
   return emitDebugInstrumentation(ifDebuggee, mozilla::Some(ifNotDebuggee));
 }
 
 typedef bool (*DebugLeaveLexicalEnvFn)(JSContext*, BaselineFrame*, jsbytecode*);
 static const VMFunction DebugLeaveLexicalEnvInfo =