Skip to content

Commit fe17a72

Browse files
committed
[MERGE chakra-core#1844 @ThomsonTan] Don't hoist InlineeStart in peeps
Merge pull request chakra-core#1844 from ThomsonTan:FixHoistInlineeStart InlineeStart is hoisted in peeps for branching (the same instruction in branch follower and target is hoisted before branch). The owner function of InlineeStart is not checked for instruction equivalence (actually cannot hoist even for the same function, because the inline ranges in inliner function are different). Hoist InlineeStart causes encoder not generating InlineeFrameRecord for some inlinee which will corrupt baiout and stack walk in such inlinee.
2 parents 450ae8e + a01606b commit fe17a72

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

lib/Backend/Peeps.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,10 @@ Peeps::HoistSameInstructionAboveSplit(IR::BranchInstr *branchInstr, IR::Instr *i
683683
Assert(instr && targetInstr);
684684
while (!instr->EndsBasicBlock() && !instr->IsLabelInstr() && instr->IsEqual(targetInstr) &&
685685
!EncoderMD::UsesConditionCode(instr) && !EncoderMD::SetsConditionCode(instr) &&
686-
!this->peepsAgen.DependentInstrs(instrSetCondition, instr))
686+
!this->peepsAgen.DependentInstrs(instrSetCondition, instr) &&
687+
// cannot hoist InlineeStart from branch targets even for the same inlinee function.
688+
// it is used by encoder to generate InlineeFrameRecord for each inlinee
689+
instr->m_opcode != Js::OpCode::InlineeStart)
687690
{
688691
branchNextInstr = instr->GetNextRealInstrOrLabel();
689692
targetNextInstr = targetInstr->GetNextRealInstrOrLabel();

0 commit comments

Comments
 (0)