summaryrefslogtreecommitdiff
path: root/src/compiler/codegen/arm/MethodCodegenDriver.cc
diff options
context:
space:
mode:
author Ian Rogers <irogers@google.com> 2011-10-27 15:19:26 -0700
committer Ian Rogers <irogers@google.com> 2011-10-28 23:14:15 -0700
commit28ad40dc3ec2f09b0ffd4f6d6787bf1b532ccd5d (patch)
treef5628e47948a0d255112a3a7a01b67db41c8d424 /src/compiler/codegen/arm/MethodCodegenDriver.cc
parente0918556e7551de638870dcad3f2023f94f85a50 (diff)
Support for unresolved types in new-instance during verification.
Also, ensure that classes that don't load are erroneous, warn early about exceptions left on a thread by the verifier/compiler, factor out slowpath checks for the compiler and fix the slowpath selector for const-class. This change causes more dex cache misses at runtime (more slowpath execution). It also requires a "mm clean-oat". Change-Id: I014b49ebdd7d8f7dd2e39cc0958fc0b708d58c4c
Diffstat (limited to 'src/compiler/codegen/arm/MethodCodegenDriver.cc')
-rw-r--r--src/compiler/codegen/arm/MethodCodegenDriver.cc19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/compiler/codegen/arm/MethodCodegenDriver.cc b/src/compiler/codegen/arm/MethodCodegenDriver.cc
index 7ea7d698c2..4326a9e2b6 100644
--- a/src/compiler/codegen/arm/MethodCodegenDriver.cc
+++ b/src/compiler/codegen/arm/MethodCodegenDriver.cc
@@ -46,10 +46,19 @@ STATIC void genNewArray(CompilationUnit* cUnit, MIR* mir, RegLocation rlDest,
RegLocation rlSrc)
{
oatFlushAllRegs(cUnit); /* Everything to home location */
- loadWordDisp(cUnit, rSELF,
- OFFSETOF_MEMBER(Thread, pAllocArrayFromCode), rLR);
+ uint32_t type_idx = mir->dalvikInsn.vC;
+ if (cUnit->compiler->CanAccessTypeWithoutChecks(cUnit->method, type_idx)) {
+ loadWordDisp(cUnit, rSELF,
+ OFFSETOF_MEMBER(Thread, pAllocArrayFromCode), rLR);
+ } else {
+ UNIMPLEMENTED(WARNING) << "Need to check access of '"
+ << PrettyMethod(cUnit->method)
+ << "' to unresolved type " << type_idx;
+ loadWordDisp(cUnit, rSELF,
+ OFFSETOF_MEMBER(Thread, pAllocArrayFromCode), rLR);
+ }
loadCurrMethodDirect(cUnit, r1); // arg1 <- Method*
- loadConstant(cUnit, r0, mir->dalvikInsn.vC); // arg0 <- type_id
+ loadConstant(cUnit, r0, type_idx); // arg0 <- type_id
loadValueDirectFixed(cUnit, rlSrc, r2); // arg2 <- count
callRuntimeHelper(cUnit, rLR);
RegLocation rlResult = oatGetReturn(cUnit);
@@ -70,6 +79,10 @@ STATIC void genFilledNewArray(CompilationUnit* cUnit, MIR* mir, bool isRange)
oatFlushAllRegs(cUnit); /* Everything to home location */
loadWordDisp(cUnit, rSELF,
OFFSETOF_MEMBER(Thread, pCheckAndAllocArrayFromCode), rLR);
+ if (!cUnit->compiler->CanAccessTypeWithoutChecks(cUnit->method, typeId)) {
+ UNIMPLEMENTED(WARNING) << "Need to check access of '" << PrettyMethod(cUnit->method)
+ << "' to unresolved type " << typeId;
+ }
loadCurrMethodDirect(cUnit, r1); // arg1 <- Method*
loadConstant(cUnit, r0, typeId); // arg0 <- type_id
loadConstant(cUnit, r2, elems); // arg2 <- count