diff src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp @ 356:1ee8caae33af

Merge
author tonyp
date Thu, 21 Aug 2008 23:36:31 -0400
parents 850fdf70db2b
children c96030fff130
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp	Wed Aug 06 11:57:31 2008 -0400
+++ b/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp	Thu Aug 21 23:36:31 2008 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2007 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2002-2008 Sun Microsystems, Inc.  All Rights Reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -265,6 +265,11 @@
     young_gen->eden_space()->accumulate_statistics();
   }
 
+  if (ZapUnusedHeapArea) {
+    // Save information needed to minimize mangling
+    heap->record_gen_tops_before_GC();
+  }
+
   if (PrintHeapAtGC) {
     Universe::print_heap_before_gc();
   }
@@ -315,7 +320,7 @@
     if (!ScavengeWithObjectsInToSpace) {
       assert(young_gen->to_space()->is_empty(),
              "Attempt to scavenge with live objects in to_space");
-      young_gen->to_space()->clear();
+      young_gen->to_space()->clear(SpaceDecorator::Mangle);
     } else if (ZapUnusedHeapArea) {
       young_gen->to_space()->mangle_unused_area();
     }
@@ -437,8 +442,10 @@
 
     if (!promotion_failure_occurred) {
       // Swap the survivor spaces.
-      young_gen->eden_space()->clear();
-      young_gen->from_space()->clear();
+
+
+      young_gen->eden_space()->clear(SpaceDecorator::Mangle);
+      young_gen->from_space()->clear(SpaceDecorator::Mangle);
       young_gen->swap_spaces();
 
       size_t survived = young_gen->from_space()->used_in_bytes();
@@ -600,6 +607,12 @@
     Universe::print_heap_after_gc();
   }
 
+  if (ZapUnusedHeapArea) {
+    young_gen->eden_space()->check_mangled_unused_area_complete();
+    young_gen->from_space()->check_mangled_unused_area_complete();
+    young_gen->to_space()->check_mangled_unused_area_complete();
+  }
+
   scavenge_exit.update();
 
   if (PrintGCTaskTimeStamps) {