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/jni_internal.cc b/src/jni_internal.cc
index 94ef729..6c25f6e 100644
--- a/src/jni_internal.cc
+++ b/src/jni_internal.cc
@@ -271,7 +271,7 @@
jmethodID FindMethodID(ScopedJniThreadState& ts, jclass jni_class, const char* name, const char* sig, bool is_static) {
Class* c = Decode<Class*>(ts, jni_class);
- if (!Runtime::Current()->GetClassLinker()->EnsureInitialized(c)) {
+ if (!Runtime::Current()->GetClassLinker()->EnsureInitialized(c, true)) {
return NULL;
}
@@ -303,7 +303,7 @@
jfieldID FindFieldID(ScopedJniThreadState& ts, jclass jni_class, const char* name, const char* sig, bool is_static) {
Class* c = Decode<Class*>(ts, jni_class);
- if (!Runtime::Current()->GetClassLinker()->EnsureInitialized(c)) {
+ if (!Runtime::Current()->GetClassLinker()->EnsureInitialized(c, true)) {
return NULL;
}
@@ -899,7 +899,7 @@
static jobject AllocObject(JNIEnv* env, jclass java_class) {
ScopedJniThreadState ts(env);
Class* c = Decode<Class*>(ts, java_class);
- if (!Runtime::Current()->GetClassLinker()->EnsureInitialized(c)) {
+ if (!Runtime::Current()->GetClassLinker()->EnsureInitialized(c, true)) {
return NULL;
}
return AddLocalReference<jobject>(env, c->AllocObject());
@@ -917,7 +917,7 @@
static jobject NewObjectV(JNIEnv* env, jclass java_class, jmethodID mid, va_list args) {
ScopedJniThreadState ts(env);
Class* c = Decode<Class*>(ts, java_class);
- if (!Runtime::Current()->GetClassLinker()->EnsureInitialized(c)) {
+ if (!Runtime::Current()->GetClassLinker()->EnsureInitialized(c, true)) {
return NULL;
}
Object* result = c->AllocObject();
@@ -929,7 +929,7 @@
static jobject NewObjectA(JNIEnv* env, jclass java_class, jmethodID mid, jvalue* args) {
ScopedJniThreadState ts(env);
Class* c = Decode<Class*>(ts, java_class);
- if (!Runtime::Current()->GetClassLinker()->EnsureInitialized(c)) {
+ if (!Runtime::Current()->GetClassLinker()->EnsureInitialized(c, true)) {
return NULL;
}
Object* result = c->AllocObject();
@@ -2828,7 +2828,7 @@
// If this is a static method, it could be called before the class
// has been initialized.
if (m->IsStatic()) {
- if (!Runtime::Current()->GetClassLinker()->EnsureInitialized(c)) {
+ if (!Runtime::Current()->GetClassLinker()->EnsureInitialized(c, true)) {
return NULL;
}
} else {