void LinearScan::collectNativesAux(Trace* trace) { for (IRInstruction* inst : trace->getInstructionList()) { if (inst->isNative()) { m_natives.push_back(inst); } if (inst->isControlFlowInstruction()) { LabelInstruction* label = inst->getLabel(); if (label != NULL && label->getId() == inst->getId() + 1) { collectNativesAux(label->getParent()); } } } }
void LinearScan::collectNativesAux(Trace* trace) { IRInstruction::List& instList = trace->getInstructionList(); for (IRInstruction::Iterator it = instList.begin(); it != instList.end(); ++it) { IRInstruction* inst = *it; if (inst->isNative()) { m_natives.push_back(inst); } if (inst->isControlFlowInstruction()) { LabelInstruction* label = inst->getLabel(); if (label != NULL && label->getId() == inst->getId() + 1) { collectNativesAux(label->getTrace()); } } } }
void LinearScan::collectNatives(Trace* trace) { // May be re-executed. Need initialize <m_natives> each time. m_natives.clear(); collectNativesAux(trace); }