From 58ece73d25c78a05b94c820c5ec65b8a2edca81f Mon Sep 17 00:00:00 2001 From: Ben Cheng Date: Wed, 17 Mar 2010 23:32:26 -0700 Subject: [PATCH] Bug fix for JIT peephole optimization. Bug: 2520500 Change-Id: I36dbd8b3a6d13c40f9735df4918ab02b5f053b07 --- vm/compiler/codegen/arm/LocalOptimizations.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/vm/compiler/codegen/arm/LocalOptimizations.c b/vm/compiler/codegen/arm/LocalOptimizations.c index 9f616b836..fbeceef4d 100644 --- a/vm/compiler/codegen/arm/LocalOptimizations.c +++ b/vm/compiler/codegen/arm/LocalOptimizations.c @@ -105,11 +105,13 @@ static void applyLoadStoreElimination(CompilationUnit *cUnit, moveLIR = dvmCompilerRegCopyNoInsert( cUnit, checkLIR->operands[0], nativeRegId); /* - * Insertion is guaranteed to succeed since checkLIR - * is never the first LIR on the list + * Insert the converted checkLIR instruction after the + * the original checkLIR since the optimization is + * scannng in the top-down order and the new instruction + * will need to be checked. */ - dvmCompilerInsertLIRBefore((LIR *) checkLIR, - (LIR *) moveLIR); + dvmCompilerInsertLIRAfter((LIR *) checkLIR, + (LIR *) moveLIR); } checkLIR->isNop = true; continue; -- 2.11.0