< prev index next >

src/hotspot/share/gc/z/zLiveMap.inline.hpp

Print this page


   1 /*
   2  * Copyright (c) 2015, 2017, 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  */


  75   return segment_live_bits().par_set_bit(segment);
  76 }
  77 
  78 inline bool ZLiveMap::claim_segment(BitMap::idx_t segment) {
  79   return segment_claim_bits().par_set_bit(segment);
  80 }
  81 
  82 inline BitMap::idx_t ZLiveMap::first_live_segment() const {
  83   return segment_live_bits().get_next_one_offset(0, nsegments);
  84 }
  85 
  86 inline BitMap::idx_t ZLiveMap::next_live_segment(BitMap::idx_t segment) const {
  87   return segment_live_bits().get_next_one_offset(segment + 1, nsegments);
  88 }
  89 
  90 inline BitMap::idx_t ZLiveMap::segment_size() const {
  91   return _bitmap.size() / nsegments;
  92 }
  93 
  94 inline BitMap::idx_t ZLiveMap::index_to_segment(BitMap::idx_t index) const {
  95   return index >> _shift;
  96 }
  97 
  98 inline bool ZLiveMap::get(size_t index) const {
  99   BitMap::idx_t segment = index_to_segment(index);
 100   return is_marked() &&              // Page is marked
 101          is_segment_live(segment) && // Segment is marked
 102          _bitmap.at(index);          // Object is marked
 103 }
 104 
 105 inline bool ZLiveMap::set_atomic(size_t index, bool finalizable, bool& inc_live) {
 106   if (!is_marked()) {
 107     // First object to be marked during this
 108     // cycle, reset marking information.
 109     reset(index);
 110   }
 111 
 112   const BitMap::idx_t segment = index_to_segment(index);
 113   if (!is_segment_live(segment)) {
 114     // First object to be marked in this segment during
 115     // this cycle, reset segment bitmap.


   1 /*
   2  * Copyright (c) 2015, 2019, 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  */


  75   return segment_live_bits().par_set_bit(segment);
  76 }
  77 
  78 inline bool ZLiveMap::claim_segment(BitMap::idx_t segment) {
  79   return segment_claim_bits().par_set_bit(segment);
  80 }
  81 
  82 inline BitMap::idx_t ZLiveMap::first_live_segment() const {
  83   return segment_live_bits().get_next_one_offset(0, nsegments);
  84 }
  85 
  86 inline BitMap::idx_t ZLiveMap::next_live_segment(BitMap::idx_t segment) const {
  87   return segment_live_bits().get_next_one_offset(segment + 1, nsegments);
  88 }
  89 
  90 inline BitMap::idx_t ZLiveMap::segment_size() const {
  91   return _bitmap.size() / nsegments;
  92 }
  93 
  94 inline BitMap::idx_t ZLiveMap::index_to_segment(BitMap::idx_t index) const {
  95   return index >> _segment_shift;
  96 }
  97 
  98 inline bool ZLiveMap::get(size_t index) const {
  99   BitMap::idx_t segment = index_to_segment(index);
 100   return is_marked() &&              // Page is marked
 101          is_segment_live(segment) && // Segment is marked
 102          _bitmap.at(index);          // Object is marked
 103 }
 104 
 105 inline bool ZLiveMap::set_atomic(size_t index, bool finalizable, bool& inc_live) {
 106   if (!is_marked()) {
 107     // First object to be marked during this
 108     // cycle, reset marking information.
 109     reset(index);
 110   }
 111 
 112   const BitMap::idx_t segment = index_to_segment(index);
 113   if (!is_segment_live(segment)) {
 114     // First object to be marked in this segment during
 115     // this cycle, reset segment bitmap.


< prev index next >