< prev index next >

src/share/vm/gc/shenandoah/vm_operations_shenandoah.cpp

Print this page
rev 13068 : [mq]: partial.patch

@@ -24,10 +24,11 @@
 #include "gc/shared/gcTraceTime.inline.hpp"
 #include "gc/shenandoah/shenandoahCollectorPolicy.hpp"
 #include "gc/shenandoah/shenandoahMarkCompact.hpp"
 #include "gc/shenandoah/shenandoahConcurrentMark.inline.hpp"
 #include "gc/shenandoah/shenandoahHeap.inline.hpp"
+#include "gc/shenandoah/shenandoahPartialGC.hpp"
 #include "gc/shenandoah/shenandoahWorkGroup.hpp"
 #include "gc/shenandoah/vm_operations_shenandoah.hpp"
 
 void VM_ShenandoahInitMark::doit() {
   GCIdMark gc_id_mark(_gc_id);

@@ -58,17 +59,19 @@
 
 }
 
 void VM_ShenandoahFullGC::doit() {
   GCIdMark gc_id_mark(_gc_id);
-  ShenandoahMarkCompact::do_mark_compact(_gc_cause);
   ShenandoahHeap *sh = ShenandoahHeap::heap();
+  sh->shenandoahPolicy()->record_gc_start();
+  ShenandoahMarkCompact::do_mark_compact(_gc_cause);
   if (UseTLAB) {
     sh->shenandoahPolicy()->record_phase_start(ShenandoahCollectorPolicy::resize_tlabs);
     sh->resize_all_tlabs();
     sh->shenandoahPolicy()->record_phase_end(ShenandoahCollectorPolicy::resize_tlabs);
   }
+  sh->shenandoahPolicy()->record_gc_end();
 }
 
 bool VM_ShenandoahReferenceOperation::doit_prologue() {
   Heap_lock->lock();
   return true;

@@ -82,14 +85,16 @@
 }
 
 void VM_ShenandoahStartEvacuation::doit() {
   GCIdMark gc_id_mark(_gc_id);
 
+  ShenandoahHeap *sh = ShenandoahHeap::heap();
+  sh->shenandoahPolicy()->record_gc_start();
+
   // It is critical that we
   // evacuate roots right after finishing marking, so that we don't
   // get unmarked objects in the roots.
-  ShenandoahHeap *sh = ShenandoahHeap::heap();
   // Setup workers for final marking
   WorkGang* workers = sh->workers();
   uint n_workers = ShenandoahCollectorPolicy::calc_workers_for_final_marking(workers->active_workers(),
     Threads::number_of_non_daemon_threads());
   ShenandoahWorkerScope scope(workers, n_workers);

@@ -119,10 +124,20 @@
   } else {
     GCTraceTime(Info, gc) time("Cancel Concurrent Mark", sh->gc_timer(), GCCause::_no_gc, true);
     sh->concurrentMark()->cancel();
     sh->stop_concurrent_marking();
   }
+
+  sh->shenandoahPolicy()->record_gc_end();
+}
+
+void VM_ShenandoahPartialGC::doit() {
+  GCIdMark gc_id_mark(_gc_id);
+  ShenandoahHeap *sh = ShenandoahHeap::heap();
+  sh->shenandoahPolicy()->record_gc_start();
+  ShenandoahHeap::heap()->do_partial_collection();
+  sh->shenandoahPolicy()->record_gc_end();
 }
 
 void VM_ShenandoahVerifyHeapAfterEvacuation::doit() {
   GCIdMark gc_id_mark(_gc_id);
   ShenandoahHeap *sh = ShenandoahHeap::heap();
< prev index next >