4574 {
4576 if (should_remove_all) {
4577 for (auto entry : graph->reverse_postorder()) {
4578 for (ForwardInstructionIterator it(entry); !it.Done(); it.Advance()) {
4579 if (it.Current()->IsCheckStackOverflow()) {
4580 it.RemoveCurrentFromGraph();
4581 }
4582 }
4583 }
4584 return;
4585 }
4586
4587 CheckStackOverflowInstr* first_stack_overflow_instr = nullptr;
4588 for (auto entry : graph->reverse_postorder()) {
4589 for (ForwardInstructionIterator it(entry); !it.Done(); it.Advance()) {
4590 Instruction* current = it.Current();
4591
4592 if (CheckStackOverflowInstr* instr = current->AsCheckStackOverflow()) {
4593 if (first_stack_overflow_instr == nullptr) {
4594 first_stack_overflow_instr = instr;
4595 ASSERT(!first_stack_overflow_instr->in_loop());
4596 }
4597 continue;
4598 }
4599
4600 if (current->IsBranch()) {
4601 current = current->AsBranch()->comparison();
4602 }
4603
4604 if (current->HasUnknownSideEffects()) {
4605 return;
4606 }
4607 }
4608 }
4609
4610 if (first_stack_overflow_instr != nullptr) {
4611 first_stack_overflow_instr->RemoveFromGraph();
4612 }
4613}
static bool IsMarkedWithNoInterrupts(const Function &function)