Fix compiler class initialization to properly deal with super classes
Also moving active parts of compiler_test to be oat tests including
IntMath and Invoke. Added an interface invocation test case to Invoke
test. Changed Compiler to CHECK that it is not used once the
Runtime::IsStarted, forcing some jni_compiler_test to have two phases,
one for compiling before Runtime::Start and one for JNI operations
after the Runtime::IsStarted.
Finally, fixed Class::CanPutArrayElementFromCode by removing
CanPutArrayElement and calling IsAssignableFrom directly.
Change-Id: I52ca4dbc0e02db65f274ccc3ca7468dce365a44e
diff --git a/src/class_linker.h b/src/class_linker.h
index 02e6d6f..18bd9d6 100644
--- a/src/class_linker.h
+++ b/src/class_linker.h
@@ -134,7 +134,9 @@
bool is_static);
// Returns true on success, false if there's an exception pending.
- bool EnsureInitialized(Class* c);
+ // can_run_clinit=false allows the compiler to attempt to init a class,
+ // given the restriction that no <clinit> execution is possible.
+ bool EnsureInitialized(Class* c, bool can_run_clinit);
void RegisterDexFile(const DexFile& dex_file);
void RegisterDexFile(const DexFile& dex_file, DexCache* dex_cache);
@@ -172,7 +174,7 @@
void FinishInit();
- bool InitializeClass(Class* klass);
+ bool InitializeClass(Class* klass, bool can_run_clinit);
// For early bootstrapping by Init
Class* AllocClass(Class* java_lang_Class, size_t class_size);
@@ -238,7 +240,7 @@
// was inserted.
bool InsertClass(const StringPiece& descriptor, Class* klass);
- bool InitializeSuperClass(Class* klass);
+ bool InitializeSuperClass(Class* klass, bool can_run_clinit);
void InitializeStaticFields(Class* klass);