@@ -24617,33 +24617,35 @@ Lowerer::GenerateLdHomeObj(IR::Instr* instr)
24617
24617
24618
24618
InsertObjectPoison(instanceRegOpnd, branchInstr, instr, false);
24619
24619
24620
- // Is this an function with inline cache and home obj??
24621
- IR::Opnd * vtableAddressInlineFuncHomObjOpnd = this->LoadVTableValueOpnd(instr, VTableValue::VtableScriptFunctionWithInlineCacheAndHomeObj);
24622
- InsertCompareBranch(IR::IndirOpnd::New(instanceRegOpnd, 0, TyMachPtr, func), vtableAddressInlineFuncHomObjOpnd, Js::OpCode::BrNeq_A, labelInlineFunc, instr);
24623
- IR::IndirOpnd *indirInlineFuncHomeObjOpnd = IR::IndirOpnd::New(instanceRegOpnd, Js::FunctionWithHomeObj<Js::ScriptFunctionWithInlineCache>::GetOffsetOfHomeObj(), TyMachPtr, func);
24624
- Lowerer::InsertMove(instanceRegOpnd, indirInlineFuncHomeObjOpnd, instr);
24625
- InsertBranch(Js::OpCode::Br, testLabel, instr);
24626
-
24627
- instr->InsertBefore(labelInlineFunc);
24628
-
24629
- // Is this a function with inline cache, home obj and computed name??
24630
- IR::Opnd * vtableAddressInlineFuncHomObjCompNameOpnd = this->LoadVTableValueOpnd(instr, VTableValue::VtableScriptFunctionWithInlineCacheHomeObjAndComputedName);
24631
- InsertCompareBranch(IR::IndirOpnd::New(instanceRegOpnd, 0, TyMachPtr, func), vtableAddressInlineFuncHomObjCompNameOpnd, Js::OpCode::BrNeq_A, scriptFuncLabel, instr);
24632
- IR::IndirOpnd *indirInlineFuncHomeObjCompNameOpnd = IR::IndirOpnd::New(instanceRegOpnd, Js::FunctionWithComputedName<Js::FunctionWithHomeObj<Js::ScriptFunctionWithInlineCache>>::GetOffsetOfHomeObj(), TyMachPtr, func);
24633
- Lowerer::InsertMove(dstOpnd, indirInlineFuncHomeObjCompNameOpnd, instr);
24634
- InsertBranch(Js::OpCode::Br, testLabel, instr);
24635
-
24636
- instr->InsertBefore(scriptFuncLabel);
24637
- IR::IndirOpnd *indirOpnd = nullptr;
24638
- if (func->GetJITFunctionBody()->HasComputedName())
24639
- {
24640
- indirOpnd = IR::IndirOpnd::New(instanceRegOpnd, Js::FunctionWithComputedName<Js::ScriptFunctionWithHomeObj>::GetOffsetOfHomeObj(), TyMachPtr, func);
24620
+ if (func->GetJITFunctionBody()->HasHomeObj())
24621
+ {
24622
+ // Is this an function with inline cache and home obj??
24623
+ IR::Opnd * vtableAddressInlineFuncHomObjOpnd = this->LoadVTableValueOpnd(instr, VTableValue::VtableScriptFunctionWithInlineCacheAndHomeObj);
24624
+ IR::BranchInstr* inlineFuncHomObjOpndBr = InsertCompareBranch(IR::IndirOpnd::New(instanceRegOpnd, 0, TyMachPtr, func), vtableAddressInlineFuncHomObjOpnd, Js::OpCode::BrNeq_A, labelInlineFunc, instr);
24625
+ InsertObjectPoison(instanceRegOpnd, inlineFuncHomObjOpndBr, instr, false);
24626
+ IR::IndirOpnd *indirInlineFuncHomeObjOpnd = IR::IndirOpnd::New(instanceRegOpnd, Js::FunctionWithHomeObj<Js::ScriptFunctionWithInlineCache>::GetOffsetOfHomeObj(), TyMachPtr, func);
24627
+ Lowerer::InsertMove(instanceRegOpnd, indirInlineFuncHomeObjOpnd, instr);
24628
+ InsertBranch(Js::OpCode::Br, testLabel, instr);
24629
+
24630
+ instr->InsertBefore(labelInlineFunc);
24631
+
24632
+ // Is this a function with inline cache, home obj and computed name??
24633
+ IR::Opnd * vtableAddressInlineFuncHomObjCompNameOpnd = this->LoadVTableValueOpnd(instr, VTableValue::VtableScriptFunctionWithInlineCacheHomeObjAndComputedName);
24634
+ IR::BranchInstr* inlineFuncHomObjCompNameBr = InsertCompareBranch(IR::IndirOpnd::New(instanceRegOpnd, 0, TyMachPtr, func), vtableAddressInlineFuncHomObjCompNameOpnd, Js::OpCode::BrNeq_A, scriptFuncLabel, instr);
24635
+ InsertObjectPoison(instanceRegOpnd, inlineFuncHomObjCompNameBr, instr, false);
24636
+ IR::IndirOpnd *indirInlineFuncHomeObjCompNameOpnd = IR::IndirOpnd::New(instanceRegOpnd, Js::FunctionWithComputedName<Js::FunctionWithHomeObj<Js::ScriptFunctionWithInlineCache>>::GetOffsetOfHomeObj(), TyMachPtr, func);
24637
+ Lowerer::InsertMove(instanceRegOpnd, indirInlineFuncHomeObjCompNameOpnd, instr);
24638
+ InsertBranch(Js::OpCode::Br, testLabel, instr);
24639
+
24640
+ instr->InsertBefore(scriptFuncLabel);
24641
+ IR::IndirOpnd *indirOpnd = IR::IndirOpnd::New(instanceRegOpnd, Js::ScriptFunctionWithHomeObj::GetOffsetOfHomeObj(), TyMachPtr, func);
24642
+ Lowerer::InsertMove(instanceRegOpnd, indirOpnd, instr);
24641
24643
}
24642
24644
else
24643
24645
{
24644
- indirOpnd = IR::IndirOpnd::New(instanceRegOpnd, Js::ScriptFunctionWithHomeObj::GetOffsetOfHomeObj(), TyMachPtr, func);
24646
+ // Even if the function does not have home object in eval cases we still have the LdHomeObj opcode
24647
+ InsertBranch(Js::OpCode::Br, labelDone, instr);
24645
24648
}
24646
- Lowerer::InsertMove(instanceRegOpnd, indirOpnd, instr);
24647
24649
24648
24650
instr->InsertBefore(testLabel);
24649
24651
InsertTestBranch(instanceRegOpnd, instanceRegOpnd, Js::OpCode::BrEq_A, labelDone, instr);
0 commit comments