summaryrefslogtreecommitdiff
path: root/runtime/native/java_lang_Thread.cc
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2013-10-18 15:42:20 -0700
committerIan Rogers <irogers@google.com>2013-10-20 14:55:26 -0700
commit1eb512d33f94d1dd7ea38263307ba0f7a0dfa653 (patch)
treeb4d4d9b16013ab90fb4b40d23013d7ef44bb5852 /runtime/native/java_lang_Thread.cc
parentb917ea1a62aa0ab8eca3f689ef64b5be34e11abb (diff)
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_Thread.cc')
-rw-r--r--runtime/native/java_lang_Thread.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/runtime/native/java_lang_Thread.cc b/runtime/native/java_lang_Thread.cc
index a9de086785..5b34cfb224 100644
--- a/runtime/native/java_lang_Thread.cc
+++ b/runtime/native/java_lang_Thread.cc
@@ -19,6 +19,7 @@
#include "jni_internal.h"
#include "monitor.h"
#include "mirror/object.h"
+#include "scoped_fast_native_object_access.h"
#include "scoped_thread_state_change.h"
#include "ScopedUtfChars.h"
#include "thread.h"
@@ -27,7 +28,7 @@
namespace art {
static jobject Thread_currentThread(JNIEnv* env, jclass) {
- ScopedObjectAccess soa(env);
+ ScopedFastNativeObjectAccess soa(env);
return soa.AddLocalReference<jobject>(soa.Self()->GetPeer());
}
@@ -150,7 +151,7 @@ static void Thread_nativeSetPriority(JNIEnv* env, jobject java_thread, jint new_
}
static void Thread_sleep(JNIEnv* env, jclass, jobject java_lock, jlong ms, jint ns) {
- ScopedObjectAccess soa(env);
+ ScopedFastNativeObjectAccess soa(env);
mirror::Object* lock = soa.Decode<mirror::Object*>(java_lock);
Monitor::Wait(Thread::Current(), lock, ms, ns, true, kSleeping);
}
@@ -166,7 +167,7 @@ static void Thread_yield(JNIEnv*, jobject) {
}
static JNINativeMethod gMethods[] = {
- NATIVE_METHOD(Thread, currentThread, "()Ljava/lang/Thread;"),
+ NATIVE_METHOD(Thread, currentThread, "!()Ljava/lang/Thread;"),
NATIVE_METHOD(Thread, interrupted, "()Z"),
NATIVE_METHOD(Thread, isInterrupted, "()Z"),
NATIVE_METHOD(Thread, nativeCreate, "(Ljava/lang/Thread;JZ)V"),
@@ -175,7 +176,7 @@ static JNINativeMethod gMethods[] = {
NATIVE_METHOD(Thread, nativeInterrupt, "()V"),
NATIVE_METHOD(Thread, nativeSetName, "(Ljava/lang/String;)V"),
NATIVE_METHOD(Thread, nativeSetPriority, "(I)V"),
- NATIVE_METHOD(Thread, sleep, "(Ljava/lang/Object;JI)V"),
+ NATIVE_METHOD(Thread, sleep, "!(Ljava/lang/Object;JI)V"),
NATIVE_METHOD(Thread, yield, "()V"),
};