Make jni_internal_test a CommonRuntimeTest.
Also clean up proxy_test and reflection_test.
Test: m test-art-host-gtest
Change-Id: I7530855a40d7b9f7214ea7a069508ae1361b2b42
diff --git a/runtime/reflection_test.cc b/runtime/reflection_test.cc
index 9fab7fb..8a76855 100644
--- a/runtime/reflection_test.cc
+++ b/runtime/reflection_test.cc
@@ -31,7 +31,7 @@
namespace art {
-// TODO: Convert to CommonRuntimeTest. Currently MakeExecutable is used.
+// TODO: Convert to CommonRuntimeTest. Currently CompileDirectMethod is used in one test.
class ReflectionTest : public CommonCompilerTest {
protected:
void SetUp() override {
@@ -86,11 +86,11 @@
return soa.AddLocalReference<jclass>(c);
}
- void ReflectionTestMakeExecutable(ArtMethod** method,
- ObjPtr<mirror::Object>* receiver,
- bool is_static,
- const char* method_name,
- const char* method_signature)
+ void ReflectionTestMakeInterpreted(ArtMethod** method,
+ ObjPtr<mirror::Object>* receiver,
+ bool is_static,
+ const char* method_name,
+ const char* method_signature)
REQUIRES_SHARED(Locks::mutator_lock_) {
const char* class_name = is_static ? "StaticLeafMethods" : "NonStaticLeafMethods";
jobject jclass_loader(LoadDex(class_name));
@@ -100,15 +100,15 @@
hs.NewHandle(
ScopedObjectAccessUnchecked(self).Decode<mirror::ClassLoader>(jclass_loader)));
if (!is_static) {
- MakeExecutable(nullptr, "java.lang.Class");
- MakeExecutable(nullptr, "java.lang.Object");
+ MakeInterpreted(class_linker_->FindSystemClass(self, "Ljava/lang/Class;"));
+ MakeInterpreted(class_linker_->FindSystemClass(self, "Ljava/lang/Object;"));
}
- MakeExecutable(class_loader.Get(), class_name);
ObjPtr<mirror::Class> c = class_linker_->FindClass(self,
DotToDescriptor(class_name).c_str(),
class_loader);
CHECK(c != nullptr);
+ MakeInterpreted(c);
*method = c->FindClassMethod(method_name, method_signature, kRuntimePointerSize);
CHECK(*method != nullptr);
@@ -138,7 +138,7 @@
ScopedObjectAccess soa(env_);
ArtMethod* method;
ObjPtr<mirror::Object> receiver;
- ReflectionTestMakeExecutable(&method, &receiver, is_static, "nop", "()V");
+ ReflectionTestMakeInterpreted(&method, &receiver, is_static, "nop", "()V");
ScopedLocalRef<jobject> receiver_ref(soa.Env(), soa.AddLocalReference<jobject>(receiver));
InvokeWithJValues(soa, receiver_ref.get(), jni::EncodeArtMethod(method), nullptr);
}
@@ -147,7 +147,7 @@
ScopedObjectAccess soa(env_);
ArtMethod* method;
ObjPtr<mirror::Object> receiver;
- ReflectionTestMakeExecutable(&method, &receiver, is_static, "identity", "(B)B");
+ ReflectionTestMakeInterpreted(&method, &receiver, is_static, "identity", "(B)B");
ScopedLocalRef<jobject> receiver_ref(soa.Env(), soa.AddLocalReference<jobject>(receiver));
jvalue args[1];
@@ -173,7 +173,7 @@
ScopedObjectAccess soa(env_);
ArtMethod* method;
ObjPtr<mirror::Object> receiver;
- ReflectionTestMakeExecutable(&method, &receiver, is_static, "identity", "(I)I");
+ ReflectionTestMakeInterpreted(&method, &receiver, is_static, "identity", "(I)I");
ScopedLocalRef<jobject> receiver_ref(soa.Env(), soa.AddLocalReference<jobject>(receiver));
jvalue args[1];
@@ -198,7 +198,7 @@
ScopedObjectAccess soa(env_);
ArtMethod* method;
ObjPtr<mirror::Object> receiver;
- ReflectionTestMakeExecutable(&method, &receiver, is_static, "identity", "(D)D");
+ ReflectionTestMakeInterpreted(&method, &receiver, is_static, "identity", "(D)D");
ScopedLocalRef<jobject> receiver_ref(soa.Env(), soa.AddLocalReference<jobject>(receiver));
jvalue args[1];
@@ -223,7 +223,7 @@
ScopedObjectAccess soa(env_);
ArtMethod* method;
ObjPtr<mirror::Object> receiver;
- ReflectionTestMakeExecutable(&method, &receiver, is_static, "sum", "(II)I");
+ ReflectionTestMakeInterpreted(&method, &receiver, is_static, "sum", "(II)I");
ScopedLocalRef<jobject> receiver_ref(soa.Env(), soa.AddLocalReference<jobject>(receiver));
jvalue args[2];
@@ -252,7 +252,7 @@
ScopedObjectAccess soa(env_);
ArtMethod* method;
ObjPtr<mirror::Object> receiver;
- ReflectionTestMakeExecutable(&method, &receiver, is_static, "sum", "(III)I");
+ ReflectionTestMakeInterpreted(&method, &receiver, is_static, "sum", "(III)I");
ScopedLocalRef<jobject> receiver_ref(soa.Env(), soa.AddLocalReference<jobject>(receiver));
jvalue args[3];
@@ -291,7 +291,7 @@
ScopedObjectAccess soa(env_);
ArtMethod* method;
ObjPtr<mirror::Object> receiver;
- ReflectionTestMakeExecutable(&method, &receiver, is_static, "sum", "(IIII)I");
+ ReflectionTestMakeInterpreted(&method, &receiver, is_static, "sum", "(IIII)I");
ScopedLocalRef<jobject> receiver_ref(soa.Env(), soa.AddLocalReference<jobject>(receiver));
jvalue args[4];
@@ -335,7 +335,7 @@
ScopedObjectAccess soa(env_);
ArtMethod* method;
ObjPtr<mirror::Object> receiver;
- ReflectionTestMakeExecutable(&method, &receiver, is_static, "sum", "(IIIII)I");
+ ReflectionTestMakeInterpreted(&method, &receiver, is_static, "sum", "(IIIII)I");
ScopedLocalRef<jobject> receiver_ref(soa.Env(), soa.AddLocalReference<jobject>(receiver));
jvalue args[5];
@@ -384,7 +384,7 @@
ScopedObjectAccess soa(env_);
ArtMethod* method;
ObjPtr<mirror::Object> receiver;
- ReflectionTestMakeExecutable(&method, &receiver, is_static, "sum", "(DD)D");
+ ReflectionTestMakeInterpreted(&method, &receiver, is_static, "sum", "(DD)D");
ScopedLocalRef<jobject> receiver_ref(soa.Env(), soa.AddLocalReference<jobject>(receiver));
jvalue args[2];
@@ -418,7 +418,7 @@
ScopedObjectAccess soa(env_);
ArtMethod* method;
ObjPtr<mirror::Object> receiver;
- ReflectionTestMakeExecutable(&method, &receiver, is_static, "sum", "(DDD)D");
+ ReflectionTestMakeInterpreted(&method, &receiver, is_static, "sum", "(DDD)D");
ScopedLocalRef<jobject> receiver_ref(soa.Env(), soa.AddLocalReference<jobject>(receiver));
jvalue args[3];
@@ -445,7 +445,7 @@
ScopedObjectAccess soa(env_);
ArtMethod* method;
ObjPtr<mirror::Object> receiver;
- ReflectionTestMakeExecutable(&method, &receiver, is_static, "sum", "(DDDD)D");
+ ReflectionTestMakeInterpreted(&method, &receiver, is_static, "sum", "(DDDD)D");
ScopedLocalRef<jobject> receiver_ref(soa.Env(), soa.AddLocalReference<jobject>(receiver));
jvalue args[4];
@@ -475,7 +475,7 @@
ScopedObjectAccess soa(env_);
ArtMethod* method;
ObjPtr<mirror::Object> receiver;
- ReflectionTestMakeExecutable(&method, &receiver, is_static, "sum", "(DDDDD)D");
+ ReflectionTestMakeInterpreted(&method, &receiver, is_static, "sum", "(DDDDD)D");
ScopedLocalRef<jobject> receiver_ref(soa.Env(), soa.AddLocalReference<jobject>(receiver));
jvalue args[5];