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/indirect_reference_table.h b/src/indirect_reference_table.h
index 710e43f..c3e17b0 100644
--- a/src/indirect_reference_table.h
+++ b/src/indirect_reference_table.h
@@ -257,7 +257,8 @@
* Returns NULL if the table is full (max entries reached, or alloc
* failed during expansion).
*/
- IndirectRef Add(uint32_t cookie, const Object* obj);
+ IndirectRef Add(uint32_t cookie, const Object* obj)
+ SHARED_LOCKS_REQUIRED(GlobalSynchronization::mutator_lock_);
/*
* Given an IndirectRef in the table, return the Object it refers to.
@@ -287,7 +288,7 @@
void AssertEmpty();
- void Dump(std::ostream& os) const;
+ void Dump(std::ostream& os) const SHARED_LOCKS_REQUIRED(GlobalSynchronization::mutator_lock_);
/*
* Return the #of entries in the entire table. This includes holes, and