< prev index next >

src/hotspot/share/gc/serial/serialFullGC.cpp

Print this page
*** 377,36 ***
  
  template <class T> void SerialFullGC::KeepAliveClosure::do_oop_work(T* p) {
    mark_and_push(p);
  }
  
! void SerialFullGC::push_objarray(oop obj, size_t index) {
    ObjArrayTask task(obj, index);
    assert(task.is_valid(), "bad ObjArrayTask");
    _objarray_stack.push(task);
  }
  
  void SerialFullGC::follow_array(objArrayOop array) {
    mark_and_push_closure.do_klass(array->klass());
    // Don't push empty arrays to avoid unnecessary work.
    if (array->length() > 0) {
      SerialFullGC::push_objarray(array, 0);
    }
  }
  
  void SerialFullGC::follow_object(oop obj) {
    assert(obj->is_gc_marked(), "should be marked");
!   if (obj->is_objArray()) {
      // Handle object arrays explicitly to allow them to
      // be split into chunks if needed.
      SerialFullGC::follow_array((objArrayOop)obj);
    } else {
      obj->oop_iterate(&mark_and_push_closure);
    }
  }
  
  void SerialFullGC::follow_array_chunk(objArrayOop array, int index) {
    const int len = array->length();
    const int beg_index = index;
    assert(beg_index < len || len == 0, "index too large");
  
    const int stride = MIN2(len - beg_index, (int) ObjArrayMarkingStride);
--- 377,46 ---
  
  template <class T> void SerialFullGC::KeepAliveClosure::do_oop_work(T* p) {
    mark_and_push(p);
  }
  
! void SerialFullGC::push_objarray(objArrayOop obj, size_t index) {
+   assert(obj->is_array_with_oops(), "Must be");
    ObjArrayTask task(obj, index);
    assert(task.is_valid(), "bad ObjArrayTask");
    _objarray_stack.push(task);
  }
  
  void SerialFullGC::follow_array(objArrayOop array) {
+   assert(array->is_array_with_oops(), "Must be");
+ 
    mark_and_push_closure.do_klass(array->klass());
+ 
+   if (array->is_flatArray()) {
+     FlatArrayKlass* faklass = FlatArrayKlass::cast(array->klass());
+     mark_and_push_closure.do_klass(faklass->element_klass());
+   }
+ 
    // Don't push empty arrays to avoid unnecessary work.
    if (array->length() > 0) {
      SerialFullGC::push_objarray(array, 0);
    }
  }
  
  void SerialFullGC::follow_object(oop obj) {
    assert(obj->is_gc_marked(), "should be marked");
!   if (obj->is_array_with_oops()) {
      // Handle object arrays explicitly to allow them to
      // be split into chunks if needed.
      SerialFullGC::follow_array((objArrayOop)obj);
    } else {
      obj->oop_iterate(&mark_and_push_closure);
    }
  }
  
  void SerialFullGC::follow_array_chunk(objArrayOop array, int index) {
+   assert(array->is_array_with_oops(), "Must be");
    const int len = array->length();
    const int beg_index = index;
    assert(beg_index < len || len == 0, "index too large");
  
    const int stride = MIN2(len - beg_index, (int) ObjArrayMarkingStride);
< prev index next >