File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ FuncInfo::FuncInfo(
1313 Js::ParseableFunctionInfo* byteCodeFunction)
1414 : alloc(alloc),
1515 varRegsCount(0 ),
16- constRegsCount(2 ),
16+ constRegsCount(InitialConstRegsCount ),
1717 inArgsCount(0 ),
1818 innerScopeCount(0 ),
1919 currentInnerScopeIndex((uint)-1),
Original file line number Diff line number Diff line change @@ -83,6 +83,8 @@ class FuncInfo
8383 uint nextForInLoopLevel;
8484 uint maxForInLoopLevel;
8585public:
86+ static const Js::RegSlot InitialConstRegsCount = 2 ; // constRegsCount is set to 2 because R0 is the return register, and R1 is the root object
87+
8688 ArenaAllocator *alloc;
8789 // set in Bind/Assign pass
8890 Js::RegSlot varRegsCount; // number of registers used for non-constants
@@ -192,7 +194,6 @@ class FuncInfo
192194 Symbol *innerArgumentsSymbol;
193195 JsUtil::List<Js::RegSlot, ArenaAllocator> nonUserNonTempRegistersToInitialize;
194196
195- // constRegsCount is set to 2 because R0 is the return register, and R1 is the root object.
196197 FuncInfo (
197198 const char16 *name,
198199 ArenaAllocator *alloc,
Original file line number Diff line number Diff line change @@ -3324,6 +3324,8 @@ namespace Js
33243324 byteCodeGen->Writer ()->EndStatement (functionNode);
33253325 byteCodeGen->Writer ()->End ();
33263326
3327+ functionBody->CheckAndSetConstantCount (FuncInfo::InitialConstRegsCount);
3328+
33273329 autoCleanup.Done ();
33283330 }
33293331
Original file line number Diff line number Diff line change @@ -2772,16 +2772,18 @@ namespace Js
27722772
27732773 AsmJsScriptFunction* scriptFuncObj = (AsmJsScriptFunction*)ScriptFunction::OP_NewScFunc (pDisplay, functionInfo);
27742774 localModuleFunctions[modFunc.location ] = scriptFuncObj;
2775+
2776+ if (scriptFuncObj->GetDynamicType ()->GetEntryPoint () == DefaultDeferredDeserializeThunk)
2777+ {
2778+ JavascriptFunction::DeferredDeserialize (scriptFuncObj);
2779+ }
2780+
27752781 if (i == 0 && info->GetUsesChangeHeap ())
27762782 {
27772783 scriptFuncObj->GetDynamicType ()->SetEntryPoint (AsmJsChangeHeapBuffer);
27782784 }
27792785 else
27802786 {
2781- if (scriptFuncObj->GetDynamicType ()->GetEntryPoint () == DefaultDeferredDeserializeThunk)
2782- {
2783- JavascriptFunction::DeferredDeserialize (scriptFuncObj);
2784- }
27852787 scriptFuncObj->GetDynamicType ()->SetEntryPoint (AsmJsExternalEntryPoint);
27862788 scriptFuncObj->GetFunctionBody ()->GetAsmJsFunctionInfo ()->SetModuleFunctionBody (asmJsModuleFunctionBody);
27872789 }
You can’t perform that action at this time.
0 commit comments