src/share/vm/oops/objArrayKlass.inline.hpp

Print this page




  31 #if INCLUDE_ALL_GCS
  32 #include "gc_implementation/parallelScavenge/psCompactionManager.inline.hpp"
  33 #include "gc_implementation/parallelScavenge/psParallelCompact.hpp"
  34 #endif // INCLUDE_ALL_GCS
  35 
  36 void ObjArrayKlass::oop_follow_contents(oop obj, int index) {
  37   if (UseCompressedOops) {
  38     objarray_follow_contents<narrowOop>(obj, index);
  39   } else {
  40     objarray_follow_contents<oop>(obj, index);
  41   }
  42 }
  43 
  44 template <class T>
  45 void ObjArrayKlass::objarray_follow_contents(oop obj, int index) {
  46   objArrayOop a = objArrayOop(obj);
  47   const size_t len = size_t(a->length());
  48   const size_t beg_index = size_t(index);
  49   assert(beg_index < len || len == 0, "index too large");
  50 
  51   const size_t stride = MIN2(len - beg_index, ObjArrayMarkingStride);
  52   const size_t end_index = beg_index + stride;
  53   T* const base = (T*)a->base();
  54   T* const beg = base + beg_index;
  55   T* const end = base + end_index;
  56 
  57   // Push the non-NULL elements of the next stride on the marking stack.
  58   for (T* e = beg; e < end; e++) {
  59     MarkSweep::mark_and_push<T>(e);
  60   }
  61 
  62   if (end_index < len) {
  63     MarkSweep::push_objarray(a, end_index); // Push the continuation.
  64   }
  65 }
  66 
  67 #if INCLUDE_ALL_GCS
  68 void ObjArrayKlass::oop_follow_contents(ParCompactionManager* cm, oop obj,
  69                                         int index) {
  70   if (UseCompressedOops) {
  71     objarray_follow_contents<narrowOop>(cm, obj, index);
  72   } else {
  73     objarray_follow_contents<oop>(cm, obj, index);
  74   }
  75 }
  76 
  77 template <class T>
  78 void ObjArrayKlass::objarray_follow_contents(ParCompactionManager* cm, oop obj,
  79                                              int index) {
  80   objArrayOop a = objArrayOop(obj);
  81   const size_t len = size_t(a->length());
  82   const size_t beg_index = size_t(index);
  83   assert(beg_index < len || len == 0, "index too large");
  84 
  85   const size_t stride = MIN2(len - beg_index, ObjArrayMarkingStride);
  86   const size_t end_index = beg_index + stride;
  87   T* const base = (T*)a->base();
  88   T* const beg = base + beg_index;
  89   T* const end = base + end_index;
  90 
  91   // Push the non-NULL elements of the next stride on the marking stack.
  92   for (T* e = beg; e < end; e++) {
  93     PSParallelCompact::mark_and_push<T>(cm, e);
  94   }
  95 
  96   if (end_index < len) {
  97     cm->push_objarray(a, end_index); // Push the continuation.
  98   }
  99 }
 100 #endif // INCLUDE_ALL_GCS
 101 
 102 #endif // SHARE_VM_OOPS_OBJARRAYKLASS_INLINE_HPP


  31 #if INCLUDE_ALL_GCS
  32 #include "gc_implementation/parallelScavenge/psCompactionManager.inline.hpp"
  33 #include "gc_implementation/parallelScavenge/psParallelCompact.hpp"
  34 #endif // INCLUDE_ALL_GCS
  35 
  36 void ObjArrayKlass::oop_follow_contents(oop obj, int index) {
  37   if (UseCompressedOops) {
  38     objarray_follow_contents<narrowOop>(obj, index);
  39   } else {
  40     objarray_follow_contents<oop>(obj, index);
  41   }
  42 }
  43 
  44 template <class T>
  45 void ObjArrayKlass::objarray_follow_contents(oop obj, int index) {
  46   objArrayOop a = objArrayOop(obj);
  47   const size_t len = size_t(a->length());
  48   const size_t beg_index = size_t(index);
  49   assert(beg_index < len || len == 0, "index too large");
  50 
  51   const size_t stride = MIN2(len - beg_index, (size_t)ObjArrayMarkingStride);
  52   const size_t end_index = beg_index + stride;
  53   T* const base = (T*)a->base();
  54   T* const beg = base + beg_index;
  55   T* const end = base + end_index;
  56 
  57   // Push the non-NULL elements of the next stride on the marking stack.
  58   for (T* e = beg; e < end; e++) {
  59     MarkSweep::mark_and_push<T>(e);
  60   }
  61 
  62   if (end_index < len) {
  63     MarkSweep::push_objarray(a, end_index); // Push the continuation.
  64   }
  65 }
  66 
  67 #if INCLUDE_ALL_GCS
  68 void ObjArrayKlass::oop_follow_contents(ParCompactionManager* cm, oop obj,
  69                                         int index) {
  70   if (UseCompressedOops) {
  71     objarray_follow_contents<narrowOop>(cm, obj, index);
  72   } else {
  73     objarray_follow_contents<oop>(cm, obj, index);
  74   }
  75 }
  76 
  77 template <class T>
  78 void ObjArrayKlass::objarray_follow_contents(ParCompactionManager* cm, oop obj,
  79                                              int index) {
  80   objArrayOop a = objArrayOop(obj);
  81   const size_t len = size_t(a->length());
  82   const size_t beg_index = size_t(index);
  83   assert(beg_index < len || len == 0, "index too large");
  84 
  85   const size_t stride = MIN2(len - beg_index, (size_t)ObjArrayMarkingStride);
  86   const size_t end_index = beg_index + stride;
  87   T* const base = (T*)a->base();
  88   T* const beg = base + beg_index;
  89   T* const end = base + end_index;
  90 
  91   // Push the non-NULL elements of the next stride on the marking stack.
  92   for (T* e = beg; e < end; e++) {
  93     PSParallelCompact::mark_and_push<T>(cm, e);
  94   }
  95 
  96   if (end_index < len) {
  97     cm->push_objarray(a, end_index); // Push the continuation.
  98   }
  99 }
 100 #endif // INCLUDE_ALL_GCS
 101 
 102 #endif // SHARE_VM_OOPS_OBJARRAYKLASS_INLINE_HPP