From 1eb512d33f94d1dd7ea38263307ba0f7a0dfa653 Mon Sep 17 00:00:00 2001 From: Ian Rogers Date: Fri, 18 Oct 2013 15:42:20 -0700 Subject: Fast JNI support. Use a modifier to signal a native method is a fast JNI method. If the modifier is set then don't perform runnable transitions. Change-Id: I7835b4d837bfdd1cb8e2d54b919c0d5e6cf90499 --- runtime/native/java_lang_reflect_Array.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'runtime/native/java_lang_reflect_Array.cc') diff --git a/runtime/native/java_lang_reflect_Array.cc b/runtime/native/java_lang_reflect_Array.cc index 45ec0ad..a2d6b18 100644 --- a/runtime/native/java_lang_reflect_Array.cc +++ b/runtime/native/java_lang_reflect_Array.cc @@ -21,13 +21,13 @@ #include "mirror/class-inl.h" #include "mirror/object-inl.h" #include "object_utils.h" -#include "scoped_thread_state_change.h" +#include "scoped_fast_native_object_access.h" #include "sirt_ref.h" namespace art { static jobject Array_createMultiArray(JNIEnv* env, jclass, jclass javaElementClass, jobject javaDimArray) { - ScopedObjectAccess soa(env); + ScopedFastNativeObjectAccess soa(env); DCHECK(javaElementClass != NULL); mirror::Class* element_class = soa.Decode(javaElementClass); DCHECK(element_class->IsClass()); @@ -41,7 +41,7 @@ static jobject Array_createMultiArray(JNIEnv* env, jclass, jclass javaElementCla } static jobject Array_createObjectArray(JNIEnv* env, jclass, jclass javaElementClass, jint length) { - ScopedObjectAccess soa(env); + ScopedFastNativeObjectAccess soa(env); DCHECK(javaElementClass != NULL); mirror::Class* element_class = soa.Decode(javaElementClass); if (UNLIKELY(length < 0)) { @@ -63,8 +63,8 @@ static jobject Array_createObjectArray(JNIEnv* env, jclass, jclass javaElementCl } static JNINativeMethod gMethods[] = { - NATIVE_METHOD(Array, createMultiArray, "(Ljava/lang/Class;[I)Ljava/lang/Object;"), - NATIVE_METHOD(Array, createObjectArray, "(Ljava/lang/Class;I)Ljava/lang/Object;"), + NATIVE_METHOD(Array, createMultiArray, "!(Ljava/lang/Class;[I)Ljava/lang/Object;"), + NATIVE_METHOD(Array, createObjectArray, "!(Ljava/lang/Class;I)Ljava/lang/Object;"), }; void register_java_lang_reflect_Array(JNIEnv* env) { -- cgit v1.1