Index: vm/jitrino/src/optimizer/osr.cpp =================================================================== --- vm/jitrino/src/optimizer/osr.cpp (revision 601660) +++ vm/jitrino/src/optimizer/osr.cpp (working copy) @@ -155,7 +155,8 @@ result.setType(OSROpndInfo::LD_CONST); result.setConst(info1.getConst()); writeHeaderToResult(result, tree, info1, info2); - } + + } } else if ((info1.isCounter() && info2.isLDConst()) || (info2.isCounter() && info1.isLDConst())) { uint32 increment = info1.isCounter() ? @@ -580,12 +581,11 @@ SsaOpnd* OSR::apply(Type* type, Opcode opcode, Operation op, SsaOpnd* opnd1, SsaOpnd* opnd2){ - findLeadingOpnd(opnd2->getInst(), opnd2); - SsaOpnd* opnd2Leader = getLeadingOperand(opnd2); - if (opnd2 != 0) { - opnd2 = opnd2Leader; - } - + SsaOpnd* opnd2Leader = getLeadingOperand(opnd2); + if (opnd2Leader!= 0) { + opnd2 = opnd2Leader; + } + opnd1 = (SsaOpnd*) DeadCodeEliminator::copyPropagate(opnd1); if (Log::isEnabled()) { @@ -627,8 +627,14 @@ } return result; } - -Inst* OSR::findInsertionPlace(SsaOpnd* opnd2, SsaOpnd* opnd1){ +Inst* OSR::findInsertionPlace(SsaOpnd* opnd1, SsaOpnd* opnd2){ + + findLeadingOpnd(opnd2->getInst(), opnd2); + SsaOpnd* opnd2Leader = getLeadingOperand(opnd2); + if (opnd2Leader!= 0) { + opnd2 = opnd2Leader; + } + Inst* opnd1inst = opnd1->getInst(); Inst* opnd2inst = opnd2->getInst(); Node* block1 = opnd1inst->getNode();