diff options
author | Ben Cheng <bccheng@android.com> | 2010-04-02 15:04:53 -0700 |
---|---|---|
committer | Ben Cheng <bccheng@android.com> | 2010-04-02 15:59:41 -0700 |
commit | bd1326d0e6b82a24ee80d50921e62152ea919151 (patch) | |
tree | 257eee0fb870f14597b4e9f498ec9e9dc55eee92 /vm/compiler/codegen/arm/Thumb2 | |
parent | 4ff253ffd0b4d29c770af1c877b434523e18ca50 (diff) | |
download | android_dalvik-bd1326d0e6b82a24ee80d50921e62152ea919151.tar.gz android_dalvik-bd1326d0e6b82a24ee80d50921e62152ea919151.tar.bz2 android_dalvik-bd1326d0e6b82a24ee80d50921e62152ea919151.zip |
Clean up the codegen for invoking helper callout functions.
All invoked functions are documented in compiler/codegen/arm/CalloutHelper.h
Bug: 2567981
Change-Id: Ia7cd4107272df1b0b5588fbcc0aafcc6d0723d60
Diffstat (limited to 'vm/compiler/codegen/arm/Thumb2')
-rw-r--r-- | vm/compiler/codegen/arm/Thumb2/Factory.c | 13 | ||||
-rw-r--r-- | vm/compiler/codegen/arm/Thumb2/Gen.c | 2 |
2 files changed, 10 insertions, 5 deletions
diff --git a/vm/compiler/codegen/arm/Thumb2/Factory.c b/vm/compiler/codegen/arm/Thumb2/Factory.c index eb361934c..0141a0fec 100644 --- a/vm/compiler/codegen/arm/Thumb2/Factory.c +++ b/vm/compiler/codegen/arm/Thumb2/Factory.c @@ -132,8 +132,13 @@ static int modifiedImmediate(u4 value) /* * Load a immediate using a shortcut if possible; otherwise * grab from the per-translation literal pool. + * + * No additional register clobbering operation performed. Use this version when + * 1) rDest is freshly returned from dvmCompilerAllocTemp or + * 2) The codegen is under fixed register usage */ -static ArmLIR *loadConstantValue(CompilationUnit *cUnit, int rDest, int value) +static ArmLIR *loadConstantNoClobber(CompilationUnit *cUnit, int rDest, + int value) { ArmLIR *res; int modImm; @@ -206,7 +211,7 @@ static ArmLIR *loadConstant(CompilationUnit *cUnit, int rDest, int value) dvmCompilerClobber(cUnit, rDest); dvmCompilerMarkInUse(cUnit, rDest); } - return loadConstantValue(cUnit, rDest, value); + return loadConstantNoClobber(cUnit, rDest, value); } static ArmLIR *opNone(CompilationUnit *cUnit, OpKind op) @@ -661,8 +666,8 @@ static ArmLIR *loadConstantValueWide(CompilationUnit *cUnit, int rDestLo, res = newLIR2(cUnit, kThumb2Vmovd_IMM8, S2D(rDestLo, rDestHi), encodedImm); } else { - res = loadConstantValue(cUnit, rDestLo, valLo); - loadConstantValue(cUnit, rDestHi, valHi); + res = loadConstantNoClobber(cUnit, rDestLo, valLo); + loadConstantNoClobber(cUnit, rDestHi, valHi); } return res; } diff --git a/vm/compiler/codegen/arm/Thumb2/Gen.c b/vm/compiler/codegen/arm/Thumb2/Gen.c index 93120d6e3..1782becaa 100644 --- a/vm/compiler/codegen/arm/Thumb2/Gen.c +++ b/vm/compiler/codegen/arm/Thumb2/Gen.c @@ -284,7 +284,7 @@ static void genMonitorExit(CompilationUnit *cUnit, MIR *mir) // Export PC (part 1) loadConstant(cUnit, r3, (int) (cUnit->method->insns + mir->offset)); - loadConstant(cUnit, r7, (int)dvmUnlockObject); + LOAD_FUNC_ADDR(cUnit, r7, (int)dvmUnlockObject); // Export PC (part 2) newLIR3(cUnit, kThumb2StrRRI8Predec, r3, rFP, sizeof(StackSaveArea) - |