summaryrefslogtreecommitdiff
path: root/src/compiler/codegen/arm/MethodCodegenDriver.cc
diff options
context:
space:
mode:
author Ian Rogers <irogers@google.com> 2012-01-31 21:12:32 -0800
committer Ian Rogers <irogers@google.com> 2012-01-31 21:14:59 -0800
commit0eb7d7e2a0c2767b5fd86bd52436c618fd4c3120 (patch)
treea446a35a4dfc5d258bb2817b92319b2f8ea84b20 /src/compiler/codegen/arm/MethodCodegenDriver.cc
parent09cc2d39b3073ab0c613a9f660983e781693d958 (diff)
Implement array allocation with access checks.
Change-Id: I0b2c0274087f3f7ed5b0b71c441e5d7e5a25f819
Diffstat (limited to 'src/compiler/codegen/arm/MethodCodegenDriver.cc')
-rw-r--r--src/compiler/codegen/arm/MethodCodegenDriver.cc23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/compiler/codegen/arm/MethodCodegenDriver.cc b/src/compiler/codegen/arm/MethodCodegenDriver.cc
index 6f476f930f..bb66451221 100644
--- a/src/compiler/codegen/arm/MethodCodegenDriver.cc
+++ b/src/compiler/codegen/arm/MethodCodegenDriver.cc
@@ -58,11 +58,8 @@ STATIC void genNewArray(CompilationUnit* cUnit, MIR* mir, RegLocation rlDest,
loadWordDisp(cUnit, rSELF,
OFFSETOF_MEMBER(Thread, pAllocArrayFromCode), rLR);
} else {
- UNIMPLEMENTED(WARNING) << "Need to check access of '"
- << PrettyMethod(cUnit->method_idx, *cUnit->dex_file)
- << "' to unresolved type " << type_idx;
loadWordDisp(cUnit, rSELF,
- OFFSETOF_MEMBER(Thread, pAllocArrayFromCode), rLR);
+ OFFSETOF_MEMBER(Thread, pAllocArrayFromCodeWithAccessCheck), rLR);
}
loadCurrMethodDirect(cUnit, r1); // arg1 <- Method*
loadConstant(cUnit, r0, type_idx); // arg0 <- type_id
@@ -84,15 +81,15 @@ STATIC void genFilledNewArray(CompilationUnit* cUnit, MIR* mir, bool isRange)
int elems = dInsn->vA;
int typeId = dInsn->vB;
oatFlushAllRegs(cUnit); /* Everything to home location */
- loadWordDisp(cUnit, rSELF,
- OFFSETOF_MEMBER(Thread, pCheckAndAllocArrayFromCode), rLR);
- if (!cUnit->compiler->CanAccessTypeWithoutChecks(cUnit->method_idx,
- cUnit->dex_cache,
- *cUnit->dex_file,
- typeId)) {
- UNIMPLEMENTED(WARNING) << "Need to check access of '"
- << PrettyMethod(cUnit->method_idx, *cUnit->dex_file)
- << "' to unresolved type " << typeId;
+ if (cUnit->compiler->CanAccessTypeWithoutChecks(cUnit->method_idx,
+ cUnit->dex_cache,
+ *cUnit->dex_file,
+ typeId)) {
+ loadWordDisp(cUnit, rSELF,
+ OFFSETOF_MEMBER(Thread, pCheckAndAllocArrayFromCode), rLR);
+ } else {
+ loadWordDisp(cUnit, rSELF,
+ OFFSETOF_MEMBER(Thread, pCheckAndAllocArrayFromCodeWithAccessCheck), rLR);
}
loadCurrMethodDirect(cUnit, r1); // arg1 <- Method*
loadConstant(cUnit, r0, typeId); // arg0 <- type_id