< prev index next >

src/share/vm/gc/g1/heapRegion.inline.hpp

Print this page
rev 11545 : [mq]: 8159978-collection-set-as-array
   1 /*
   2  * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 211 inline void HeapRegion::note_end_of_copying(bool during_initial_mark) {
 212   if (is_survivor()) {
 213     // This is how we always allocate survivors.
 214     assert(_next_top_at_mark_start == bottom(), "invariant");
 215   } else {
 216     if (during_initial_mark) {
 217       // See the comment for note_start_of_copying() for the details
 218       // on this.
 219       assert(_next_top_at_mark_start == end(), "pre-condition");
 220       _next_top_at_mark_start = top();
 221     } else {
 222       // See the comment for note_start_of_copying() for the details
 223       // on this.
 224       assert(top() >= _next_top_at_mark_start, "invariant");
 225     }
 226   }
 227 }
 228 
 229 inline bool HeapRegion::in_collection_set() const {
 230   return G1CollectedHeap::heap()->is_in_cset(this);
 231 }
 232 
 233 inline HeapRegion* HeapRegion::next_in_collection_set() const {
 234   assert(in_collection_set(), "should only invoke on member of CS.");
 235   assert(_next_in_special_set == NULL ||
 236          _next_in_special_set->in_collection_set(),
 237          "Malformed CS.");
 238   return _next_in_special_set;
 239 }
 240 
 241 void HeapRegion::set_next_in_collection_set(HeapRegion* r) {
 242   assert(in_collection_set(), "should only invoke on member of CS.");
 243   assert(r == NULL || r->in_collection_set(), "Malformed CS.");
 244   _next_in_special_set = r;
 245 }
 246 
 247 #endif // SHARE_VM_GC_G1_HEAPREGION_INLINE_HPP
   1 /*
   2  * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 211 inline void HeapRegion::note_end_of_copying(bool during_initial_mark) {
 212   if (is_survivor()) {
 213     // This is how we always allocate survivors.
 214     assert(_next_top_at_mark_start == bottom(), "invariant");
 215   } else {
 216     if (during_initial_mark) {
 217       // See the comment for note_start_of_copying() for the details
 218       // on this.
 219       assert(_next_top_at_mark_start == end(), "pre-condition");
 220       _next_top_at_mark_start = top();
 221     } else {
 222       // See the comment for note_start_of_copying() for the details
 223       // on this.
 224       assert(top() >= _next_top_at_mark_start, "invariant");
 225     }
 226   }
 227 }
 228 
 229 inline bool HeapRegion::in_collection_set() const {
 230   return G1CollectedHeap::heap()->is_in_cset(this);














 231 }
 232 
 233 #endif // SHARE_VM_GC_G1_HEAPREGION_INLINE_HPP
< prev index next >