comparison src/share/vm/gc_implementation/g1/vm_operations_g1.hpp @ 1656:4e5661ba9d98

6944166: G1: explicit GCs are not always handled correctly Summary: G1 was not handling explicit GCs correctly in many ways. It does now. See the CR for the list of improvements contained in this changeset. Reviewed-by: iveresov, ysr, johnc
author tonyp
date Mon, 28 Jun 2010 14:13:17 -0400
parents c18cbe5936b8
children f95d63e2154a
comparison
equal deleted inserted replaced
1655:e7ec8cd4dd8a 1656:4e5661ba9d98
29 // - VM_G1CollectForAllocation 29 // - VM_G1CollectForAllocation
30 // - VM_G1IncCollectionPause 30 // - VM_G1IncCollectionPause
31 // - VM_G1PopRegionCollectionPause 31 // - VM_G1PopRegionCollectionPause
32 32
33 class VM_G1CollectFull: public VM_GC_Operation { 33 class VM_G1CollectFull: public VM_GC_Operation {
34 private:
35 public: 34 public:
36 VM_G1CollectFull(int gc_count_before, 35 VM_G1CollectFull(unsigned int gc_count_before,
37 GCCause::Cause gc_cause) 36 unsigned int full_gc_count_before,
38 : VM_GC_Operation(gc_count_before) 37 GCCause::Cause cause)
39 { 38 : VM_GC_Operation(gc_count_before, full_gc_count_before) {
40 _gc_cause = gc_cause; 39 _gc_cause = cause;
41 } 40 }
42 ~VM_G1CollectFull() {} 41 ~VM_G1CollectFull() {}
43 virtual VMOp_Type type() const { return VMOp_G1CollectFull; } 42 virtual VMOp_Type type() const { return VMOp_G1CollectFull; }
44 virtual void doit(); 43 virtual void doit();
45 virtual const char* name() const { 44 virtual const char* name() const {
65 } 64 }
66 HeapWord* result() { return _res; } 65 HeapWord* result() { return _res; }
67 }; 66 };
68 67
69 class VM_G1IncCollectionPause: public VM_GC_Operation { 68 class VM_G1IncCollectionPause: public VM_GC_Operation {
70 public: 69 private:
71 VM_G1IncCollectionPause(int gc_count_before, 70 bool _should_initiate_conc_mark;
72 GCCause::Cause gc_cause = GCCause::_g1_inc_collection_pause) : 71 double _target_pause_time_ms;
73 VM_GC_Operation(gc_count_before) { _gc_cause = gc_cause; } 72 unsigned int _full_collections_completed_before;
73 public:
74 VM_G1IncCollectionPause(unsigned int gc_count_before,
75 bool should_initiate_conc_mark,
76 double target_pause_time_ms,
77 GCCause::Cause cause)
78 : VM_GC_Operation(gc_count_before),
79 _full_collections_completed_before(0),
80 _should_initiate_conc_mark(should_initiate_conc_mark),
81 _target_pause_time_ms(target_pause_time_ms) {
82 guarantee(target_pause_time_ms > 0.0,
83 err_msg("target_pause_time_ms = %1.6lf should be positive",
84 target_pause_time_ms));
85
86 _gc_cause = cause;
87 }
74 virtual VMOp_Type type() const { return VMOp_G1IncCollectionPause; } 88 virtual VMOp_Type type() const { return VMOp_G1IncCollectionPause; }
75 virtual void doit(); 89 virtual void doit();
90 virtual void doit_epilogue();
76 virtual const char* name() const { 91 virtual const char* name() const {
77 return "garbage-first incremental collection pause"; 92 return "garbage-first incremental collection pause";
78 } 93 }
79 }; 94 };
80 95