8076314: Remove the static instance variable SharedHeap:: _sh

Reviewed-by: pliden, jmasa
This commit is contained in:
Bengt Rutisson 2015-04-02 06:42:24 +02:00
parent 473bf6175f
commit bedce0572a
17 changed files with 33 additions and 88 deletions

View file

@ -754,13 +754,9 @@ bool Thread::claim_oops_do_par_case(int strong_roots_parity) {
return true;
} else {
guarantee(res == strong_roots_parity, "Or else what?");
assert(SharedHeap::heap()->workers()->active_workers() > 0,
"Should only fail when parallel.");
return false;
}
}
assert(SharedHeap::heap()->workers()->active_workers() > 0,
"Should only fail when parallel.");
return false;
}
@ -4066,20 +4062,7 @@ void Threads::assert_all_threads_claimed() {
}
#endif // PRODUCT
void Threads::possibly_parallel_oops_do(OopClosure* f, CLDClosure* cld_f, CodeBlobClosure* cf) {
// Introduce a mechanism allowing parallel threads to claim threads as
// root groups. Overhead should be small enough to use all the time,
// even in sequential code.
SharedHeap* sh = SharedHeap::heap();
// Cannot yet substitute active_workers for n_par_threads
// because of G1CollectedHeap::verify() use of
// SharedHeap::process_roots(). n_par_threads == 0 will
// turn off parallelism in process_roots while active_workers
// is being used for parallelism elsewhere.
bool is_par = sh->n_par_threads() > 0;
assert(!is_par ||
(SharedHeap::heap()->n_par_threads() ==
SharedHeap::heap()->workers()->active_workers()), "Mismatch");
void Threads::possibly_parallel_oops_do(bool is_par, OopClosure* f, CLDClosure* cld_f, CodeBlobClosure* cf) {
int cp = Threads::thread_claim_parity();
ALL_JAVA_THREADS(p) {
if (p->claim_oops_do(is_par, cp)) {