Index: working_vm/vm/jitrino/src/codegenerator/ia32/Ia32Inst.h =================================================================== --- working_vm/vm/jitrino/src/codegenerator/ia32/Ia32Inst.h £¨ÐÞ¶©°æ 696583£© +++ working_vm/vm/jitrino/src/codegenerator/ia32/Ia32Inst.h £¨¹¤×÷¿½±´£© @@ -343,7 +343,7 @@ */ bool isSubjectForLivenessAnalysis()const { - return (memOpndKind&(MemOpndKind_StackManualLayout|MemOpndKind_ConstantArea|MemOpndKind_Heap))==0 && !isPlacedIn(OpndKind_Imm); + return (memOpndKind&(MemOpndKind_StackManualLayout|MemOpndKind_ConstantArea|MemOpndKind_Heap|MemOpndKind_LEA))==0 && !isPlacedIn(OpndKind_Imm); } /** Returns the segment register used with the operand (memory). */ Index: working_vm/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.cpp =================================================================== --- working_vm/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.cpp £¨ÐÞ¶©°æ 696583£© +++ working_vm/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.cpp £¨¹¤×÷¿½±´£© @@ -1219,12 +1219,32 @@ //_______________________________________________________________________________________________________________ // Shift left and add - +#define LEA_EXP_LIMIT 3 CG_OpndHandle* InstCodeSelector::shladd(IntegerOp::Types opType, CG_OpndHandle* value, U_32 imm, CG_OpndHandle* addto) -{ +{ + if ((opType == IntegerOp::I4) && (imm <= LEA_EXP_LIMIT)) { + Type * dstType = irManager.getTypeFromTag(Type::Int32); + bool addtoIsImm = false; + if (((Opnd*)addto)->isPlacedIn(OpndKind_Imm)) + addtoIsImm = true; + Opnd *res; + if (addtoIsImm) { + res = irManager.newMemOpnd(dstType, NULL, (Opnd*)value, + irManager.newImmOpnd(typeManager.getInt32Type(), 1<setMemOpndKind(MemOpndKind_LEA); + Opnd *dst = irManager.newOpnd(dstType); + Inst *newInst = irManager.newInstEx(Mnemonic_LEA, 1, dst, res); + appendInsts(newInst); + return dst; + } + Opnd * shiftDest = (Opnd *)shl(opType, value, irManager.newImmOpnd(typeManager.getUInt8Type(), imm)); ArithmeticOp::Types atype; switch (opType) { @@ -1235,7 +1255,6 @@ return add(atype, addto, shiftDest); } - //_______________________________________________________________________________________________________________ // Shift left Index: working_vm/vm/jitrino/src/codegenerator/ia32/Ia32IRConstants.h =================================================================== --- working_vm/vm/jitrino/src/codegenerator/ia32/Ia32IRConstants.h £¨ÐÞ¶©°æ 696583£© +++ working_vm/vm/jitrino/src/codegenerator/ia32/Ia32IRConstants.h £¨¹¤×÷¿½±´£© @@ -64,6 +64,7 @@ MemOpndKind_Stack=0x1f, MemOpndKind_Heap=0x20, MemOpndKind_ConstantArea=0x40, + MemOpndKind_LEA=0x80, MemOpndKind_Any=0xff, };