Adding oat_process
- Added oat_process, a version of app_process use to launch frameworks apps
- Added liboat_runtime, a version of libandroid_runtime that uses art instead of dvm
This is just a special makefile, frameworks/base/core/jni code is used for source
- Added support for build a boot.oat with the full BOOTCLASSPATH
The older smaller boat.oat is now core.oat
- Added mem_map code for making sure a requested memory region is available
Moved mem_map code to cc file to make easier to debug with smaller rebuild
- Moved oat base address to 0x6000000 as a work around to host addres conflict
- Added -Xms and -Xmx options to dex2oat to allow build specific memory options
- Fixed miranda method initialization problem found compiling full bootclasspath
- Made compiler.cc tolerant of verification errors found compiling full bootclasspath
- Bumped arena block alloc warning to avoid noise when compiling full bootclasspath
- Marked implicit GC unimplemented to fail fast
- Added --output argument to oatdump
- Made many object asserts tolerate access in IsErroneous state
now that verifier is failing validation of some classes during compilation
- Made runtime tolerate unknown access as short term solution for oat_process
- Workaround SSA issue to restore full bootclasspath compilation
- Added test-art-target-processs to excercise oat_process with "am"
"am" found bug where class_linker was using Method::GetClass and not ::GetDeclaringClass
Change-Id: I1a645a142b163e06bab9e72eb094ae1f1dbfbd97
diff --git a/src/compiler.cc b/src/compiler.cc
index 71727fd..54793ba 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -2,6 +2,8 @@
#include "compiler.h"
+#include <sys/mman.h>
+
#include "assembler.h"
#include "class_linker.h"
#include "class_loader.h"
@@ -72,7 +74,9 @@
// Class derived values are more complicated, they require the linker and loader.
for (size_t type_idx = 0; type_idx < dex_cache->NumResolvedTypes(); type_idx++) {
Class* klass = class_linker->ResolveType(dex_file, type_idx, dex_cache, class_loader);
- CHECK(klass->IsResolved());
+ if (klass == NULL) {
+ Thread::Current()->ClearException();
+ }
}
// Method and Field are the worst. We can't resolve without either
@@ -172,13 +176,19 @@
const DexFile::ClassDef& class_def = dex_file.GetClassDef(class_def_index);
const char* descriptor = dex_file.GetClassDescriptor(class_def);
Class* klass = class_linker->FindClass(descriptor, class_loader);
- class_linker->EnsureInitialized(klass, false);
+ if (klass != NULL) {
+ class_linker->EnsureInitialized(klass, false);
+ }
+ // clear any class not found or verification exceptions
+ Thread::Current()->ClearException();
}
DexCache* dex_cache = class_linker->FindDexCache(dex_file);
for (size_t type_idx = 0; type_idx < dex_cache->NumResolvedTypes(); type_idx++) {
Class* klass = class_linker->ResolveType(dex_file, type_idx, dex_cache, class_loader);
- if (klass->IsInitialized()) {
+ if (klass == NULL) {
+ Thread::Current()->ClearException();
+ } else if (klass->IsInitialized()) {
dex_cache->GetInitializedStaticStorage()->Set(type_idx, klass);
}
}
@@ -199,8 +209,15 @@
const DexFile::ClassDef& class_def = dex_file.GetClassDef(class_def_index);
const char* descriptor = dex_file.GetClassDescriptor(class_def);
Class* klass = class_linker->FindClass(descriptor, class_loader);
- CHECK(klass != NULL);
- CompileClass(klass);
+ if (klass == NULL) {
+ // previous verification error will cause FindClass to throw
+ Thread* self = Thread::Current();
+ // CHECK(self->IsExceptionPending());
+ UNIMPLEMENTED(WARNING) << "CHECK for verification error after FindClass " << descriptor;
+ self->ClearException();
+ } else {
+ CompileClass(klass);
+ }
}
}