25 #ifndef SHARE_VM_GC_G1_VM_OPERATIONS_G1_HPP |
25 #ifndef SHARE_VM_GC_G1_VM_OPERATIONS_G1_HPP |
26 #define SHARE_VM_GC_G1_VM_OPERATIONS_G1_HPP |
26 #define SHARE_VM_GC_G1_VM_OPERATIONS_G1_HPP |
27 |
27 |
28 #include "gc/g1/g1AllocationContext.hpp" |
28 #include "gc/g1/g1AllocationContext.hpp" |
29 #include "gc/shared/gcId.hpp" |
29 #include "gc/shared/gcId.hpp" |
30 #include "gc/shared/referencePendingListLocker.hpp" |
|
31 #include "gc/shared/vmGCOperations.hpp" |
30 #include "gc/shared/vmGCOperations.hpp" |
32 |
31 |
33 // VM_operations for the G1 collector. |
32 // VM_operations for the G1 collector. |
34 // VM_GC_Operation: |
33 // VM_GC_Operation: |
35 // - VM_CGC_Operation |
34 // - VM_CGC_Operation |
101 }; |
100 }; |
102 |
101 |
103 // Concurrent GC stop-the-world operations such as remark and cleanup; |
102 // Concurrent GC stop-the-world operations such as remark and cleanup; |
104 // consider sharing these with CMS's counterparts. |
103 // consider sharing these with CMS's counterparts. |
105 class VM_CGC_Operation: public VM_Operation { |
104 class VM_CGC_Operation: public VM_Operation { |
106 VoidClosure* _cl; |
105 VoidClosure* _cl; |
107 const char* _printGCMessage; |
106 const char* _printGCMessage; |
108 bool _needs_pending_list_lock; |
107 uint _gc_id; |
109 ReferencePendingListLocker _pending_list_locker; |
|
110 uint _gc_id; |
|
111 |
|
112 protected: |
|
113 // java.lang.ref.Reference support |
|
114 void acquire_pending_list_lock(); |
|
115 void release_and_notify_pending_list_lock(); |
|
116 |
108 |
117 public: |
109 public: |
118 VM_CGC_Operation(VoidClosure* cl, const char *printGCMsg, bool needs_pending_list_lock) |
110 VM_CGC_Operation(VoidClosure* cl, const char *printGCMsg) |
119 : _cl(cl), _printGCMessage(printGCMsg), _needs_pending_list_lock(needs_pending_list_lock), _gc_id(GCId::current()) {} |
111 : _cl(cl), _printGCMessage(printGCMsg), _gc_id(GCId::current()) {} |
120 virtual VMOp_Type type() const { return VMOp_CGC_Operation; } |
112 virtual VMOp_Type type() const { return VMOp_CGC_Operation; } |
121 virtual void doit(); |
113 virtual void doit(); |
122 virtual bool doit_prologue(); |
114 virtual bool doit_prologue(); |
123 virtual void doit_epilogue(); |
115 virtual void doit_epilogue(); |
124 virtual const char* name() const { |
116 virtual const char* name() const { |