< prev index next >

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

Print this page
rev 12504 : imported patch 8162104-use-is_in_cset-instead-of-obj_in_cs
   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  *


 125 
 126   HeapWord* end = start + word_size;
 127   assert(containing_hr->is_in(end - 1), "it should also contain end - 1");
 128 
 129   MemRegion mr(start, end);
 130   g1_barrier_set()->g1_mark_as_young(mr);
 131 }
 132 
 133 inline RefToScanQueue* G1CollectedHeap::task_queue(uint i) const {
 134   return _task_queues->queue(i);
 135 }
 136 
 137 inline bool G1CollectedHeap::isMarkedPrev(oop obj) const {
 138   return _cm->prevMarkBitMap()->isMarked((HeapWord *)obj);
 139 }
 140 
 141 inline bool G1CollectedHeap::isMarkedNext(oop obj) const {
 142   return _cm->nextMarkBitMap()->isMarked((HeapWord *)obj);
 143 }
 144 
 145 // This is a fast test on whether a reference points into the
 146 // collection set or not. Assume that the reference
 147 // points into the heap.
 148 inline bool G1CollectedHeap::is_in_cset(oop obj) {
 149   bool ret = _in_cset_fast_test.is_in_cset((HeapWord*)obj);
 150   // let's make sure the result is consistent with what the slower
 151   // test returns
 152   assert( ret || !obj_in_cs(obj), "sanity");
 153   assert(!ret ||  obj_in_cs(obj), "sanity");
 154   return ret;
 155 }
 156 
 157 bool G1CollectedHeap::is_in_cset(const HeapRegion* hr) {
 158   return _in_cset_fast_test.is_in_cset(hr);
 159 }
 160 
 161 bool G1CollectedHeap::is_in_cset_or_humongous(const oop obj) {
 162   return _in_cset_fast_test.is_in_cset_or_humongous((HeapWord*)obj);
 163 }
 164 
 165 InCSetState G1CollectedHeap::in_cset_state(const oop obj) {
 166   return _in_cset_fast_test.at((HeapWord*)obj);
 167 }
 168 
 169 void G1CollectedHeap::register_humongous_region_with_cset(uint index) {
 170   _in_cset_fast_test.set_humongous(index);
 171 }
 172 
 173 #ifndef PRODUCT
 174 // Support for G1EvacuationFailureALot


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


 125 
 126   HeapWord* end = start + word_size;
 127   assert(containing_hr->is_in(end - 1), "it should also contain end - 1");
 128 
 129   MemRegion mr(start, end);
 130   g1_barrier_set()->g1_mark_as_young(mr);
 131 }
 132 
 133 inline RefToScanQueue* G1CollectedHeap::task_queue(uint i) const {
 134   return _task_queues->queue(i);
 135 }
 136 
 137 inline bool G1CollectedHeap::isMarkedPrev(oop obj) const {
 138   return _cm->prevMarkBitMap()->isMarked((HeapWord *)obj);
 139 }
 140 
 141 inline bool G1CollectedHeap::isMarkedNext(oop obj) const {
 142   return _cm->nextMarkBitMap()->isMarked((HeapWord *)obj);
 143 }
 144 



 145 inline bool G1CollectedHeap::is_in_cset(oop obj) {
 146   return _in_cset_fast_test.is_in_cset((HeapWord*)obj);





 147 }
 148 
 149 bool G1CollectedHeap::is_in_cset(const HeapRegion* hr) {
 150   return _in_cset_fast_test.is_in_cset(hr);
 151 }
 152 
 153 bool G1CollectedHeap::is_in_cset_or_humongous(const oop obj) {
 154   return _in_cset_fast_test.is_in_cset_or_humongous((HeapWord*)obj);
 155 }
 156 
 157 InCSetState G1CollectedHeap::in_cset_state(const oop obj) {
 158   return _in_cset_fast_test.at((HeapWord*)obj);
 159 }
 160 
 161 void G1CollectedHeap::register_humongous_region_with_cset(uint index) {
 162   _in_cset_fast_test.set_humongous(index);
 163 }
 164 
 165 #ifndef PRODUCT
 166 // Support for G1EvacuationFailureALot


< prev index next >