108 // Acquire the reference synchronization lock 109 virtual bool doit_prologue(); 110 // Do notifyAll (if needed) and release held lock 111 virtual void doit_epilogue(); 112 113 virtual bool allow_nested_vm_operations() const { return true; } 114 bool prologue_succeeded() const { return _prologue_succeeded; } 115 116 void set_gc_locked() { _gc_locked = true; } 117 bool gc_locked() const { return _gc_locked; } 118 119 static void notify_gc_begin(bool full = false); 120 static void notify_gc_end(); 121 }; 122 123 124 class VM_GC_HeapInspection: public VM_GC_Operation { 125 private: 126 outputStream* _out; 127 bool _full_gc; 128 public: 129 VM_GC_HeapInspection(outputStream* out, bool request_full_gc) : 130 VM_GC_Operation(0 /* total collections, dummy, ignored */, 131 GCCause::_heap_inspection /* GC Cause */, 132 0 /* total full collections, dummy, ignored */, 133 request_full_gc), _out(out), _full_gc(request_full_gc) {} 134 135 ~VM_GC_HeapInspection() {} 136 virtual VMOp_Type type() const { return VMOp_GC_HeapInspection; } 137 virtual bool skip_operation() const; 138 virtual void doit(); 139 protected: 140 bool collect(); 141 }; 142 143 class VM_CollectForAllocation : public VM_GC_Operation { 144 protected: 145 size_t _word_size; // Size of object to be allocated (in number of words) 146 HeapWord* _result; // Allocation result (NULL if allocation failed) 147 148 public: 149 VM_CollectForAllocation(size_t word_size, uint gc_count_before, GCCause::Cause cause); 150 151 HeapWord* result() const { 152 return _result; 153 } | 108 // Acquire the reference synchronization lock 109 virtual bool doit_prologue(); 110 // Do notifyAll (if needed) and release held lock 111 virtual void doit_epilogue(); 112 113 virtual bool allow_nested_vm_operations() const { return true; } 114 bool prologue_succeeded() const { return _prologue_succeeded; } 115 116 void set_gc_locked() { _gc_locked = true; } 117 bool gc_locked() const { return _gc_locked; } 118 119 static void notify_gc_begin(bool full = false); 120 static void notify_gc_end(); 121 }; 122 123 124 class VM_GC_HeapInspection: public VM_GC_Operation { 125 private: 126 outputStream* _out; 127 bool _full_gc; 128 uint _parallel_thread_num; 129 public: 130 VM_GC_HeapInspection(outputStream* out, bool request_full_gc, 131 uint parallel_thread_num = 1) : 132 VM_GC_Operation(0 /* total collections, dummy, ignored */, 133 GCCause::_heap_inspection /* GC Cause */, 134 0 /* total full collections, dummy, ignored */, 135 request_full_gc), _out(out), _full_gc(request_full_gc), 136 _parallel_thread_num(parallel_thread_num) {} 137 138 ~VM_GC_HeapInspection() {} 139 virtual VMOp_Type type() const { return VMOp_GC_HeapInspection; } 140 virtual bool skip_operation() const; 141 virtual void doit(); 142 protected: 143 bool collect(); 144 }; 145 146 class VM_CollectForAllocation : public VM_GC_Operation { 147 protected: 148 size_t _word_size; // Size of object to be allocated (in number of words) 149 HeapWord* _result; // Allocation result (NULL if allocation failed) 150 151 public: 152 VM_CollectForAllocation(size_t word_size, uint gc_count_before, GCCause::Cause cause); 153 154 HeapWord* result() const { 155 return _result; 156 } |