diff options
author | Ian Rogers <irogers@google.com> | 2014-07-17 11:09:10 -0700 |
---|---|---|
committer | Ian Rogers <irogers@google.com> | 2014-08-08 08:29:53 -0700 |
commit | 68d8b42ddec39ec0174162d90d4abaa004d1983e (patch) | |
tree | 0bb6ccf3b996bb8363c10d07aa39cde221980602 /runtime/base | |
parent | 9c522c2cbbf50dc687728747b37ad59985750b65 (diff) | |
download | art-68d8b42ddec39ec0174162d90d4abaa004d1983e.zip art-68d8b42ddec39ec0174162d90d4abaa004d1983e.tar.gz art-68d8b42ddec39ec0174162d90d4abaa004d1983e.tar.bz2 |
Wire up check JNI force copy mode.
Increase check JNI checks.
Break apart jni_internal.h in to jni_env_ext.h and java_vm_ext.h.
Fix the abuse of ScopedObjectAccess/annotalysis by ScopedCheck in the case
of VM routines.
Make class loader override and shared library class loader JNI global
references rather than mirror pointers.
Clean-ups to native bridge.
Change-Id: If7c6110b5aade7a402bfb67534af86a7b2cdeb55
Diffstat (limited to 'runtime/base')
-rw-r--r-- | runtime/base/mutex.cc | 6 | ||||
-rw-r--r-- | runtime/base/mutex.h | 7 |
2 files changed, 11 insertions, 2 deletions
diff --git a/runtime/base/mutex.cc b/runtime/base/mutex.cc index c0a865f..abe0aa0 100644 --- a/runtime/base/mutex.cc +++ b/runtime/base/mutex.cc @@ -35,6 +35,7 @@ Mutex* Locks::allocated_thread_ids_lock_ = nullptr; Mutex* Locks::breakpoint_lock_ = nullptr; ReaderWriterMutex* Locks::classlinker_classes_lock_ = nullptr; ReaderWriterMutex* Locks::heap_bitmap_lock_ = nullptr; +Mutex* Locks::jni_libraries_lock_ = nullptr; Mutex* Locks::logging_lock_ = nullptr; Mutex* Locks::mem_maps_lock_ = nullptr; Mutex* Locks::modify_ldt_lock_ = nullptr; @@ -834,6 +835,7 @@ void Locks::Init() { DCHECK(breakpoint_lock_ != nullptr); DCHECK(classlinker_classes_lock_ != nullptr); DCHECK(heap_bitmap_lock_ != nullptr); + DCHECK(jni_libraries_lock_ != nullptr); DCHECK(logging_lock_ != nullptr); DCHECK(mutator_lock_ != nullptr); DCHECK(thread_list_lock_ != nullptr); @@ -878,6 +880,10 @@ void Locks::Init() { DCHECK(thread_list_lock_ == nullptr); thread_list_lock_ = new Mutex("thread list lock", current_lock_level); + UPDATE_CURRENT_LOCK_LEVEL(kJniLoadLibraryLock); + DCHECK(jni_libraries_lock_ == nullptr); + jni_libraries_lock_ = new Mutex("JNI shared libraries map lock", current_lock_level); + UPDATE_CURRENT_LOCK_LEVEL(kBreakpointLock); DCHECK(breakpoint_lock_ == nullptr); breakpoint_lock_ = new Mutex("breakpoint lock", current_lock_level); diff --git a/runtime/base/mutex.h b/runtime/base/mutex.h index d898e49..fd76629 100644 --- a/runtime/base/mutex.h +++ b/runtime/base/mutex.h @@ -74,7 +74,6 @@ enum LockLevel { kDefaultMutexLevel, kMarkSweepLargeObjectLock, kPinTableLock, - kLoadLibraryLock, kJdwpObjectRegistryLock, kModifyLdtLock, kAllocatedThreadIdsLock, @@ -83,6 +82,7 @@ enum LockLevel { kBreakpointLock, kMonitorLock, kMonitorListLock, + kJniLoadLibraryLock, kThreadListLock, kBreakpointInvokeLock, kDeoptimizationLock, @@ -561,8 +561,11 @@ class Locks { // attaching and detaching. static Mutex* thread_list_lock_ ACQUIRED_AFTER(trace_lock_); + // Guards maintaining loading library data structures. + static Mutex* jni_libraries_lock_ ACQUIRED_AFTER(thread_list_lock_); + // Guards breakpoints. - static Mutex* breakpoint_lock_ ACQUIRED_AFTER(thread_list_lock_); + static Mutex* breakpoint_lock_ ACQUIRED_AFTER(jni_libraries_lock_); // Guards lists of classes within the class linker. static ReaderWriterMutex* classlinker_classes_lock_ ACQUIRED_AFTER(breakpoint_lock_); |