From baf196a7b259704137cccf4058b78da15d4c3998 Mon Sep 17 00:00:00 2001 From: buzbee Date: Wed, 4 Aug 2010 10:13:15 -0700 Subject: Fix for 2892472 jit spew: No free temp registers Neglected some register allocation hygene, which caused a problem on armv5te builds. Change-Id: I666b39b88822c4d3d3d7f0e84386aca2920bb9f1 --- vm/compiler/codegen/arm/CodegenDriver.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'vm/compiler/codegen/arm/CodegenDriver.c') diff --git a/vm/compiler/codegen/arm/CodegenDriver.c b/vm/compiler/codegen/arm/CodegenDriver.c index cd0f18d99..79019a044 100644 --- a/vm/compiler/codegen/arm/CodegenDriver.c +++ b/vm/compiler/codegen/arm/CodegenDriver.c @@ -41,6 +41,8 @@ static void markCard(CompilationUnit *cUnit, int valReg, int tgtAddrReg) ArmLIR *target = newLIR0(cUnit, kArmPseudoTargetLabel); target->defMask = ENCODE_ALL; branchOver->generic.target = (LIR *)target; + dvmCompilerFreeTemp(cUnit, regCardBase); + dvmCompilerFreeTemp(cUnit, regCardNo); } static bool genConversionCall(CompilationUnit *cUnit, MIR *mir, void *funct, @@ -574,6 +576,9 @@ static void genArrayObjectPut(CompilationUnit *cUnit, MIR *mir, scale, kWord); HEAP_ACCESS_SHADOW(false); + dvmCompilerFreeTemp(cUnit, regPtr); + dvmCompilerFreeTemp(cUnit, regIndex); + /* NOTE: marking card here based on object head */ markCard(cUnit, r0, r1); } @@ -1543,6 +1548,7 @@ static bool handleFmt21c_Fmt31c(CompilationUnit *cUnit, MIR *mir) /* NOTE: marking card based on field address */ markCard(cUnit, rlSrc.lowReg, tReg); } + dvmCompilerFreeTemp(cUnit, tReg); break; } -- cgit v1.2.3 From 4a41958266fb432629dea30832f4b3194667ba99 Mon Sep 17 00:00:00 2001 From: Ben Cheng Date: Wed, 4 Aug 2010 13:23:09 -0700 Subject: Bug fixes for JIT loop detection and formation Specifically: - Don't apply loop optimization if the basic induction variable is manipulated (ie excluding cases like "i+=0") - Fix a case where variables reloaded with constants in the body are not considered as loop invariants Bug: 2804188 Change-Id: Ia5ebb29bc6814b1be069e23794585f8313900b7d --- vm/compiler/codegen/arm/CodegenDriver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'vm/compiler/codegen/arm/CodegenDriver.c') diff --git a/vm/compiler/codegen/arm/CodegenDriver.c b/vm/compiler/codegen/arm/CodegenDriver.c index a1e54496e..dcabd8e52 100644 --- a/vm/compiler/codegen/arm/CodegenDriver.c +++ b/vm/compiler/codegen/arm/CodegenDriver.c @@ -4339,14 +4339,14 @@ bool dvmCompilerDoWork(CompilerWorkOrder *work) case kWorkOrderTrace: /* Start compilation with maximally allowed trace length */ res = dvmCompileTrace(work->info, JIT_MAX_TRACE_LEN, &work->result, - work->bailPtr); + work->bailPtr, 0 /* no hints */); break; case kWorkOrderTraceDebug: { bool oldPrintMe = gDvmJit.printMe; gDvmJit.printMe = true; /* Start compilation with maximally allowed trace length */ res = dvmCompileTrace(work->info, JIT_MAX_TRACE_LEN, &work->result, - work->bailPtr); + work->bailPtr, 0 /* no hints */); gDvmJit.printMe = oldPrintMe; break; } -- cgit v1.2.3 From bff121aa3e5d3c34caf837227cb00a46bf3f1966 Mon Sep 17 00:00:00 2001 From: buzbee Date: Wed, 4 Aug 2010 15:25:06 -0700 Subject: JIT: Reworked the assembler to be smarter about short instruction forms Previously, the JIT wasn't generating short-form compare and branch on zero/not zero instructions for Thumb2. The reason was that these only allow a 1-byte displacement, and when they didn't reach the assembler would abort the trace, split it in half and try again. This change re-enables cbz, cbnz generation and introduces a relatively lightweight retry mechanism. Also includes changes for Thumb2 to always generate large displacement literal loads and conditional branches to minimize the number of retry attempts. Change-Id: Icf066836fad203f5c0fcbbb2ae8e1aa73d1cf816 --- vm/compiler/codegen/arm/CodegenDriver.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'vm/compiler/codegen/arm/CodegenDriver.c') diff --git a/vm/compiler/codegen/arm/CodegenDriver.c b/vm/compiler/codegen/arm/CodegenDriver.c index dcabd8e52..1ff94096e 100644 --- a/vm/compiler/codegen/arm/CodegenDriver.c +++ b/vm/compiler/codegen/arm/CodegenDriver.c @@ -4426,6 +4426,12 @@ void *dvmCompilerGetInterpretTemplate() templateEntryOffsets[TEMPLATE_INTERPRET]); } +/* Needed by the Assembler */ +void dvmCompilerSetupResourceMasks(ArmLIR *lir) +{ + setupResourceMasks(lir); +} + /* Needed by the ld/st optmizatons */ ArmLIR* dvmCompilerRegCopyNoInsert(CompilationUnit *cUnit, int rDest, int rSrc) { -- cgit v1.2.3