diff options
| author | 2012-04-17 20:51:22 -0700 | |
|---|---|---|
| committer | 2012-04-18 18:44:23 -0700 | |
| commit | 264675757a1d1ba43f53634d1301b7d6b79fe02c (patch) | |
| tree | de8ebe45f28c4c287d3be5e8cca7fee2fe5c587a /src | |
| parent | 69eafaae2c910ea6f704a3867f9b78647174a0df (diff) | |
Don't use work_around_app_jni_bugs for llvm now.
Change-Id: Id698e60c09dc863311445498d8813e38a48b8cc4
Diffstat (limited to 'src')
| -rw-r--r-- | src/native/dalvik_system_VMRuntime.cc | 6 | ||||
| -rw-r--r-- | src/object.cc | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/native/dalvik_system_VMRuntime.cc b/src/native/dalvik_system_VMRuntime.cc index 140fafffbd..fe52ae47dd 100644 --- a/src/native/dalvik_system_VMRuntime.cc +++ b/src/native/dalvik_system_VMRuntime.cc @@ -136,6 +136,7 @@ static void VMRuntime_setTargetSdkVersion(JNIEnv*, jobject, jint targetSdkVersio Runtime* runtime = Runtime::Current(); JavaVMExt* vm = runtime->GetJavaVM(); +#if !defined(ART_USE_LLVM_COMPILER) if (vm->check_jni) { LOG(WARNING) << "Turning off CheckJNI so we can turn on JNI app bug workarounds..."; ScopedThreadListLock thread_list_lock; @@ -145,7 +146,12 @@ static void VMRuntime_setTargetSdkVersion(JNIEnv*, jobject, jint targetSdkVersio LOG(INFO) << "Turning on JNI app bug workarounds for target SDK version " << targetSdkVersion << "..."; + vm->work_around_app_jni_bugs = true; +#else + LOG(WARNING) << "LLVM does not work-around app jni bugs."; + vm->work_around_app_jni_bugs = false; +#endif } } diff --git a/src/object.cc b/src/object.cc index 158f0e643c..8c101ba259 100644 --- a/src/object.cc +++ b/src/object.cc @@ -591,6 +591,10 @@ void Method::RegisterNative(Thread* self, const void* native_method) { DCHECK(Thread::Current() == self); CHECK(IsNative()) << PrettyMethod(this); CHECK(native_method != NULL) << PrettyMethod(this); +#if defined(ART_USE_LLVM_COMPILER) + SetFieldPtr<const void*>(OFFSET_OF_OBJECT_MEMBER(Method, native_method_), + native_method, false); +#else if (!self->GetJniEnv()->vm->work_around_app_jni_bugs) { SetFieldPtr<const void*>(OFFSET_OF_OBJECT_MEMBER(Method, native_method_), native_method, false); @@ -608,6 +612,7 @@ void Method::RegisterNative(Thread* self, const void* native_method) { SetFieldPtr<const uint8_t*>(OFFSET_OF_OBJECT_MEMBER(Method, gc_map_), reinterpret_cast<const uint8_t*>(native_method), false); } +#endif } void Method::UnregisterNative(Thread* self) { |