< prev index next >

src/share/vm/gc/g1/g1OopClosures.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  *


  97     }
  98   }
  99 }
 100 
 101 template <class T>
 102 inline void G1ParPushHeapRSClosure::do_oop_nv(T* p) {
 103   T heap_oop = oopDesc::load_heap_oop(p);
 104 
 105   if (!oopDesc::is_null(heap_oop)) {
 106     oop obj = oopDesc::decode_heap_oop_not_null(heap_oop);
 107     const InCSetState state = _g1->in_cset_state(obj);
 108     if (state.is_in_cset_or_humongous()) {
 109       Prefetch::write(obj->mark_addr(), 0);
 110       Prefetch::read(obj->mark_addr(), (HeapWordSize*2));
 111 
 112       // Place on the references queue
 113       _par_scan_state->push_on_queue(p);
 114     } else if (state.is_ext()) {
 115       _par_scan_state->do_oop_ext(p);
 116     } else {
 117       assert(!_g1->obj_in_cs(obj), "checking");
 118     }
 119   }
 120 }
 121 
 122 template <class T>
 123 inline void G1CMOopClosure::do_oop_nv(T* p) {
 124   oop obj = oopDesc::load_decode_heap_oop(p);
 125   _task->deal_with_reference(obj);
 126 }
 127 
 128 template <class T>
 129 inline void G1RootRegionScanClosure::do_oop_nv(T* p) {
 130   T heap_oop = oopDesc::load_heap_oop(p);
 131   if (!oopDesc::is_null(heap_oop)) {
 132     oop obj = oopDesc::decode_heap_oop_not_null(heap_oop);
 133     HeapRegion* hr = _g1h->heap_region_containing((HeapWord*) obj);
 134     _cm->grayRoot(obj, hr);
 135   }
 136 }
 137 


   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  *


  97     }
  98   }
  99 }
 100 
 101 template <class T>
 102 inline void G1ParPushHeapRSClosure::do_oop_nv(T* p) {
 103   T heap_oop = oopDesc::load_heap_oop(p);
 104 
 105   if (!oopDesc::is_null(heap_oop)) {
 106     oop obj = oopDesc::decode_heap_oop_not_null(heap_oop);
 107     const InCSetState state = _g1->in_cset_state(obj);
 108     if (state.is_in_cset_or_humongous()) {
 109       Prefetch::write(obj->mark_addr(), 0);
 110       Prefetch::read(obj->mark_addr(), (HeapWordSize*2));
 111 
 112       // Place on the references queue
 113       _par_scan_state->push_on_queue(p);
 114     } else if (state.is_ext()) {
 115       _par_scan_state->do_oop_ext(p);
 116     } else {
 117       assert(!_g1->is_in_cset(obj), "checking");
 118     }
 119   }
 120 }
 121 
 122 template <class T>
 123 inline void G1CMOopClosure::do_oop_nv(T* p) {
 124   oop obj = oopDesc::load_decode_heap_oop(p);
 125   _task->deal_with_reference(obj);
 126 }
 127 
 128 template <class T>
 129 inline void G1RootRegionScanClosure::do_oop_nv(T* p) {
 130   T heap_oop = oopDesc::load_heap_oop(p);
 131   if (!oopDesc::is_null(heap_oop)) {
 132     oop obj = oopDesc::decode_heap_oop_not_null(heap_oop);
 133     HeapRegion* hr = _g1h->heap_region_containing((HeapWord*) obj);
 134     _cm->grayRoot(obj, hr);
 135   }
 136 }
 137 


< prev index next >