diff options
author | Ian Rogers <irogers@google.com> | 2013-10-18 15:42:20 -0700 |
---|---|---|
committer | Ian Rogers <irogers@google.com> | 2013-10-20 14:55:26 -0700 |
commit | 1eb512d33f94d1dd7ea38263307ba0f7a0dfa653 (patch) | |
tree | b4d4d9b16013ab90fb4b40d23013d7ef44bb5852 /runtime/native/java_lang_System.cc | |
parent | b917ea1a62aa0ab8eca3f689ef64b5be34e11abb (diff) | |
download | android_art-1eb512d33f94d1dd7ea38263307ba0f7a0dfa653.tar.gz android_art-1eb512d33f94d1dd7ea38263307ba0f7a0dfa653.tar.bz2 android_art-1eb512d33f94d1dd7ea38263307ba0f7a0dfa653.zip |
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
Diffstat (limited to 'runtime/native/java_lang_System.cc')
-rw-r--r-- | runtime/native/java_lang_System.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/runtime/native/java_lang_System.cc b/runtime/native/java_lang_System.cc index 100f5a9b18..6674db2403 100644 --- a/runtime/native/java_lang_System.cc +++ b/runtime/native/java_lang_System.cc @@ -22,7 +22,7 @@ #include "mirror/class-inl.h" #include "mirror/object-inl.h" #include "mirror/object_array-inl.h" -#include "scoped_thread_state_change.h" +#include "scoped_fast_native_object_access.h" /* * We make guarantees about the atomicity of accesses to primitive @@ -179,7 +179,7 @@ static void ThrowArrayStoreException_NotAnArray(const char* identifier, mirror:: } static void System_arraycopy(JNIEnv* env, jclass, jobject javaSrc, jint srcPos, jobject javaDst, jint dstPos, jint length) { - ScopedObjectAccess soa(env); + ScopedFastNativeObjectAccess soa(env); // Null pointer checks. if (UNLIKELY(javaSrc == NULL)) { @@ -317,7 +317,7 @@ static void System_arraycopy(JNIEnv* env, jclass, jobject javaSrc, jint srcPos, } static void System_arraycopyCharUnchecked(JNIEnv* env, jclass, jobject javaSrc, jint srcPos, jobject javaDst, jint dstPos, jint length) { - ScopedObjectAccess soa(env); + ScopedFastNativeObjectAccess soa(env); DCHECK(javaSrc != NULL); DCHECK(javaDst != NULL); mirror::Object* srcObject = soa.Decode<mirror::Object*>(javaSrc); @@ -339,15 +339,15 @@ static void System_arraycopyCharUnchecked(JNIEnv* env, jclass, jobject javaSrc, } static jint System_identityHashCode(JNIEnv* env, jclass, jobject javaObject) { - ScopedObjectAccess soa(env); + ScopedFastNativeObjectAccess soa(env); mirror::Object* o = soa.Decode<mirror::Object*>(javaObject); return static_cast<jint>(o->IdentityHashCode()); } static JNINativeMethod gMethods[] = { - NATIVE_METHOD(System, arraycopy, "(Ljava/lang/Object;ILjava/lang/Object;II)V"), - NATIVE_METHOD(System, arraycopyCharUnchecked, "([CI[CII)V"), - NATIVE_METHOD(System, identityHashCode, "(Ljava/lang/Object;)I"), + NATIVE_METHOD(System, arraycopy, "!(Ljava/lang/Object;ILjava/lang/Object;II)V"), + NATIVE_METHOD(System, arraycopyCharUnchecked, "!([CI[CII)V"), + NATIVE_METHOD(System, identityHashCode, "!(Ljava/lang/Object;)I"), }; void register_java_lang_System(JNIEnv* env) { |