1749 {
1750 const intptr_t osr_id = graph_entry->osr_id();
1751
1752
1753
1754
1755
1756
1757
1758 if (block_marks->Contains(
block_id()))
return false;
1760
1761
1762 Instruction* instr = this;
1763 for (ForwardInstructionIterator it(this); !it.Done(); it.Advance()) {
1764 instr = it.Current();
1765 if (instr->GetDeoptId() == osr_id) {
1766
1767 ASSERT(instr->IsCheckStackOverflow());
1768
1769
1771
1772
1773 ASSERT(instr->previous() ==
this);
1774
1776 auto normal_entry = graph_entry->normal_entry();
1777 auto osr_entry = new OsrEntryInstr(
1778 graph_entry, normal_entry->block_id(), normal_entry->try_index(),
1780
1781 auto goto_join = new GotoInstr(AsJoinEntry(),
1783 ASSERT(parent !=
nullptr);
1784 goto_join->CopyDeoptIdFrom(*parent);
1785 osr_entry->LinkTo(goto_join);
1786
1787
1788 graph_entry->set_normal_entry(nullptr);
1789 graph_entry->set_unchecked_entry(nullptr);
1790 graph_entry->set_osr_entry(osr_entry);
1791
1792 return true;
1793 }
1794 }
1795
1796
1797 for (intptr_t i = instr->SuccessorCount() - 1; i >= 0; --i) {
1798 if (instr->SuccessorAt(i)->FindOsrEntryAndRelink(graph_entry, instr,
1799 block_marks)) {
1800 return true;
1801 }
1802 }
1803 return false;
1804}
static CompilerState & Current()