summaryrefslogtreecommitdiff
path: root/src/native/java_lang_String.cc
diff options
context:
space:
mode:
author Ian Rogers <irogers@google.com> 2012-07-19 15:28:27 -0700
committer Ian Rogers <irogers@google.com> 2012-08-14 10:45:52 -0700
commit00f7d0eaa6bd93d33bf0c1429bf4ba0b3f28abac (patch)
tree6a2172ece15c4699e6c2a67ce76f019db0a9a21d /src/native/java_lang_String.cc
parent634ea28f78c4a138e6a1de54eae8696095422415 (diff)
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
Diffstat (limited to 'src/native/java_lang_String.cc')
-rw-r--r--src/native/java_lang_String.cc18
1 files changed, 9 insertions, 9 deletions
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<String*>(javaThis);
- String* rhs = ts.Decode<String*>(javaRhs);
+ ScopedObjectAccess soa(env);
+ String* lhs = soa.Decode<String*>(javaThis);
+ String* rhs = soa.Decode<String*>(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<String*>(java_this);
+ String* s = soa.Decode<String*>(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<String*>(javaThis);
+ ScopedObjectAccess soa(env);
+ String* s = soa.Decode<String*>(javaThis);
String* result = s->Intern();
- return ts.AddLocalReference<jstring>(result);
+ return soa.AddLocalReference<jstring>(result);
}
static JNINativeMethod gMethods[] = {