Jelajahi Sumber

[MERGE #2455 @satheeshravi] Stack args fix for detecting scope obj restore

Merge pull request #2455 from satheeshravi:StackArgsBailoutFix_release1.4

The flag that is used for detecting if we restored scope object in the bail out path, was wrongly being marked while restoring outparams for .call bailout scenarios.

Fix:
Moved the setter to a point where we actually set the localClosure property with the scope object.
Satheesh Ravindranath 9 tahun lalu
induk
melakukan
11886b344c
1 mengubah file dengan 1 tambahan dan 6 penghapusan
  1. 1 6
      lib/Backend/BailOut.cpp

+ 1 - 6
lib/Backend/BailOut.cpp

@@ -990,12 +990,6 @@ BailOutRecord::RestoreValue(IR::BailOutKind bailOutKind, Js::JavascriptCallStack
         }
     }
 
-    Js::RegSlot localClosureReg = newInstance->function->GetFunctionBody()->GetLocalClosureRegister();
-    if (regSlot == localClosureReg)
-    {
-        this->globalBailOutRecordTable->isScopeObjRestored = true;
-    }
-
     values[regSlot] = value;
 
     BAILOUT_VERBOSE_TRACE(newInstance->function->GetFunctionBody(), bailOutKind, _u("\n"));
@@ -1633,6 +1627,7 @@ BailOutRecord::BailOutHelper(Js::JavascriptCallStackLayout * layout, Js::ScriptF
         Js::Var closure = newInstance->GetNonVarReg(localClosureReg);
         if (closure)
         {
+            bailOutRecord->globalBailOutRecordTable->isScopeObjRestored = true;
             newInstance->SetLocalClosure(closure);
             newInstance->SetNonVarReg(localClosureReg, nullptr);
         }