23 */ |
23 */ |
24 |
24 |
25 #ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_VMGCOPERATIONS_HPP |
25 #ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_VMGCOPERATIONS_HPP |
26 #define SHARE_VM_GC_IMPLEMENTATION_SHARED_VMGCOPERATIONS_HPP |
26 #define SHARE_VM_GC_IMPLEMENTATION_SHARED_VMGCOPERATIONS_HPP |
27 |
27 |
|
28 #include "gc_implementation/shared/gcId.hpp" |
28 #include "memory/heapInspection.hpp" |
29 #include "memory/heapInspection.hpp" |
29 #include "runtime/handles.hpp" |
30 #include "runtime/handles.hpp" |
30 #include "runtime/jniHandles.hpp" |
31 #include "runtime/jniHandles.hpp" |
31 #include "runtime/synchronizer.hpp" |
32 #include "runtime/synchronizer.hpp" |
32 #include "runtime/vm_operations.hpp" |
33 #include "runtime/vm_operations.hpp" |
166 protected: |
167 protected: |
167 size_t _word_size; // Size of object to be allocated (in number of words) |
168 size_t _word_size; // Size of object to be allocated (in number of words) |
168 HeapWord* _result; // Allocation result (NULL if allocation failed) |
169 HeapWord* _result; // Allocation result (NULL if allocation failed) |
169 |
170 |
170 public: |
171 public: |
171 VM_CollectForAllocation(size_t word_size, uint gc_count_before, GCCause::Cause cause) |
172 VM_CollectForAllocation(size_t word_size, uint gc_count_before, GCCause::Cause cause); |
172 : VM_GC_Operation(gc_count_before, cause), _result(NULL), _word_size(word_size) {} |
|
173 |
173 |
174 HeapWord* result() const { |
174 HeapWord* result() const { |
175 return _result; |
175 return _result; |
176 } |
176 } |
177 }; |
177 }; |
218 public: |
218 public: |
219 VM_CollectForMetadataAllocation(ClassLoaderData* loader_data, |
219 VM_CollectForMetadataAllocation(ClassLoaderData* loader_data, |
220 size_t size, Metaspace::MetadataType mdtype, |
220 size_t size, Metaspace::MetadataType mdtype, |
221 uint gc_count_before, |
221 uint gc_count_before, |
222 uint full_gc_count_before, |
222 uint full_gc_count_before, |
223 GCCause::Cause gc_cause) |
223 GCCause::Cause gc_cause); |
224 : VM_GC_Operation(gc_count_before, gc_cause, full_gc_count_before, true), |
|
225 _loader_data(loader_data), _size(size), _mdtype(mdtype), _result(NULL) { |
|
226 } |
|
227 virtual VMOp_Type type() const { return VMOp_CollectForMetadataAllocation; } |
224 virtual VMOp_Type type() const { return VMOp_CollectForMetadataAllocation; } |
228 virtual void doit(); |
225 virtual void doit(); |
229 MetaWord* result() const { return _result; } |
226 MetaWord* result() const { return _result; } |
230 |
227 |
231 bool initiate_concurrent_GC(); |
228 bool initiate_concurrent_GC(); |