--- a/hotspot/src/share/vm/memory/sharedHeap.cpp Mon Mar 30 17:21:54 2015 +0200
+++ b/hotspot/src/share/vm/memory/sharedHeap.cpp Tue Mar 31 07:54:56 2015 +0200
@@ -40,7 +40,6 @@
SharedHeap::SharedHeap(CollectorPolicy* policy_) :
CollectedHeap(),
_collector_policy(policy_),
- _strong_roots_parity(0),
_workers(NULL)
{
_sh = this; // ch is static, should be set only once.
@@ -68,26 +67,20 @@
_n_par_threads = t;
}
-void SharedHeap::change_strong_roots_parity() {
- // Also set the new collection parity.
- assert(_strong_roots_parity >= 0 && _strong_roots_parity <= 2,
- "Not in range.");
- _strong_roots_parity++;
- if (_strong_roots_parity == 3) _strong_roots_parity = 1;
- assert(_strong_roots_parity >= 1 && _strong_roots_parity <= 2,
- "Not in range.");
-}
-
SharedHeap::StrongRootsScope::StrongRootsScope(SharedHeap* heap, bool activate)
: MarkScope(activate), _sh(heap)
{
if (_active) {
- _sh->change_strong_roots_parity();
+ Threads::change_thread_claim_parity();
// Zero the claimed high water mark in the StringTable
StringTable::clear_parallel_claimed_index();
}
}
+SharedHeap::StrongRootsScope::~StrongRootsScope() {
+ Threads::assert_all_threads_claimed();
+}
+
void SharedHeap::set_barrier_set(BarrierSet* bs) {
_barrier_set = bs;
// Cached barrier set for fast access in oops