< prev index next >

src/hotspot/share/prims/jvmtiTagMap.cpp

Print this page




3009 // threads are handled in collect_stack_roots() as an optimization.
3010 // if there's a heap root callback provided then the callback is
3011 // invoked for each simple root.
3012 // if an object reference callback is provided then all simple
3013 // roots are pushed onto the marking stack so that they can be
3014 // processed later
3015 //
3016 inline bool VM_HeapWalkOperation::collect_simple_roots() {
3017   SimpleRootsClosure blk;
3018 
3019   // JNI globals
3020   blk.set_kind(JVMTI_HEAP_REFERENCE_JNI_GLOBAL);
3021   JNIHandles::oops_do(&blk);
3022   if (blk.stopped()) {
3023     return false;
3024   }
3025 
3026   // Preloaded classes and loader from the system dictionary
3027   blk.set_kind(JVMTI_HEAP_REFERENCE_SYSTEM_CLASS);
3028   SystemDictionary::always_strong_oops_do(&blk);
3029   KlassToOopClosure klass_blk(&blk);
3030   ClassLoaderDataGraph::always_strong_oops_do(&blk, &klass_blk, false);
3031   if (blk.stopped()) {
3032     return false;
3033   }
3034 
3035   // Inflated monitors
3036   blk.set_kind(JVMTI_HEAP_REFERENCE_MONITOR);
3037   ObjectSynchronizer::oops_do(&blk);
3038   if (blk.stopped()) {
3039     return false;
3040   }
3041 
3042   // threads are now handled in collect_stack_roots()
3043 
3044   // Other kinds of roots maintained by HotSpot
3045   // Many of these won't be visible but others (such as instances of important
3046   // exceptions) will be visible.
3047   blk.set_kind(JVMTI_HEAP_REFERENCE_OTHER);
3048   Universe::oops_do(&blk);
3049 
3050   // If there are any non-perm roots in the code cache, visit them.




3009 // threads are handled in collect_stack_roots() as an optimization.
3010 // if there's a heap root callback provided then the callback is
3011 // invoked for each simple root.
3012 // if an object reference callback is provided then all simple
3013 // roots are pushed onto the marking stack so that they can be
3014 // processed later
3015 //
3016 inline bool VM_HeapWalkOperation::collect_simple_roots() {
3017   SimpleRootsClosure blk;
3018 
3019   // JNI globals
3020   blk.set_kind(JVMTI_HEAP_REFERENCE_JNI_GLOBAL);
3021   JNIHandles::oops_do(&blk);
3022   if (blk.stopped()) {
3023     return false;
3024   }
3025 
3026   // Preloaded classes and loader from the system dictionary
3027   blk.set_kind(JVMTI_HEAP_REFERENCE_SYSTEM_CLASS);
3028   SystemDictionary::always_strong_oops_do(&blk);
3029   ClassLoaderDataGraph::always_strong_oops_do(&blk, false);

3030   if (blk.stopped()) {
3031     return false;
3032   }
3033 
3034   // Inflated monitors
3035   blk.set_kind(JVMTI_HEAP_REFERENCE_MONITOR);
3036   ObjectSynchronizer::oops_do(&blk);
3037   if (blk.stopped()) {
3038     return false;
3039   }
3040 
3041   // threads are now handled in collect_stack_roots()
3042 
3043   // Other kinds of roots maintained by HotSpot
3044   // Many of these won't be visible but others (such as instances of important
3045   // exceptions) will be visible.
3046   blk.set_kind(JVMTI_HEAP_REFERENCE_OTHER);
3047   Universe::oops_do(&blk);
3048 
3049   // If there are any non-perm roots in the code cache, visit them.


< prev index next >