< prev index next >

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

Print this page




3061   }
3062   update_state(words);
3063 }
3064 
3065 void InstanceKlass::oop_pc_update_pointers(oop obj) {
3066   oop_oop_iterate_oop_maps<true>(obj, PSParallelCompact::adjust_pointer_closure());
3067 }
3068 
3069 void InstanceMirrorKlass::oop_pc_update_pointers(oop obj) {
3070   InstanceKlass::oop_pc_update_pointers(obj);
3071 
3072   oop_oop_iterate_statics<true>(obj, PSParallelCompact::adjust_pointer_closure());
3073 }
3074 
3075 void InstanceClassLoaderKlass::oop_pc_update_pointers(oop obj) {
3076   InstanceKlass::oop_pc_update_pointers(obj);
3077 }
3078 
3079 #ifdef ASSERT
3080 template <class T> static void trace_reference_gc(const char *s, oop obj,

3081                                                   T* referent_addr,
3082                                                   T* next_addr,
3083                                                   T* discovered_addr) {

3084   log_develop_trace(gc, ref)("%s obj " PTR_FORMAT, s, p2i(obj));
3085   log_develop_trace(gc, ref)("     referent_addr/* " PTR_FORMAT " / " PTR_FORMAT,
3086                              p2i(referent_addr), referent_addr ? p2i(oopDesc::load_decode_heap_oop(referent_addr)) : NULL);
3087   log_develop_trace(gc, ref)("     next_addr/* " PTR_FORMAT " / " PTR_FORMAT,
3088                              p2i(next_addr), next_addr ? p2i(oopDesc::load_decode_heap_oop(next_addr)) : NULL);
3089   log_develop_trace(gc, ref)("     discovered_addr/* " PTR_FORMAT " / " PTR_FORMAT,
3090                              p2i(discovered_addr), discovered_addr ? p2i(oopDesc::load_decode_heap_oop(discovered_addr)) : NULL);




3091 }
3092 #endif
3093 
3094 template <class T>
3095 static void oop_pc_update_pointers_specialized(oop obj) {
3096   T* referent_addr = (T*)java_lang_ref_Reference::referent_addr(obj);
3097   PSParallelCompact::adjust_pointer(referent_addr);
3098   T* next_addr = (T*)java_lang_ref_Reference::next_addr(obj);
3099   PSParallelCompact::adjust_pointer(next_addr);
3100   T* discovered_addr = (T*)java_lang_ref_Reference::discovered_addr(obj);
3101   PSParallelCompact::adjust_pointer(discovered_addr);
3102   debug_only(trace_reference_gc("InstanceRefKlass::oop_update_ptrs", obj,
3103                                 referent_addr, next_addr, discovered_addr);)







3104 }
3105 
3106 void InstanceRefKlass::oop_pc_update_pointers(oop obj) {
3107   InstanceKlass::oop_pc_update_pointers(obj);
3108 
3109   if (UseCompressedOops) {
3110     oop_pc_update_pointers_specialized<narrowOop>(obj);
3111   } else {
3112     oop_pc_update_pointers_specialized<oop>(obj);
3113   }
3114 }
3115 
3116 void ObjArrayKlass::oop_pc_update_pointers(oop obj) {
3117   assert(obj->is_objArray(), "obj must be obj array");
3118   oop_oop_iterate_elements<true>(objArrayOop(obj), PSParallelCompact::adjust_pointer_closure());
3119 }
3120 
3121 void TypeArrayKlass::oop_pc_update_pointers(oop obj) {
3122   assert(obj->is_typeArray(),"must be a type array");
3123 }
3124 
3125 ParMarkBitMapClosure::IterationStatus
3126 MoveAndUpdateClosure::do_addr(HeapWord* addr, size_t words) {
3127   assert(destination() != NULL, "sanity");
3128   assert(bitmap()->obj_size(addr) == words, "bad size");
3129 
3130   _source = addr;
3131   assert(PSParallelCompact::summary_data().calc_new_pointer(source()) ==
3132          destination(), "wrong destination");




3061   }
3062   update_state(words);
3063 }
3064 
3065 void InstanceKlass::oop_pc_update_pointers(oop obj) {
3066   oop_oop_iterate_oop_maps<true>(obj, PSParallelCompact::adjust_pointer_closure());
3067 }
3068 
3069 void InstanceMirrorKlass::oop_pc_update_pointers(oop obj) {
3070   InstanceKlass::oop_pc_update_pointers(obj);
3071 
3072   oop_oop_iterate_statics<true>(obj, PSParallelCompact::adjust_pointer_closure());
3073 }
3074 
3075 void InstanceClassLoaderKlass::oop_pc_update_pointers(oop obj) {
3076   InstanceKlass::oop_pc_update_pointers(obj);
3077 }
3078 
3079 #ifdef ASSERT
3080 template <class T> static void trace_reference_gc(const char *s, oop obj,
3081                                                   bool is_ephemeron,
3082                                                   T* referent_addr,
3083                                                   T* next_addr,
3084                                                   T* discovered_addr,
3085                                                   T* value_addr) {
3086   log_develop_trace(gc, ref)("%s obj " PTR_FORMAT, s, p2i(obj));
3087   log_develop_trace(gc, ref)("     referent_addr/* " PTR_FORMAT " / " PTR_FORMAT,
3088                              p2i(referent_addr), referent_addr ? p2i(oopDesc::load_decode_heap_oop(referent_addr)) : NULL);
3089   log_develop_trace(gc, ref)("     next_addr/* " PTR_FORMAT " / " PTR_FORMAT,
3090                              p2i(next_addr), next_addr ? p2i(oopDesc::load_decode_heap_oop(next_addr)) : NULL);
3091   log_develop_trace(gc, ref)("     discovered_addr/* " PTR_FORMAT " / " PTR_FORMAT,
3092                              p2i(discovered_addr), discovered_addr ? p2i(oopDesc::load_decode_heap_oop(discovered_addr)) : NULL);
3093   if (is_ephemeron) {
3094     log_develop_trace(gc, ref)("     value_addr/* " PTR_FORMAT " / " PTR_FORMAT,
3095                                p2i(value_addr), value_addr ? p2i(oopDesc::load_decode_heap_oop(value_addr)) : NULL);
3096   }
3097 }
3098 #endif
3099 
3100 template <class T>
3101 static void oop_pc_update_pointers_specialized(oop obj, InstanceRefKlass* klass) {
3102   T* referent_addr = (T*)java_lang_ref_Reference::referent_addr(obj);
3103   PSParallelCompact::adjust_pointer(referent_addr);
3104   T* next_addr = (T*)java_lang_ref_Reference::next_addr(obj);
3105   PSParallelCompact::adjust_pointer(next_addr);
3106   T* discovered_addr = (T*)java_lang_ref_Reference::discovered_addr(obj);
3107   PSParallelCompact::adjust_pointer(discovered_addr);
3108   if (klass->reference_type() == REF_EPHEMERON) {
3109     T* value_addr = (T*)java_lang_ref_Ephemeron::value_addr(obj);
3110     PSParallelCompact::adjust_pointer(value_addr);
3111     debug_only(trace_reference_gc("InstanceRefKlass<Ephemeron>::oop_update_ptrs", obj, true,
3112                                   referent_addr, next_addr, discovered_addr, value_addr);)
3113   } else {
3114     debug_only(trace_reference_gc("InstanceRefKlass::oop_update_ptrs", obj, false,
3115                                   referent_addr, next_addr, discovered_addr, (T*)NULL);)
3116   }
3117 }
3118 
3119 void InstanceRefKlass::oop_pc_update_pointers(oop obj) {
3120   InstanceKlass::oop_pc_update_pointers(obj);
3121 
3122   if (UseCompressedOops) {
3123     oop_pc_update_pointers_specialized<narrowOop>(obj, this);
3124   } else {
3125     oop_pc_update_pointers_specialized<oop>(obj, this);
3126   }
3127 }
3128 
3129 void ObjArrayKlass::oop_pc_update_pointers(oop obj) {
3130   assert(obj->is_objArray(), "obj must be obj array");
3131   oop_oop_iterate_elements<true>(objArrayOop(obj), PSParallelCompact::adjust_pointer_closure());
3132 }
3133 
3134 void TypeArrayKlass::oop_pc_update_pointers(oop obj) {
3135   assert(obj->is_typeArray(),"must be a type array");
3136 }
3137 
3138 ParMarkBitMapClosure::IterationStatus
3139 MoveAndUpdateClosure::do_addr(HeapWord* addr, size_t words) {
3140   assert(destination() != NULL, "sanity");
3141   assert(bitmap()->obj_size(addr) == words, "bad size");
3142 
3143   _source = addr;
3144   assert(PSParallelCompact::summary_data().calc_new_pointer(source()) ==
3145          destination(), "wrong destination");


< prev index next >