Bug 1511891 part 7 - Change jit::CheckGlobalOrEvalDeclarationConflicts signature to make it less Baseline-specific. r=tcampbell
authorJan de Mooij <jdemooij@mozilla.com>
Fri, 11 Jan 2019 09:14:58 +0000
changeset 453461 0df13a6c64be51a71425190e082e977795ad7242
parent 453460 745cbd9ae616029f2f146b3ab810709755e4b692
child 453462 4e1a2cc33577009e6ff6149b0231e5c55f0e7289
push id35357
push usernerli@mozilla.com
push dateFri, 11 Jan 2019 21:54:07 +0000
treeherdermozilla-central@0ce024c91511 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstcampbell
bugs1511891
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 1511891 part 7 - Change jit::CheckGlobalOrEvalDeclarationConflicts signature to make it less Baseline-specific. r=tcampbell Differential Revision: https://phabricator.services.mozilla.com/D13705
js/src/jit/BaselineCompiler.cpp
js/src/jit/VMFunctions.cpp
js/src/jit/VMFunctions.h
--- a/js/src/jit/BaselineCompiler.cpp
+++ b/js/src/jit/BaselineCompiler.cpp
@@ -810,17 +810,18 @@ bool BaselineCompiler::emitDebugPrologue
   }
 
   debugOsrPrologueOffset_ = CodeOffset(masm.currentOffset());
 
   return true;
 }
 
 typedef bool (*CheckGlobalOrEvalDeclarationConflictsFn)(JSContext*,
-                                                        BaselineFrame*);
+                                                        HandleObject,
+                                                        HandleScript);
 static const VMFunction CheckGlobalOrEvalDeclarationConflictsInfo =
     FunctionInfo<CheckGlobalOrEvalDeclarationConflictsFn>(
         jit::CheckGlobalOrEvalDeclarationConflicts,
         "CheckGlobalOrEvalDeclarationConflicts");
 
 typedef bool (*InitFunctionEnvironmentObjectsFn)(JSContext*, BaselineFrame*);
 static const VMFunction InitFunctionEnvironmentObjectsInfo =
     FunctionInfo<InitFunctionEnvironmentObjectsFn>(
@@ -859,17 +860,19 @@ bool BaselineCompiler::initEnvironmentCh
     Register scope = R1.scratchReg();
     masm.movePtr(ImmGCPtr(&module()->initialEnvironment()), scope);
     masm.storePtr(scope, frame.addressOfEnvironmentChain());
   } else {
     // EnvironmentChain pointer in BaselineFrame has already been initialized
     // in prologue, but we need to check for redeclaration errors.
 
     prepareVMCall();
-    masm.loadBaselineFramePtr(BaselineFrameReg, R0.scratchReg());
+
+    pushArg(ImmGCPtr(script));
+    masm.loadPtr(frame.addressOfEnvironmentChain(), R0.scratchReg());
     pushArg(R0.scratchReg());
 
     if (!callVMNonOp(CheckGlobalOrEvalDeclarationConflictsInfo, phase)) {
       return false;
     }
   }
 
   return true;
--- a/js/src/jit/VMFunctions.cpp
+++ b/js/src/jit/VMFunctions.cpp
@@ -896,20 +896,18 @@ bool GeneratorThrowOrReturn(JSContext* c
     resumeKind = GeneratorObject::RETURN;
   }
 
   MOZ_ALWAYS_FALSE(
       js::GeneratorThrowOrReturn(cx, frame, genObj, arg, resumeKind));
   return false;
 }
 
-bool CheckGlobalOrEvalDeclarationConflicts(JSContext* cx,
-                                           BaselineFrame* frame) {
-  RootedScript script(cx, frame->script());
-  RootedObject envChain(cx, frame->environmentChain());
+bool CheckGlobalOrEvalDeclarationConflicts(JSContext* cx, HandleObject envChain,
+                                           HandleScript script) {
   RootedObject varObj(cx, &GetVariablesObject(envChain));
 
   if (script->isForEval()) {
     // Strict eval and eval in parameter default expressions have their
     // own call objects.
     //
     // Non-strict eval may introduce 'var' bindings that conflict with
     // lexical bindings in an enclosing lexical scope.
--- a/js/src/jit/VMFunctions.h
+++ b/js/src/jit/VMFunctions.h
@@ -1027,17 +1027,18 @@ MOZ_MUST_USE bool DebugAfterYield(JSCont
                                   jsbytecode* pc, bool* mustReturn);
 MOZ_MUST_USE bool GeneratorThrowOrReturn(JSContext* cx, BaselineFrame* frame,
                                          Handle<GeneratorObject*> genObj,
                                          HandleValue arg, uint32_t resumeKind);
 
 MOZ_MUST_USE bool GlobalNameConflictsCheckFromIon(JSContext* cx,
                                                   HandleScript script);
 MOZ_MUST_USE bool CheckGlobalOrEvalDeclarationConflicts(JSContext* cx,
-                                                        BaselineFrame* frame);
+                                                        HandleObject envChain,
+                                                        HandleScript script);
 MOZ_MUST_USE bool InitFunctionEnvironmentObjects(JSContext* cx,
                                                  BaselineFrame* frame);
 
 MOZ_MUST_USE bool NewArgumentsObject(JSContext* cx, BaselineFrame* frame,
                                      MutableHandleValue res);
 
 JSObject* CopyLexicalEnvironmentObject(JSContext* cx, HandleObject env,
                                        bool copySlots);