From 00f7d0eaa6bd93d33bf0c1429bf4ba0b3f28abac Mon Sep 17 00:00:00 2001 From: Ian Rogers Date: Thu, 19 Jul 2012 15:28:27 -0700 Subject: Global lock levels. Introduce the notion of the mutators/GC being a shared-exclusive (aka reader-writer) lock. Introduce globally ordered locks, analysable by annotalysis, statically at compile time. Add locking attributes to methods. More subtly, remove the heap_lock_ and split between various locks that are held for smaller periods (where work doesn't get blocked). Remove buggy Dalvik style thread transitions. Make GC use CMS in all cases when concurrent is enabled. Fix bug where suspend counts rather than debug suspend counts were sent to JDWP. Move the PathClassLoader to WellKnownClasses. In debugger refactor calls to send request and possibly suspend. Break apart different VmWait thread states. Move identity hash code to a shared method. Change-Id: Icdbfc3ce3fcccd14341860ac7305d8e97b51f5c6 --- src/native/java_lang_String.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/native/java_lang_String.cc') diff --git a/src/native/java_lang_String.cc b/src/native/java_lang_String.cc index 96fcf96287..bfdc31ac68 100644 --- a/src/native/java_lang_String.cc +++ b/src/native/java_lang_String.cc @@ -16,7 +16,7 @@ #include "jni_internal.h" #include "object.h" -#include "scoped_jni_thread_state.h" +#include "scoped_thread_state_change.h" #ifdef HAVE__MEMCMP16 // "count" is in 16-bit units. @@ -36,9 +36,9 @@ uint32_t MemCmp16(const uint16_t* s0, const uint16_t* s1, size_t count) { namespace art { static jint String_compareTo(JNIEnv* env, jobject javaThis, jobject javaRhs) { - ScopedJniThreadState ts(env); - String* lhs = ts.Decode(javaThis); - String* rhs = ts.Decode(javaRhs); + ScopedObjectAccess soa(env); + String* lhs = soa.Decode(javaThis); + String* rhs = soa.Decode(javaRhs); if (rhs == NULL) { Thread::Current()->ThrowNewException("Ljava/lang/NullPointerException;", "rhs == null"); @@ -70,11 +70,11 @@ static jint String_compareTo(JNIEnv* env, jobject javaThis, jobject javaRhs) { } static jint String_fastIndexOf(JNIEnv* env, jobject java_this, jint ch, jint start) { - ScopedJniThreadState ts(env); + ScopedObjectAccess soa(env); // This method does not handle supplementary characters. They're dealt with in managed code. DCHECK_LE(ch, 0xffff); - String* s = ts.Decode(java_this); + String* s = soa.Decode(java_this); jint count = s->GetLength(); if (start < 0) { @@ -96,10 +96,10 @@ static jint String_fastIndexOf(JNIEnv* env, jobject java_this, jint ch, jint sta } static jstring String_intern(JNIEnv* env, jobject javaThis) { - ScopedJniThreadState ts(env); - String* s = ts.Decode(javaThis); + ScopedObjectAccess soa(env); + String* s = soa.Decode(javaThis); String* result = s->Intern(); - return ts.AddLocalReference(result); + return soa.AddLocalReference(result); } static JNINativeMethod gMethods[] = { -- cgit v1.2.3-59-g8ed1b