hotspot/src/share/vm/gc_implementation/g1/vm_operations_g1.cpp
changeset 29079 832d35c45d0b
parent 29078 3b7dd035c20b
child 30147 af9a41999c6e
equal deleted inserted replaced
29078:3b7dd035c20b 29079:832d35c45d0b
    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.
   161     }
   161     }
   162   }
   162   }
   163 }
   163 }
   164 
   164 
   165 void VM_G1IncCollectionPause::doit_epilogue() {
   165 void VM_G1IncCollectionPause::doit_epilogue() {
   166   VM_GC_Operation::doit_epilogue();
   166   VM_G1OperationWithAllocRequest::doit_epilogue();
   167 
   167 
   168   // If the pause was initiated by a System.gc() and
   168   // If the pause was initiated by a System.gc() and
   169   // +ExplicitGCInvokesConcurrent, we have to wait here for the cycle
   169   // +ExplicitGCInvokesConcurrent, we have to wait here for the cycle
   170   // that just started (or maybe one that was already in progress) to
   170   // that just started (or maybe one that was already in progress) to
   171   // finish.
   171   // finish.