< prev index next >

src/hotspot/share/oops/instanceRefKlass.inline.hpp

Print this page

168 void InstanceRefKlass::oop_oop_iterate_reverse(oop obj, OopClosureType* closure) {
169   InstanceKlass::oop_oop_iterate_reverse<T>(obj, closure);
170 
171   oop_oop_iterate_ref_processing<T>(obj, closure);
172 }
173 
174 template <typename T, class OopClosureType>
175 void InstanceRefKlass::oop_oop_iterate_bounded(oop obj, OopClosureType* closure, MemRegion mr) {
176   InstanceKlass::oop_oop_iterate_bounded<T>(obj, closure, mr);
177 
178   oop_oop_iterate_ref_processing_bounded<T>(obj, closure, mr);
179 }
180 
181 #ifdef ASSERT
182 template <typename T>
183 void InstanceRefKlass::trace_reference_gc(const char *s, oop obj) {
184   T* referent_addr   = (T*) java_lang_ref_Reference::referent_addr_raw(obj);
185   T* discovered_addr = (T*) java_lang_ref_Reference::discovered_addr_raw(obj);
186 
187   log_develop_trace(gc, ref)("InstanceRefKlass %s for obj " PTR_FORMAT, s, p2i(obj));
188   if (java_lang_ref_Reference::is_phantom(obj)) {
189     log_develop_trace(gc, ref)("     referent_addr/* " PTR_FORMAT " / " PTR_FORMAT,
190                                p2i(referent_addr), p2i((oop)HeapAccess<ON_PHANTOM_OOP_REF | AS_NO_KEEPALIVE>::oop_load(referent_addr)));
191   } else {
192     log_develop_trace(gc, ref)("     referent_addr/* " PTR_FORMAT " / " PTR_FORMAT,
193                                p2i(referent_addr), p2i((oop)HeapAccess<ON_WEAK_OOP_REF | AS_NO_KEEPALIVE>::oop_load(referent_addr)));
194   }
195   log_develop_trace(gc, ref)("     discovered_addr/* " PTR_FORMAT " / " PTR_FORMAT,
196       p2i(discovered_addr), p2i((oop)HeapAccess<AS_NO_KEEPALIVE>::oop_load(discovered_addr)));
197 }
198 #endif
199 
200 #endif // SHARE_OOPS_INSTANCEREFKLASS_INLINE_HPP

168 void InstanceRefKlass::oop_oop_iterate_reverse(oop obj, OopClosureType* closure) {
169   InstanceKlass::oop_oop_iterate_reverse<T>(obj, closure);
170 
171   oop_oop_iterate_ref_processing<T>(obj, closure);
172 }
173 
174 template <typename T, class OopClosureType>
175 void InstanceRefKlass::oop_oop_iterate_bounded(oop obj, OopClosureType* closure, MemRegion mr) {
176   InstanceKlass::oop_oop_iterate_bounded<T>(obj, closure, mr);
177 
178   oop_oop_iterate_ref_processing_bounded<T>(obj, closure, mr);
179 }
180 
181 #ifdef ASSERT
182 template <typename T>
183 void InstanceRefKlass::trace_reference_gc(const char *s, oop obj) {
184   T* referent_addr   = (T*) java_lang_ref_Reference::referent_addr_raw(obj);
185   T* discovered_addr = (T*) java_lang_ref_Reference::discovered_addr_raw(obj);
186 
187   log_develop_trace(gc, ref)("InstanceRefKlass %s for obj " PTR_FORMAT, s, p2i(obj));
188   if (reference_type() == REF_PHANTOM) {
189     log_develop_trace(gc, ref)("     referent_addr/* " PTR_FORMAT " / " PTR_FORMAT,
190                                p2i(referent_addr), p2i((oop)HeapAccess<ON_PHANTOM_OOP_REF | AS_NO_KEEPALIVE>::oop_load(referent_addr)));
191   } else {
192     log_develop_trace(gc, ref)("     referent_addr/* " PTR_FORMAT " / " PTR_FORMAT,
193                                p2i(referent_addr), p2i((oop)HeapAccess<ON_WEAK_OOP_REF | AS_NO_KEEPALIVE>::oop_load(referent_addr)));
194   }
195   log_develop_trace(gc, ref)("     discovered_addr/* " PTR_FORMAT " / " PTR_FORMAT,
196       p2i(discovered_addr), p2i((oop)HeapAccess<AS_NO_KEEPALIVE>::oop_load(discovered_addr)));
197 }
198 #endif
199 
200 #endif // SHARE_OOPS_INSTANCEREFKLASS_INLINE_HPP
< prev index next >