< prev index next >

src/hotspot/share/gc/parallel/psParallelCompact.cpp

8211447: Replace oop_pc_update_pointers with oop_iterate and closure

*** 2201,2211 **** GCTraceTime(Info, gc, phases) tm("Adjust Roots", &_gc_timer); // Need new claim bits when tracing through and adjusting pointers. ClassLoaderDataGraph::clear_claimed_marks(); ! PSParallelCompact::AdjustPointerClosure oop_closure(cm); // General strong roots. Universe::oops_do(&oop_closure); JNIHandles::oops_do(&oop_closure); // Global (strong) JNI handles Threads::oops_do(&oop_closure, NULL); --- 2201,2211 ---- GCTraceTime(Info, gc, phases) tm("Adjust Roots", &_gc_timer); // Need new claim bits when tracing through and adjusting pointers. ClassLoaderDataGraph::clear_claimed_marks(); ! PSAdjustPointerClosure oop_closure(cm); // General strong roots. Universe::oops_do(&oop_closure); JNIHandles::oops_do(&oop_closure); // Global (strong) JNI handles Threads::oops_do(&oop_closure, NULL); ***************
*** 3094,3173 **** Copy::aligned_conjoint_words(source(), destination(), words); } update_state(words); } - void InstanceKlass::oop_pc_update_pointers(oop obj, ParCompactionManager* cm) { - PSParallelCompact::AdjustPointerClosure closure(cm); - if (UseCompressedOops) { - oop_oop_iterate_oop_maps<narrowOop>(obj, &closure); - } else { - oop_oop_iterate_oop_maps<oop>(obj, &closure); - } - } - - void InstanceMirrorKlass::oop_pc_update_pointers(oop obj, ParCompactionManager* cm) { - InstanceKlass::oop_pc_update_pointers(obj, cm); - - PSParallelCompact::AdjustPointerClosure closure(cm); - if (UseCompressedOops) { - oop_oop_iterate_statics<narrowOop>(obj, &closure); - } else { - oop_oop_iterate_statics<oop>(obj, &closure); - } - } - - void InstanceClassLoaderKlass::oop_pc_update_pointers(oop obj, ParCompactionManager* cm) { - InstanceKlass::oop_pc_update_pointers(obj, cm); - } - - #ifdef ASSERT - template <class T> static void trace_reference_gc(const char *s, oop obj, - T* referent_addr, - T* discovered_addr) { - log_develop_trace(gc, ref)("%s obj " PTR_FORMAT, s, p2i(obj)); - log_develop_trace(gc, ref)(" referent_addr/* " PTR_FORMAT " / " PTR_FORMAT, - p2i(referent_addr), referent_addr ? p2i((oop)RawAccess<>::oop_load(referent_addr)) : NULL); - log_develop_trace(gc, ref)(" discovered_addr/* " PTR_FORMAT " / " PTR_FORMAT, - p2i(discovered_addr), discovered_addr ? p2i((oop)RawAccess<>::oop_load(discovered_addr)) : NULL); - } - #endif - - template <class T> - static void oop_pc_update_pointers_specialized(oop obj, ParCompactionManager* cm) { - T* referent_addr = (T*)java_lang_ref_Reference::referent_addr_raw(obj); - PSParallelCompact::adjust_pointer(referent_addr, cm); - T* discovered_addr = (T*)java_lang_ref_Reference::discovered_addr_raw(obj); - PSParallelCompact::adjust_pointer(discovered_addr, cm); - debug_only(trace_reference_gc("InstanceRefKlass::oop_update_ptrs", obj, - referent_addr, discovered_addr);) - } - - void InstanceRefKlass::oop_pc_update_pointers(oop obj, ParCompactionManager* cm) { - InstanceKlass::oop_pc_update_pointers(obj, cm); - - if (UseCompressedOops) { - oop_pc_update_pointers_specialized<narrowOop>(obj, cm); - } else { - oop_pc_update_pointers_specialized<oop>(obj, cm); - } - } - - void ObjArrayKlass::oop_pc_update_pointers(oop obj, ParCompactionManager* cm) { - assert(obj->is_objArray(), "obj must be obj array"); - PSParallelCompact::AdjustPointerClosure closure(cm); - if (UseCompressedOops) { - oop_oop_iterate_elements<narrowOop>(objArrayOop(obj), &closure); - } else { - oop_oop_iterate_elements<oop>(objArrayOop(obj), &closure); - } - } - - void TypeArrayKlass::oop_pc_update_pointers(oop obj, ParCompactionManager* cm) { - assert(obj->is_typeArray(),"must be a type array"); - } - ParMarkBitMapClosure::IterationStatus MoveAndUpdateClosure::do_addr(HeapWord* addr, size_t words) { assert(destination() != NULL, "sanity"); assert(bitmap()->obj_size(addr) == words, "bad size"); --- 3094,3103 ----
< prev index next >