From 53b8b09fc80329539585dcf43657bc5f4ecefdff Mon Sep 17 00:00:00 2001 From: Ian Rogers Date: Thu, 13 Mar 2014 23:45:53 -0700 Subject: Refactor reflective method invocation. Move invocation code out of JNI internal into reflection, including ArgArray code. Make reflective invocation use the ArgArray to build arguments rather than allocating a jvalue[] and unboxing arguments into that. Move reflection part of jni_internal_test into reflection_test. Make greater use of fast JNI. Change-Id: Ib381372df5f9a83679e30e7275de24fa0e6b1057 --- runtime/runtime.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'runtime/runtime.cc') diff --git a/runtime/runtime.cc b/runtime/runtime.cc index 1555bf2..51edc85 100644 --- a/runtime/runtime.cc +++ b/runtime/runtime.cc @@ -42,7 +42,6 @@ #include "image.h" #include "instrumentation.h" #include "intern_table.h" -#include "invoke_arg_array_builder.h" #include "jni_internal.h" #include "mirror/art_field-inl.h" #include "mirror/art_method-inl.h" @@ -54,6 +53,7 @@ #include "monitor.h" #include "parsed_options.h" #include "oat_file.h" +#include "reflection.h" #include "ScopedLocalRef.h" #include "scoped_thread_state_change.h" #include "signal_catcher.h" @@ -316,9 +316,7 @@ jobject CreateSystemClassLoader() { class_loader_class->FindDirectMethod("getSystemClassLoader", "()Ljava/lang/ClassLoader;"); CHECK(getSystemClassLoader != NULL); - JValue result; - ArgArray arg_array(nullptr, 0); - InvokeWithArgArray(soa, getSystemClassLoader, &arg_array, &result, "L"); + JValue result = InvokeWithJValues(soa, nullptr, soa.EncodeMethod(getSystemClassLoader), nullptr); SirtRef class_loader(soa.Self(), down_cast(result.GetL())); CHECK(class_loader.get() != nullptr); -- cgit v1.1