src/share/vm/gc_implementation/g1/vm_operations_g1.cpp

changeset 7687
af8f16ac392c
parent 7686
fb69749583e8
child 7994
04ff2f6cd0eb
child 8194
047a642c9729
equal deleted inserted replaced
7686:fb69749583e8 7687:af8f16ac392c
36 36
37 VM_G1CollectForAllocation::VM_G1CollectForAllocation(uint gc_count_before, 37 VM_G1CollectForAllocation::VM_G1CollectForAllocation(uint gc_count_before,
38 size_t word_size) 38 size_t word_size)
39 : VM_G1OperationWithAllocRequest(gc_count_before, word_size, 39 : VM_G1OperationWithAllocRequest(gc_count_before, word_size,
40 GCCause::_allocation_failure) { 40 GCCause::_allocation_failure) {
41 guarantee(word_size > 0, "an allocation should always be requested"); 41 guarantee(word_size != 0, "An allocation should always be requested with this operation.");
42 } 42 }
43 43
44 void VM_G1CollectForAllocation::doit() { 44 void VM_G1CollectForAllocation::doit() {
45 G1CollectedHeap* g1h = G1CollectedHeap::heap(); 45 G1CollectedHeap* g1h = G1CollectedHeap::heap();
46 GCCauseSetter x(g1h, _gc_cause); 46 GCCauseSetter x(g1h, _gc_cause);
71 target_pause_time_ms)); 71 target_pause_time_ms));
72 _gc_cause = gc_cause; 72 _gc_cause = gc_cause;
73 } 73 }
74 74
75 bool VM_G1IncCollectionPause::doit_prologue() { 75 bool VM_G1IncCollectionPause::doit_prologue() {
76 bool res = VM_GC_Operation::doit_prologue(); 76 bool res = VM_G1OperationWithAllocRequest::doit_prologue();
77 if (!res) { 77 if (!res) {
78 if (_should_initiate_conc_mark) { 78 if (_should_initiate_conc_mark) {
79 // The prologue can fail for a couple of reasons. The first is that another GC 79 // The prologue can fail for a couple of reasons. The first is that another GC
80 // got scheduled and prevented the scheduling of the initial mark GC. The 80 // got scheduled and prevented the scheduling of the initial mark GC. The
81 // second is that the GC locker may be active and the heap can't be expanded. 81 // second is that the GC locker may be active and the heap can't be expanded.
165 } 165 }
166 } 166 }
167 } 167 }
168 168
169 void VM_G1IncCollectionPause::doit_epilogue() { 169 void VM_G1IncCollectionPause::doit_epilogue() {
170 VM_GC_Operation::doit_epilogue(); 170 VM_G1OperationWithAllocRequest::doit_epilogue();
171 171
172 // If the pause was initiated by a System.gc() and 172 // If the pause was initiated by a System.gc() and
173 // +ExplicitGCInvokesConcurrent, we have to wait here for the cycle 173 // +ExplicitGCInvokesConcurrent, we have to wait here for the cycle
174 // that just started (or maybe one that was already in progress) to 174 // that just started (or maybe one that was already in progress) to
175 // finish. 175 // finish.

mercurial