< prev index next >

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

Print this page

        

*** 29,38 **** --- 29,43 ---- #include "gc_implementation/parallelScavenge/psParallelCompact.inline.hpp" #include "oops/objArrayOop.hpp" #include "oops/oop.inline.hpp" #include "utilities/debug.hpp" #include "utilities/globalDefinitions.hpp" + #include "utilities/taskqueue.inline.hpp" + + inline void ParCompactionManager::push(oop obj) { + _marking_stack.push(obj); + } void ParCompactionManager::push_objarray(oop obj, size_t index) { ObjArrayTask task(obj, index); assert(task.is_valid(), "bad ObjArrayTask");
*** 48,57 **** --- 53,96 ---- assert(region_ptr->_pushed++ == 0, "should only be pushed once"); #endif region_stack()->push(index); } + template <typename T> + inline void ParCompactionManager::mark_and_push(T* p) { + T heap_oop = oopDesc::load_heap_oop(p); + if (!oopDesc::is_null(heap_oop)) { + oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); + assert(ParallelScavengeHeap::heap()->is_in(obj), "should be in heap"); + + if (mark_bitmap()->is_unmarked(obj) && PSParallelCompact::mark_obj(obj)) { + push(obj); + } + } + } + + template <typename T> + inline void ParCompactionManager::MarkAndPushClosure::do_oop_nv(T* p) { + _compaction_manager->mark_and_push(p); + } + + inline void ParCompactionManager::MarkAndPushClosure::do_oop(oop* p) { do_oop_nv(p); } + inline void ParCompactionManager::MarkAndPushClosure::do_oop(narrowOop* p) { do_oop_nv(p); } + + inline void ParCompactionManager::follow_klass(Klass* klass) { + oop holder = klass->klass_holder(); + mark_and_push(&holder); + } + + inline void ParCompactionManager::FollowStackClosure::do_void() { + _compaction_manager->follow_marking_stacks(); + } + + inline void ParCompactionManager::FollowKlassClosure::do_klass(Klass* klass) { + klass->oops_do(_mark_and_push_closure); + } + inline void ParCompactionManager::follow_contents(oop obj) { assert(PSParallelCompact::mark_bitmap()->is_marked(obj), "should be marked"); obj->pc_follow_contents(this); }
*** 67,77 **** T* const beg = base + beg_index; T* const end = base + end_index; // Push the non-NULL elements of the next stride on the marking stack. for (T* e = beg; e < end; e++) { ! PSParallelCompact::mark_and_push<T>(cm, e); } if (end_index < len) { cm->push_objarray(obj, end_index); // Push the continuation. } --- 106,116 ---- T* const beg = base + beg_index; T* const end = base + end_index; // Push the non-NULL elements of the next stride on the marking stack. for (T* e = beg; e < end; e++) { ! cm->mark_and_push<T>(e); } if (end_index < len) { cm->push_objarray(obj, end_index); // Push the continuation. }
< prev index next >