Skip to content

Commit 582a9c3

Browse files
committed
[MERGE chakra-core#2307 @rajatd] Recover perf regression related to stack args
Merge pull request chakra-core#2307 from rajatd:fixBox2dRegression A perf regression had crept in with a refactor I did a while ago. We dont have block-level merging of arguments object syms in the globopt. So, as much as possible, we try to keep the set of arguments object syms same across blocks. To this end, we ignore tracking the arguments object alias introduced by ByteCodeArgoutCapture. To do this, the globopt expects the argout instructions to be immediately preceding the InlineBuiltInStart instr for .apply. The refactor I did had broken this assumption. Reverting to that.
2 parents 582b512 + a5a1cb3 commit 582a9c3

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)