8156500: Move Reference pending list into VM to prevent deadlocks

Move reference pending list and locking into VM

Co-authored-by: Per Liden <per.liden@oracle.com>
Reviewed-by: coleenp, dholmes, dcubed, mchung, plevart
This commit is contained in:
Kim Barrett 2016-08-30 23:48:16 -04:00
parent 4f55b6c7e0
commit 66706edf15
29 changed files with 133 additions and 576 deletions

View file

@ -185,6 +185,9 @@ class Universe: AllStatic {
static oop _allocation_context_notification_obj;
// References waiting to be transferred to the ReferenceHandler
static oop _reference_pending_list;
// The particular choice of collected heap.
static CollectedHeap* _collectedHeap;
@ -334,6 +337,17 @@ class Universe: AllStatic {
static inline oop allocation_context_notification_obj();
static inline void set_allocation_context_notification_obj(oop obj);
// Reference pending list manipulation. Access is protected by
// Heap_lock. The getter, setter and predicate require the caller
// owns the lock. Swap is used by parallel non-concurrent reference
// processing threads, where some higher level controller owns
// Heap_lock, so requires the lock is locked, but not necessarily by
// the current thread.
static oop reference_pending_list();
static void set_reference_pending_list(oop list);
static bool has_reference_pending_list();
static oop swap_reference_pending_list(oop list);
static Array<int>* the_empty_int_array() { return _the_empty_int_array; }
static Array<u2>* the_empty_short_array() { return _the_empty_short_array; }
static Array<Method*>* the_empty_method_array() { return _the_empty_method_array; }