43 #include "gc/shared/referencePolicy.hpp"
44 #include "gc/shared/space.hpp"
45 #include "gc/shared/strongRootsScope.hpp"
46 #include "gc/shared/weakProcessor.hpp"
47 #include "oops/instanceRefKlass.hpp"
48 #include "oops/oop.inline.hpp"
49 #include "prims/jvmtiExport.hpp"
50 #include "runtime/handles.inline.hpp"
51 #include "runtime/synchronizer.hpp"
52 #include "runtime/thread.inline.hpp"
53 #include "runtime/vmThread.hpp"
54 #include "utilities/copy.hpp"
55 #include "utilities/events.hpp"
56 #include "utilities/stack.inline.hpp"
57
58 void GenMarkSweep::invoke_at_safepoint(ReferenceProcessor* rp, bool clear_all_softrefs) {
59 assert(SafepointSynchronize::is_at_safepoint(), "must be at a safepoint");
60
61 GenCollectedHeap* gch = GenCollectedHeap::heap();
62 #ifdef ASSERT
63 if (gch->collector_policy()->should_clear_all_soft_refs()) {
64 assert(clear_all_softrefs, "Policy should have been checked earlier");
65 }
66 #endif
67
68 // hook up weak ref data so it can be used during Mark-Sweep
69 assert(ref_processor() == NULL, "no stomping");
70 assert(rp != NULL, "should be non-NULL");
71 set_ref_processor(rp);
72 rp->setup_policy(clear_all_softrefs);
73
74 gch->trace_heap_before_gc(_gc_tracer);
75
76 // When collecting the permanent generation Method*s may be moving,
77 // so we either have to flush all bcp data or convert it into bci.
78 CodeCache::gc_prologue();
79
80 // Increment the invocation count
81 _total_invocations++;
82
83 // Capture used regions for each generation that will be
|
43 #include "gc/shared/referencePolicy.hpp"
44 #include "gc/shared/space.hpp"
45 #include "gc/shared/strongRootsScope.hpp"
46 #include "gc/shared/weakProcessor.hpp"
47 #include "oops/instanceRefKlass.hpp"
48 #include "oops/oop.inline.hpp"
49 #include "prims/jvmtiExport.hpp"
50 #include "runtime/handles.inline.hpp"
51 #include "runtime/synchronizer.hpp"
52 #include "runtime/thread.inline.hpp"
53 #include "runtime/vmThread.hpp"
54 #include "utilities/copy.hpp"
55 #include "utilities/events.hpp"
56 #include "utilities/stack.inline.hpp"
57
58 void GenMarkSweep::invoke_at_safepoint(ReferenceProcessor* rp, bool clear_all_softrefs) {
59 assert(SafepointSynchronize::is_at_safepoint(), "must be at a safepoint");
60
61 GenCollectedHeap* gch = GenCollectedHeap::heap();
62 #ifdef ASSERT
63 if (gch->soft_ref_policy()->should_clear_all_soft_refs()) {
64 assert(clear_all_softrefs, "Policy should have been checked earlier");
65 }
66 #endif
67
68 // hook up weak ref data so it can be used during Mark-Sweep
69 assert(ref_processor() == NULL, "no stomping");
70 assert(rp != NULL, "should be non-NULL");
71 set_ref_processor(rp);
72 rp->setup_policy(clear_all_softrefs);
73
74 gch->trace_heap_before_gc(_gc_tracer);
75
76 // When collecting the permanent generation Method*s may be moving,
77 // so we either have to flush all bcp data or convert it into bci.
78 CodeCache::gc_prologue();
79
80 // Increment the invocation count
81 _total_invocations++;
82
83 // Capture used regions for each generation that will be
|