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

Print this page
rev 5869 : [mq]: free-cset-base

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2014, Oracle and/or its affiliates. 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
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -203,11 +203,11 @@
   // treat all objects as being inside the unmarked area.
   zero_marked_bytes();
   init_top_at_mark_start();
 }
 
-void HeapRegion::hr_clear(bool par, bool clear_space) {
+void HeapRegion::hr_clear(bool par, bool clear_space, bool locked) {
   assert(_humongous_type == NotHumongous,
          "we should have already filtered out humongous regions");
   assert(_humongous_start_region == NULL,
          "we should have already filtered out humongous regions");
   assert(_end == _orig_end,

@@ -221,11 +221,15 @@
   reset_pre_dummy_top();
 
   if (!par) {
     // If this is parallel, this will be done later.
     HeapRegionRemSet* hrrs = rem_set();
+    if (locked) {
+      hrrs->clear_locked();
+    } else {
     hrrs->clear();
+    }
     _claimed = InitialClaimValue;
   }
   zero_marked_bytes();
 
   _offsets.resize(HeapRegion::GrainWords);

@@ -708,11 +712,11 @@
     assert(VerifyDuringGC, "only way to get here");
     return;
   }
 
   HeapRegionRemSet* hrrs = rem_set();
-  int strong_code_roots_length = hrrs->strong_code_roots_list_length();
+  size_t strong_code_roots_length = hrrs->strong_code_roots_list_length();
 
   // if this region is empty then there should be no entries
   // on its strong code root list
   if (is_empty()) {
     if (strong_code_roots_length > 0) {