< prev index next >
src/share/vm/gc/shared/genCollectedHeap.cpp
Print this page
*** 559,578 ****
HeapWord* GenCollectedHeap::satisfy_failed_allocation(size_t size, bool is_tlab) {
return collector_policy()->satisfy_failed_allocation(size, is_tlab);
}
- void GenCollectedHeap::set_par_threads(uint t) {
- assert(t == 0 || !UseSerialGC, "Cannot have parallel threads");
- CollectedHeap::set_par_threads(t);
- set_n_termination(t);
- }
-
- void GenCollectedHeap::set_n_termination(uint t) {
- _process_strong_tasks->set_n_threads(t);
- }
-
#ifdef ASSERT
class AssertNonScavengableClosure: public OopClosure {
public:
virtual void do_oop(oop* p) {
assert(!GenCollectedHeap::heap()->is_in_partial_collection(*p),
--- 559,568 ----
*** 580,598 ****
virtual void do_oop(narrowOop* p) { ShouldNotReachHere(); }
};
static AssertNonScavengableClosure assert_is_non_scavengable_closure;
#endif
! void GenCollectedHeap::process_roots(bool activate_scope,
ScanningOption so,
OopClosure* strong_roots,
OopClosure* weak_roots,
CLDClosure* strong_cld_closure,
CLDClosure* weak_cld_closure,
CodeBlobClosure* code_roots) {
- StrongRootsScope srs(activate_scope);
-
// General roots.
assert(Threads::thread_claim_parity() != 0, "must have called prologue code");
assert(code_roots != NULL, "code root closure should always be set");
// _n_termination for _process_strong_tasks should be set up stream
// in a method not running in a GC worker. Otherwise the GC worker
--- 570,586 ----
virtual void do_oop(narrowOop* p) { ShouldNotReachHere(); }
};
static AssertNonScavengableClosure assert_is_non_scavengable_closure;
#endif
! void GenCollectedHeap::process_roots(StrongRootsScope* scope,
ScanningOption so,
OopClosure* strong_roots,
OopClosure* weak_roots,
CLDClosure* strong_cld_closure,
CLDClosure* weak_cld_closure,
CodeBlobClosure* code_roots) {
// General roots.
assert(Threads::thread_claim_parity() != 0, "must have called prologue code");
assert(code_roots != NULL, "code root closure should always be set");
// _n_termination for _process_strong_tasks should be set up stream
// in a method not running in a GC worker. Otherwise the GC worker
*** 607,617 ****
// Don't process them if they will be processed during the ClassLoaderDataGraph phase.
CLDClosure* roots_from_clds_p = (strong_cld_closure != weak_cld_closure) ? strong_cld_closure : NULL;
// Only process code roots from thread stacks if we aren't visiting the entire CodeCache anyway
CodeBlobClosure* roots_from_code_p = (so & SO_AllCodeCache) ? NULL : code_roots;
! bool is_par = n_par_threads() > 0;
Threads::possibly_parallel_oops_do(is_par, strong_roots, roots_from_clds_p, roots_from_code_p);
if (!_process_strong_tasks->is_task_claimed(GCH_PS_Universe_oops_do)) {
Universe::oops_do(strong_roots);
}
--- 595,605 ----
// Don't process them if they will be processed during the ClassLoaderDataGraph phase.
CLDClosure* roots_from_clds_p = (strong_cld_closure != weak_cld_closure) ? strong_cld_closure : NULL;
// Only process code roots from thread stacks if we aren't visiting the entire CodeCache anyway
CodeBlobClosure* roots_from_code_p = (so & SO_AllCodeCache) ? NULL : code_roots;
! bool is_par = scope->n_threads() > 1;
Threads::possibly_parallel_oops_do(is_par, strong_roots, roots_from_clds_p, roots_from_code_p);
if (!_process_strong_tasks->is_task_claimed(GCH_PS_Universe_oops_do)) {
Universe::oops_do(strong_roots);
}
*** 667,679 ****
DEBUG_ONLY(CodeCache::asserted_non_scavengable_nmethods_do(&assert_code_is_non_scavengable));
}
}
! void GenCollectedHeap::gen_process_roots(int level,
bool younger_gens_as_roots,
- bool activate_scope,
ScanningOption so,
bool only_strong_roots,
OopsInGenClosure* not_older_gens,
OopsInGenClosure* older_gens,
CLDClosure* cld_closure) {
--- 655,667 ----
DEBUG_ONLY(CodeCache::asserted_non_scavengable_nmethods_do(&assert_code_is_non_scavengable));
}
}
! void GenCollectedHeap::gen_process_roots(StrongRootsScope* scope,
! int level,
bool younger_gens_as_roots,
ScanningOption so,
bool only_strong_roots,
OopsInGenClosure* not_older_gens,
OopsInGenClosure* older_gens,
CLDClosure* cld_closure) {
*** 687,697 ****
MarkingCodeBlobClosure mark_code_closure(not_older_gens, is_moving_collection);
OopsInGenClosure* weak_roots = only_strong_roots ? NULL : not_older_gens;
CLDClosure* weak_cld_closure = only_strong_roots ? NULL : cld_closure;
! process_roots(activate_scope, so,
not_older_gens, weak_roots,
cld_closure, weak_cld_closure,
&mark_code_closure);
if (younger_gens_as_roots) {
--- 675,685 ----
MarkingCodeBlobClosure mark_code_closure(not_older_gens, is_moving_collection);
OopsInGenClosure* weak_roots = only_strong_roots ? NULL : not_older_gens;
CLDClosure* weak_cld_closure = only_strong_roots ? NULL : cld_closure;
! process_roots(scope, so,
not_older_gens, weak_roots,
cld_closure, weak_cld_closure,
&mark_code_closure);
if (younger_gens_as_roots) {
*** 705,719 ****
}
// When collection is parallel, all threads get to cooperate to do
// older-gen scanning.
if (level == 0) {
older_gens->set_generation(_old_gen);
! rem_set()->younger_refs_iterate(_old_gen, older_gens);
older_gens->reset_generation();
}
! _process_strong_tasks->all_tasks_completed();
}
class AlwaysTrueClosure: public BoolObjectClosure {
public:
--- 693,707 ----
}
// When collection is parallel, all threads get to cooperate to do
// older-gen scanning.
if (level == 0) {
older_gens->set_generation(_old_gen);
! rem_set()->younger_refs_iterate(_old_gen, older_gens, scope->n_threads());
older_gens->reset_generation();
}
! _process_strong_tasks->all_tasks_completed(scope->n_threads());
}
class AlwaysTrueClosure: public BoolObjectClosure {
public:
< prev index next >