diff options
| author | 2012-01-31 21:53:19 -0800 | |
|---|---|---|
| committer | 2012-01-31 21:53:19 -0800 | |
| commit | 549377a75a71d8d1cd4a08bad457a98272fa181c (patch) | |
| tree | 62967deaa3419d248d21ff5493ab05aeba95c837 /src/compiler/codegen/arm/MethodCodegenDriver.cc | |
| parent | 36bd973c4723d74929e36c22577bb34ba4a9ee57 (diff) | |
| parent | 0eb7d7e2a0c2767b5fd86bd52436c618fd4c3120 (diff) | |
Merge "Implement array allocation with access checks." into dalvik-dev
Diffstat (limited to 'src/compiler/codegen/arm/MethodCodegenDriver.cc')
| -rw-r--r-- | src/compiler/codegen/arm/MethodCodegenDriver.cc | 23 |
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 |