19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_GC_IMPLEMENTATION_G1_VM_OPERATIONS_G1_HPP
26 #define SHARE_VM_GC_IMPLEMENTATION_G1_VM_OPERATIONS_G1_HPP
27
28 #include "gc_implementation/g1/g1AllocationContext.hpp"
29 #include "gc_implementation/shared/vmGCOperations.hpp"
30
31 // VM_operations for the G1 collector.
32 // VM_GC_Operation:
33 // - VM_CGC_Operation
34 // - VM_G1CollectFull
35 // - VM_G1OperationWithAllocRequest
36 // - VM_G1CollectForAllocation
37 // - VM_G1IncCollectionPause
38
39 class VM_G1OperationWithAllocRequest: public VM_GC_Operation {
40 protected:
41 size_t _word_size;
42 HeapWord* _result;
43 bool _pause_succeeded;
44 AllocationContext_t _allocation_context;
45
46 public:
47 VM_G1OperationWithAllocRequest(uint gc_count_before,
48 size_t word_size,
49 GCCause::Cause gc_cause)
50 : VM_GC_Operation(gc_count_before, gc_cause),
51 _word_size(word_size), _result(NULL), _pause_succeeded(false) { }
52 HeapWord* result() { return _result; }
53 bool pause_succeeded() { return _pause_succeeded; }
54 void set_allocation_context(AllocationContext_t context) { _allocation_context = context; }
55 AllocationContext_t allocation_context() { return _allocation_context; }
56 };
57
58 class VM_G1CollectFull: public VM_GC_Operation {
59 public:
60 VM_G1CollectFull(uint gc_count_before,
61 uint full_gc_count_before,
62 GCCause::Cause cause)
63 : VM_GC_Operation(gc_count_before, cause, full_gc_count_before, true) { }
64 virtual VMOp_Type type() const { return VMOp_G1CollectFull; }
65 virtual void doit();
66 virtual const char* name() const {
67 return "full garbage-first collection";
68 }
69 };
70
71 class VM_G1CollectForAllocation: public VM_G1OperationWithAllocRequest {
72 public:
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_GC_IMPLEMENTATION_G1_VM_OPERATIONS_G1_HPP
26 #define SHARE_VM_GC_IMPLEMENTATION_G1_VM_OPERATIONS_G1_HPP
27
28 #include "gc_implementation/g1/g1AllocationContext.hpp"
29 #include "gc_implementation/shared/vmGCOperations.hpp"
30
31 // VM_operations for the G1 collector.
32 // VM_GC_Operation:
33 // - VM_CGC_Operation
34 // - VM_G1CollectFull
35 // - VM_G1OperationWithAllocRequest
36 // - VM_G1CollectForAllocation
37 // - VM_G1IncCollectionPause
38
39 class VM_G1OperationWithAllocRequest : public VM_CollectForAllocation {
40 protected:
41 bool _pause_succeeded;
42 AllocationContext_t _allocation_context;
43
44 public:
45 VM_G1OperationWithAllocRequest(uint gc_count_before,
46 size_t word_size,
47 GCCause::Cause gc_cause)
48 : VM_CollectForAllocation(word_size, gc_count_before, gc_cause),
49 _pause_succeeded(false) {}
50 bool pause_succeeded() { return _pause_succeeded; }
51 void set_allocation_context(AllocationContext_t context) { _allocation_context = context; }
52 AllocationContext_t allocation_context() { return _allocation_context; }
53 };
54
55 class VM_G1CollectFull: public VM_GC_Operation {
56 public:
57 VM_G1CollectFull(uint gc_count_before,
58 uint full_gc_count_before,
59 GCCause::Cause cause)
60 : VM_GC_Operation(gc_count_before, cause, full_gc_count_before, true) { }
61 virtual VMOp_Type type() const { return VMOp_G1CollectFull; }
62 virtual void doit();
63 virtual const char* name() const {
64 return "full garbage-first collection";
65 }
66 };
67
68 class VM_G1CollectForAllocation: public VM_G1OperationWithAllocRequest {
69 public:
|