Skip to content

Commit bed8b77

Browse files
committed
fix UT failure
1 parent 095a44d commit bed8b77

File tree

5 files changed

+6
-3
lines changed

5 files changed

+6
-3
lines changed

lib/Backend/BackwardPass.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8088,7 +8088,6 @@ BackwardPass::ProcessInlineeStart(IR::Instr* inlineeStart)
80888088
inlineeStart->m_func->SetFirstArgOffset(inlineeStart);
80898089

80908090
IR::Instr* startCallInstr = nullptr;
8091-
bool noImplicitCallsInInlinee = false;
80928091
// Inlinee has no bailouts or implicit calls. Get rid of the inline overhead.
80938092
auto removeInstr = [&](IR::Instr* argInstr)
80948093
{
@@ -8110,7 +8109,6 @@ BackwardPass::ProcessInlineeStart(IR::Instr* inlineeStart)
81108109
// If there are no implicit calls - bailouts/throws - we can remove all inlining overhead.
81118110
if (!inlineeStart->m_func->GetHasImplicitCalls())
81128111
{
8113-
noImplicitCallsInInlinee = true;
81148112
inlineeStart->IterateArgInstrs(removeInstr);
81158113

81168114
inlineeStart->IterateMetaArgs([](IR::Instr* metArg)
@@ -8119,6 +8117,7 @@ BackwardPass::ProcessInlineeStart(IR::Instr* inlineeStart)
81198117
return false;
81208118
});
81218119
inlineeStart->m_func->m_hasInlineArgsOpt = false;
8120+
inlineeStart->m_func->m_hasInlineOverheadRemoved = true;
81228121
removeInstr(inlineeStart);
81238122
return true;
81248123
}

lib/Backend/Func.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ Func::Func(JitArenaAllocator *alloc, JITTimeWorkItem * workItem,
6464
m_argSlotsForFunctionsCalled(0),
6565
m_hasCalls(false),
6666
m_hasInlineArgsOpt(false),
67+
m_hasInlineOverheadRemoved(false),
6768
m_canDoInlineArgsOpt(true),
6869
unoptimizableArgumentsObjReference(0),
6970
unoptimizableArgumentsObjReferenceInInlinees(0),

lib/Backend/Func.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,7 @@ static const unsigned __int64 c_debugFillPattern8 = 0xcececececececece;
691691
InlineeFrameInfo* cachedInlineeFrameInfo;
692692
bool m_hasCalls: 1; // This is more accurate compared to m_isLeaf
693693
bool m_hasInlineArgsOpt : 1;
694+
bool m_hasInlineOverheadRemoved : 1;
694695
bool m_doFastPaths : 1;
695696
bool hasBailout: 1;
696697
bool hasBailoutInEHRegion : 1;

lib/Backend/Lower.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14584,7 +14584,7 @@ Lowerer::LowerInlineeEnd(IR::Instr *instr)
1458414584
}
1458514585

1458614586
// Keep InlineeEnd around as it is used by register allocator, if we have optimized the arguments stack
14587-
if (instr->m_func->m_hasInlineArgsOpt || (instr->m_func->GetParentFunc()->m_hasInlineArgsOpt && instr->m_func->GetHasImplicitCalls()))
14587+
if (instr->m_func->m_hasInlineArgsOpt || (instr->m_func->GetParentFunc()->m_hasInlineArgsOpt && !instr->m_func->m_hasInlineOverheadRemoved))
1458814588
{
1458914589
instr->FreeSrc1();
1459014590
}

test/inlining/argoptbugs.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,3 +209,5 @@
209209
func4()
210210
func4()
211211
}
212+
213+
print("Pass")

0 commit comments

Comments
 (0)