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
diff --git a/src/space_bitmap.cc b/src/space_bitmap.cc
index 7da8146..438237d 100644
--- a/src/space_bitmap.cc
+++ b/src/space_bitmap.cc
@@ -225,7 +225,8 @@
// Walk instance fields of the given Class. Separate function to allow recursion on the super
// class.
static void WalkInstanceFields(SpaceBitmap* visited, SpaceBitmap::Callback* callback, Object* obj,
- Class* klass, void* arg) {
+ Class* klass, void* arg)
+ SHARED_LOCKS_REQUIRED(GlobalSynchronization::mutator_lock_) {
// Visit fields of parent classes first.
Class* super = klass->GetSuperClass();
if (super != NULL) {
@@ -249,7 +250,8 @@
// For an unvisited object, visit it then all its children found via fields.
static void WalkFieldsInOrder(SpaceBitmap* visited, SpaceBitmap::Callback* callback, Object* obj,
- void* arg) {
+ void* arg)
+ SHARED_LOCKS_REQUIRED(GlobalSynchronization::mutator_lock_) {
if (visited->Test(obj)) {
return;
}