src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp

Print this page
rev 6796 : [mq]: templateOopIterate


  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  *
  23  */
  24 
  25 #ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONMANAGER_INLINE_HPP
  26 #define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONMANAGER_INLINE_HPP
  27 
  28 #include "gc_implementation/parallelScavenge/psOldGen.hpp"
  29 #include "gc_implementation/parallelScavenge/psPromotionManager.hpp"
  30 #include "gc_implementation/parallelScavenge/psPromotionLAB.inline.hpp"
  31 #include "gc_implementation/parallelScavenge/psScavenge.hpp"

  32 #include "oops/oop.psgc.inline.hpp"
  33 
  34 inline PSPromotionManager* PSPromotionManager::manager_array(int index) {
  35   assert(_manager_array != NULL, "access of NULL manager_array");
  36   assert(index >= 0 && index <= (int)ParallelGCThreads, "out of range manager_array access");
  37   return &_manager_array[index];
  38 }
  39 
  40 template <class T>
  41 inline void PSPromotionManager::claim_or_forward_internal_depth(T* p) {
  42   if (p != NULL) { // XXX: error if p != NULL here
  43     oop o = oopDesc::load_decode_heap_oop_not_null(p);
  44     if (o->is_forwarded()) {
  45       o = o->forwardee();
  46       // Card mark
  47       if (PSScavenge::is_obj_in_young(o)) {
  48         PSScavenge::card_table()->inline_write_ref_field_gc(p, o);
  49       }
  50       oopDesc::encode_store_heap_oop_not_null(p, o);
  51     } else {




  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  *
  23  */
  24 
  25 #ifndef SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONMANAGER_INLINE_HPP
  26 #define SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONMANAGER_INLINE_HPP
  27 
  28 #include "gc_implementation/parallelScavenge/psOldGen.hpp"
  29 #include "gc_implementation/parallelScavenge/psPromotionManager.hpp"
  30 #include "gc_implementation/parallelScavenge/psPromotionLAB.inline.hpp"
  31 #include "gc_implementation/parallelScavenge/psScavenge.hpp"
  32 #include "gc_interface/collectedHeap.inline.hpp"
  33 #include "oops/oop.psgc.inline.hpp"
  34 
  35 inline PSPromotionManager* PSPromotionManager::manager_array(int index) {
  36   assert(_manager_array != NULL, "access of NULL manager_array");
  37   assert(index >= 0 && index <= (int)ParallelGCThreads, "out of range manager_array access");
  38   return &_manager_array[index];
  39 }
  40 
  41 template <class T>
  42 inline void PSPromotionManager::claim_or_forward_internal_depth(T* p) {
  43   if (p != NULL) { // XXX: error if p != NULL here
  44     oop o = oopDesc::load_decode_heap_oop_not_null(p);
  45     if (o->is_forwarded()) {
  46       o = o->forwardee();
  47       // Card mark
  48       if (PSScavenge::is_obj_in_young(o)) {
  49         PSScavenge::card_table()->inline_write_ref_field_gc(p, o);
  50       }
  51       oopDesc::encode_store_heap_oop_not_null(p, o);
  52     } else {