diff options
| author | Ben Cheng <bccheng@android.com> | 2010-10-12 11:50:10 -0700 |
|---|---|---|
| committer | Ben Cheng <bccheng@android.com> | 2010-10-12 13:29:16 -0700 |
| commit | c8293e7dfe856ca95e27aef1ac2e64d750d60662 (patch) | |
| tree | 7f69335f4bb65f7067463dcc9ea15cf8788df470 /vm/compiler/codegen/arm/CodegenDriver.c | |
| parent | 5051928e9461cf4f73d578ad3189c9b8d8b03886 (diff) | |
Fine-tune the instructions on the method invocation path.
1) Initialize the register and out sizes for callee methods through
constant moves.
2) Eliminate an unnecessary load of Dalvik PC for chained and
native callees.
Improved method invocation performance by ~3%.
Change-Id: Iead1276eed0ba527e82eb876f08d169ab9b496b2
Diffstat (limited to 'vm/compiler/codegen/arm/CodegenDriver.c')
| -rw-r--r-- | vm/compiler/codegen/arm/CodegenDriver.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/vm/compiler/codegen/arm/CodegenDriver.c b/vm/compiler/codegen/arm/CodegenDriver.c index 2d92d8837..d90050b6e 100644 --- a/vm/compiler/codegen/arm/CodegenDriver.c +++ b/vm/compiler/codegen/arm/CodegenDriver.c @@ -1062,16 +1062,21 @@ static void genInvokeSingletonCommon(CompilationUnit *cUnit, MIR *mir, ArmLIR *retChainingCell = &labelList[bb->fallThrough->id]; /* r1 = &retChainingCell */ - dvmCompilerLockTemp(cUnit, r1); ArmLIR *addrRetChain = opRegRegImm(cUnit, kOpAdd, r1, rpc, 0); + /* r4PC = dalvikCallsite */ loadConstant(cUnit, r4PC, (int) (cUnit->method->insns + mir->offset)); addrRetChain->generic.target = (LIR *) retChainingCell; + + /* r7 = calleeMethod->registersSize */ + loadConstant(cUnit, r7, calleeMethod->registersSize); /* * r0 = calleeMethod (loaded upon calling genInvokeSingletonCommon) * r1 = &ChainingCell + * r2 = calleeMethod->outsSize (to be loaded later for Java callees) * r4PC = callsiteDPC + * r7 = calleeMethod->registersSize */ if (dvmIsNativeMethod(calleeMethod)) { genDispatchToHandler(cUnit, TEMPLATE_INVOKE_METHOD_NATIVE); @@ -1079,6 +1084,8 @@ static void genInvokeSingletonCommon(CompilationUnit *cUnit, MIR *mir, gDvmJit.invokeNative++; #endif } else { + /* For Java callees, set up r2 to be calleeMethod->outsSize */ + loadConstant(cUnit, r2, calleeMethod->outsSize); genDispatchToHandler(cUnit, TEMPLATE_INVOKE_METHOD_CHAIN); #if defined(WITH_JIT_TUNING) gDvmJit.invokeMonomorphic++; |
