From 5d90c20bd7903d7bba966b224e576bf137bf8b4b Mon Sep 17 00:00:00 2001 From: Ben Cheng Date: Sun, 22 Nov 2009 23:31:11 -0800 Subject: Restructure the codegen to make architectural depedency explicit. The original Codegen.c is broken into three components: - CodegenCommon.c (arch-independend) - CodegenFactory.c (Thumb1/2 dependent) - CodegenDriver.c (Dalvik dependent) For the Thumb/Thumb2 directories, each contain the followin three files: - Factory.c (low-level routines for instruction selections) - Gen.c (invoke the ISA-specific instruction selection routines) - Ralloc.c (arch-dependent register pools) The FP directory contains FP-specific codegen routines depending on Thumb/Thumb2/VFP/PortableFP: - Thumb2VFP.c - ThumbVFP.c - ThumbPortableFP.c Then the hierarchy is formed by stacking these files in the following top-down order: 1 CodegenCommon.c 2 Thumb[2]/Factory.c 3 CodegenFactory.c 4 Thumb[2]/Gen.c 5 FP stuff 6 Thumb[2]/Ralloc.c 7 CodegenDriver.c --- vm/compiler/codegen/arm/LocalOptimizations.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'vm/compiler/codegen/arm/LocalOptimizations.c') diff --git a/vm/compiler/codegen/arm/LocalOptimizations.c b/vm/compiler/codegen/arm/LocalOptimizations.c index 86f692f75..159c2aae5 100644 --- a/vm/compiler/codegen/arm/LocalOptimizations.c +++ b/vm/compiler/codegen/arm/LocalOptimizations.c @@ -17,6 +17,7 @@ #include "Dalvik.h" #include "vm/compiler/CompilerInternals.h" #include "ArmLIR.h" +#include "Codegen.h" #define DEBUG_OPT(X) @@ -95,9 +96,8 @@ static void applyLoadStoreElimination(CompilationUnit *cUnit, /* Insert a move to replace the load */ if (checkLIR->operands[0] != nativeRegId) { ArmLIR *moveLIR; - moveLIR = dvmCompilerRegCopy(cUnit, - checkLIR->operands[0], - nativeRegId); + moveLIR = dvmCompilerRegCopyNoInsert( + cUnit, checkLIR->operands[0], nativeRegId); /* * Insertion is guaranteed to succeed since checkLIR * is never the first LIR on the list @@ -250,9 +250,8 @@ static void applyLoadHoisting(CompilationUnit *cUnit, /* Insert a move to replace the load */ if (checkLIR->operands[0] != nativeRegId) { ArmLIR *moveLIR; - moveLIR = dvmCompilerRegCopy(cUnit, - nativeRegId, - checkLIR->operands[0]); + moveLIR = dvmCompilerRegCopyNoInsert( + cUnit, nativeRegId, checkLIR->operands[0]); /* * Convert *thisLIR* load into a move */ -- cgit v1.2.3