From 5772babbe824494ef9fe90a1b07a926d124bb7c7 Mon Sep 17 00:00:00 2001 From: jeffhao Date: Fri, 18 May 2012 11:51:26 -0700 Subject: Fixed x86 compilation of filled-new-array/range. Implemented loadBaseIndexed and found a way to implemented filled-new-array/range using only 4 temps instead of 5 by regenerating the target pointer value after the loop. Change-Id: Ibb694600e6852ba3c4939c5878625655809c60fd --- src/compiler/codegen/GenCommon.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/compiler/codegen/GenCommon.cc') diff --git a/src/compiler/codegen/GenCommon.cc b/src/compiler/codegen/GenCommon.cc index c9ba285c5f..2209084934 100644 --- a/src/compiler/codegen/GenCommon.cc +++ b/src/compiler/codegen/GenCommon.cc @@ -582,7 +582,8 @@ void genFilledNewArray(CompilationUnit* cUnit, MIR* mir, bool isRange) #if defined(TARGET_ARM) int rVal = rLR; // Using a lot of temps, rLR is known free here #elif defined(TARGET_X86) - int rVal = rSrc; + oatFreeTemp(cUnit, rRET0); + int rVal = oatAllocTemp(cUnit); #else int rVal = oatAllocTemp(cUnit); #endif @@ -608,6 +609,11 @@ void genFilledNewArray(CompilationUnit* cUnit, MIR* mir, bool isRange) oatFreeTemp(cUnit, rVal); opRegImm(cUnit, kOpSub, rIdx, 1); opCmpImmBranch(cUnit, kCondGe, rIdx, 0, target); +#endif +#if defined(TARGET_X86) + // Restore the target pointer + opRegRegImm(cUnit, kOpAdd, rRET0, rDst, + -Array::DataOffset(component_size).Int32Value()); #endif } else if (!isRange) { // TUNING: interleave -- cgit v1.2.3-59-g8ed1b