44 #include "memory/referencePolicy.hpp"
45 #include "memory/space.hpp"
46 #include "oops/instanceRefKlass.hpp"
47 #include "oops/oop.inline.hpp"
48 #include "prims/jvmtiExport.hpp"
49 #include "runtime/atomic.inline.hpp"
50 #include "runtime/biasedLocking.hpp"
51 #include "runtime/fprofiler.hpp"
52 #include "runtime/synchronizer.hpp"
53 #include "runtime/thread.hpp"
54 #include "runtime/vmThread.hpp"
55 #include "utilities/copy.hpp"
56 #include "utilities/events.hpp"
57
58 class HeapRegion;
59
60 void G1MarkSweep::invoke_at_safepoint(ReferenceProcessor* rp,
61 bool clear_all_softrefs) {
62 assert(SafepointSynchronize::is_at_safepoint(), "must be at a safepoint");
63
64 SharedHeap* sh = SharedHeap::heap();
65 #ifdef ASSERT
66 if (sh->collector_policy()->should_clear_all_soft_refs()) {
67 assert(clear_all_softrefs, "Policy should have been checked earler");
68 }
69 #endif
70 // hook up weak ref data so it can be used during Mark-Sweep
71 assert(GenMarkSweep::ref_processor() == NULL, "no stomping");
72 assert(rp != NULL, "should be non-NULL");
73 assert(rp == G1CollectedHeap::heap()->ref_processor_stw(), "Precondition");
74
75 GenMarkSweep::_ref_processor = rp;
76 rp->setup_policy(clear_all_softrefs);
77
78 // When collecting the permanent generation Method*s may be moving,
79 // so we either have to flush all bcp data or convert it into bci.
80 CodeCache::gc_prologue();
81
82 bool marked_for_unloading = false;
83
84 allocate_stacks();
85
86 // We should save the marks of the currently locked biased monitors.
|
44 #include "memory/referencePolicy.hpp"
45 #include "memory/space.hpp"
46 #include "oops/instanceRefKlass.hpp"
47 #include "oops/oop.inline.hpp"
48 #include "prims/jvmtiExport.hpp"
49 #include "runtime/atomic.inline.hpp"
50 #include "runtime/biasedLocking.hpp"
51 #include "runtime/fprofiler.hpp"
52 #include "runtime/synchronizer.hpp"
53 #include "runtime/thread.hpp"
54 #include "runtime/vmThread.hpp"
55 #include "utilities/copy.hpp"
56 #include "utilities/events.hpp"
57
58 class HeapRegion;
59
60 void G1MarkSweep::invoke_at_safepoint(ReferenceProcessor* rp,
61 bool clear_all_softrefs) {
62 assert(SafepointSynchronize::is_at_safepoint(), "must be at a safepoint");
63
64 #ifdef ASSERT
65 if (G1CollectedHeap::heap()->collector_policy()->should_clear_all_soft_refs()) {
66 assert(clear_all_softrefs, "Policy should have been checked earler");
67 }
68 #endif
69 // hook up weak ref data so it can be used during Mark-Sweep
70 assert(GenMarkSweep::ref_processor() == NULL, "no stomping");
71 assert(rp != NULL, "should be non-NULL");
72 assert(rp == G1CollectedHeap::heap()->ref_processor_stw(), "Precondition");
73
74 GenMarkSweep::_ref_processor = rp;
75 rp->setup_policy(clear_all_softrefs);
76
77 // When collecting the permanent generation Method*s may be moving,
78 // so we either have to flush all bcp data or convert it into bci.
79 CodeCache::gc_prologue();
80
81 bool marked_for_unloading = false;
82
83 allocate_stacks();
84
85 // We should save the marks of the currently locked biased monitors.
|