Skip to content

Commit a5a1cb3

Browse files
committed
Recover perf regression related to stack args
1 parent d0f4f88 commit a5a1cb3

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

lib/Backend/Inline.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2442,6 +2442,14 @@ IR::Instr * Inline::InlineApplyWithArgumentsObject(IR::Instr * callInstr, IR::In
24422442
IR::Instr* builtInStartInstr;
24432443
InsertInlineeBuiltInStartEndTags(callInstr, 3, &builtInStartInstr); //3 args (implicit this + explicit this + arguments = 3)
24442444

2445+
// Move argouts close to call. Globopt expects this for arguments object tracking.
2446+
IR::Instr* argInsertInstr = builtInStartInstr;
2447+
builtInStartInstr->IterateArgInstrs([&](IR::Instr* argInstr) {
2448+
argInstr->Move(argInsertInstr);
2449+
argInsertInstr = argInstr;
2450+
return false;
2451+
});
2452+
24452453
IR::Instr *startCall = IR::Instr::New(Js::OpCode::StartCall, callInstr->m_func);
24462454
startCall->SetDst(IR::RegOpnd::New(TyVar, callInstr->m_func));
24472455
startCall->SetSrc1(IR::IntConstOpnd::New(2, TyInt32, callInstr->m_func)); //2 args (this pointer & ArgOut_A_From_StackArgs for this direct call to init

0 commit comments

Comments
 (0)