diff options
author | Ian Rogers <irogers@google.com> | 2014-03-06 12:13:39 -0800 |
---|---|---|
committer | Ian Rogers <irogers@google.com> | 2014-03-06 19:16:01 -0800 |
commit | 719d1a33f6569864f529e5a3fff59e7bca97aad0 (patch) | |
tree | fcd84efd7b9806b93ec1a44e2317e6f882e7fe0e /runtime/entrypoints/portable | |
parent | 5365eea9940269b662cfbe103caa348816ff1558 (diff) | |
download | art-719d1a33f6569864f529e5a3fff59e7bca97aad0.zip art-719d1a33f6569864f529e5a3fff59e7bca97aad0.tar.gz art-719d1a33f6569864f529e5a3fff59e7bca97aad0.tar.bz2 |
Enable annotalysis on clang ART builds.
Fix clang build errors aswell as restructure locking/mutex code for correct
thread safety analysis support.
Reorder make dependencies so that host builds build first as they should
provide better compilation errors than target.
Remove host's use of -fno-omit-frame-pointer as it has no value with correct
use of CFI, which we should have.
Change-Id: I72cea8da9a3757b1a0b3acb4081feccb7c6cef90
Diffstat (limited to 'runtime/entrypoints/portable')
-rw-r--r-- | runtime/entrypoints/portable/portable_jni_entrypoints.cc | 4 | ||||
-rw-r--r-- | runtime/entrypoints/portable/portable_lock_entrypoints.cc | 10 |
2 files changed, 8 insertions, 6 deletions
diff --git a/runtime/entrypoints/portable/portable_jni_entrypoints.cc b/runtime/entrypoints/portable/portable_jni_entrypoints.cc index de1e32e..17ad4d0 100644 --- a/runtime/entrypoints/portable/portable_jni_entrypoints.cc +++ b/runtime/entrypoints/portable/portable_jni_entrypoints.cc @@ -23,7 +23,7 @@ namespace art { // Called on entry to JNI, transition out of Runnable and release share of mutator_lock_. extern "C" uint32_t art_portable_jni_method_start(Thread* self) - UNLOCK_FUNCTION(GlobalSynchronizatio::mutator_lock_) { + UNLOCK_FUNCTION(Locks::mutator_lock_) { JNIEnvExt* env = self->GetJniEnv(); uint32_t saved_local_ref_cookie = env->local_ref_cookie; env->local_ref_cookie = env->locals.GetSegmentState(); @@ -32,7 +32,7 @@ extern "C" uint32_t art_portable_jni_method_start(Thread* self) } extern "C" uint32_t art_portable_jni_method_start_synchronized(jobject to_lock, Thread* self) - UNLOCK_FUNCTION(Locks::mutator_lock_) { + UNLOCK_FUNCTION(Locks::mutator_lock_) NO_THREAD_SAFETY_ANALYSIS { self->DecodeJObject(to_lock)->MonitorEnter(self); return art_portable_jni_method_start(self); } diff --git a/runtime/entrypoints/portable/portable_lock_entrypoints.cc b/runtime/entrypoints/portable/portable_lock_entrypoints.cc index 44d3da9..358ac23 100644 --- a/runtime/entrypoints/portable/portable_lock_entrypoints.cc +++ b/runtime/entrypoints/portable/portable_lock_entrypoints.cc @@ -20,8 +20,9 @@ namespace art { extern "C" void art_portable_lock_object_from_code(mirror::Object* obj, Thread* thread) - EXCLUSIVE_LOCK_FUNCTION(monitor_lock_) { - DCHECK(obj != NULL); // Assumed to have been checked before entry. + SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) + NO_THREAD_SAFETY_ANALYSIS /* EXCLUSIVE_LOCK_FUNCTION(Monitor::monitor_lock_) */ { + DCHECK(obj != nullptr); // Assumed to have been checked before entry. obj->MonitorEnter(thread); // May block. DCHECK(thread->HoldsLock(obj)); // Only possible exception is NPE and is handled before entry. @@ -29,8 +30,9 @@ extern "C" void art_portable_lock_object_from_code(mirror::Object* obj, Thread* } extern "C" void art_portable_unlock_object_from_code(mirror::Object* obj, Thread* thread) - UNLOCK_FUNCTION(monitor_lock_) { - DCHECK(obj != NULL); // Assumed to have been checked before entry. + SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) + NO_THREAD_SAFETY_ANALYSIS /* UNLOCK_FUNCTION(Monitor::monitor_lock_) */ { + DCHECK(obj != nullptr); // Assumed to have been checked before entry. // MonitorExit may throw exception. obj->MonitorExit(thread); } |