changeset 9614:d9175ed51f4c

Only mark new objects during evacuation when updating refs early (i.e. when needed).
author rkennke
date Fri, 11 Sep 2015 18:35:26 +0200
parents 9c265a9a7251
children 145927fd1e5c
files src/share/vm/gc/shenandoah/shenandoahHeap.cpp
diffstat 1 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/gc/shenandoah/shenandoahHeap.cpp	Tue Sep 08 21:00:24 2015 +0200
+++ b/src/share/vm/gc/shenandoah/shenandoahHeap.cpp	Fri Sep 11 18:35:26 2015 +0200
@@ -491,7 +491,8 @@
   HeapWord* result = allocate_memory(word_size);
 
   if (result != NULL) {
-    if (mark && (_concurrent_mark_in_progress || _evacuation_in_progress)) {
+    if (mark && (_concurrent_mark_in_progress ||
+		 (shenandoahPolicy()->update_refs_early() && _evacuation_in_progress))) {
       // We mark the whole tlab here, this way we avoid marking every single
       // allocated object. We mark it from the 2nd word, because the 1st word is always
       // the brooks ptr of the first object, and it confuses the fast marked-iterator
@@ -805,7 +806,8 @@
 #endif
 
     assert(! heap_region_containing(result)->is_in_collection_set(), "never allocate in targetted region");
-    if (_concurrent_mark_in_progress || _evacuation_in_progress) {
+    if (_concurrent_mark_in_progress ||
+	(shenandoahPolicy()->update_refs_early() && _evacuation_in_progress)) {
       mark_current_no_checks(oop(result));
     }
 
@@ -2386,7 +2388,8 @@
   assert(! obj->has_displaced_mark(), "hopefully new objects don't have displaced mark");
   // tty->print_cr("post_allocation_collector_specific_setup:: "PTR_FORMAT, p2i(obj));
 
-  if (_concurrent_mark_in_progress || _evacuation_in_progress) {
+  if (_concurrent_mark_in_progress
+      || (shenandoahPolicy()->update_refs_early() && _evacuation_in_progress)) {
     mark_current_no_checks(obj);
   }
 }
@@ -2500,7 +2503,9 @@
   if (result == (HeapWord*) p) {
     return_val = oop(copy);
 
-    mark_current(return_val);
+    if (shenandoahPolicy()->update_refs_early()) {
+      mark_current(return_val);
+    }
 
 #ifdef ASSERT
     if (ShenandoahTraceEvacuations) {