src/hotspot/share/jfr/leakprofiler/checkpoint/rootResolver.cpp
changeset 55740 b3ff56f955c8
parent 55564 7df7c1f71ccf
child 57811 947252a54b98
equal deleted inserted replaced
55739:ba2bd51ce67e 55740:b3ff56f955c8
    39 #include "runtime/mutexLocker.hpp"
    39 #include "runtime/mutexLocker.hpp"
    40 #include "runtime/threadSMR.inline.hpp"
    40 #include "runtime/threadSMR.inline.hpp"
    41 #include "runtime/vframe_hp.hpp"
    41 #include "runtime/vframe_hp.hpp"
    42 #include "services/management.hpp"
    42 #include "services/management.hpp"
    43 #include "utilities/growableArray.hpp"
    43 #include "utilities/growableArray.hpp"
    44 #if INCLUDE_JVMCI
       
    45 #include "jvmci/jvmci.hpp"
       
    46 #endif
       
    47 
    44 
    48 class ReferenceLocateClosure : public OopClosure {
    45 class ReferenceLocateClosure : public OopClosure {
    49  protected:
    46  protected:
    50   RootCallback& _callback;
    47   RootCallback& _callback;
    51   RootCallbackInfo _info;
    48   RootCallbackInfo _info;
   104   bool do_jvmti_roots();
   101   bool do_jvmti_roots();
   105   bool do_system_dictionary_roots();
   102   bool do_system_dictionary_roots();
   106   bool do_management_roots();
   103   bool do_management_roots();
   107   bool do_string_table_roots();
   104   bool do_string_table_roots();
   108   bool do_aot_loader_roots();
   105   bool do_aot_loader_roots();
   109   JVMCI_ONLY(bool do_jvmci_roots();)
       
   110 
   106 
   111   bool do_roots();
   107   bool do_roots();
   112 
   108 
   113  public:
   109  public:
   114   ReferenceToRootClosure(RootCallback& callback) : _callback(callback),
   110   ReferenceToRootClosure(RootCallback& callback) : _callback(callback),
   191   ReferenceLocateClosure rcl(_callback, OldObjectRoot::_aot, OldObjectRoot::_type_undetermined, NULL);
   187   ReferenceLocateClosure rcl(_callback, OldObjectRoot::_aot, OldObjectRoot::_type_undetermined, NULL);
   192   AOTLoader::oops_do(&rcl);
   188   AOTLoader::oops_do(&rcl);
   193   return rcl.complete();
   189   return rcl.complete();
   194 }
   190 }
   195 
   191 
   196 #if INCLUDE_JVMCI
       
   197 bool ReferenceToRootClosure::do_jvmci_roots() {
       
   198   assert(!complete(), "invariant");
       
   199   ReferenceLocateClosure rcl(_callback, OldObjectRoot::_jvmci, OldObjectRoot::_type_undetermined, NULL);
       
   200   JVMCI::oops_do(&rcl);
       
   201   return rcl.complete();
       
   202 }
       
   203 #endif
       
   204 
       
   205 bool ReferenceToRootClosure::do_roots() {
   192 bool ReferenceToRootClosure::do_roots() {
   206   assert(!complete(), "invariant");
   193   assert(!complete(), "invariant");
   207   assert(OldObjectRoot::_system_undetermined == _info._system, "invariant");
   194   assert(OldObjectRoot::_system_undetermined == _info._system, "invariant");
   208   assert(OldObjectRoot::_type_undetermined == _info._type, "invariant");
   195   assert(OldObjectRoot::_type_undetermined == _info._type, "invariant");
   209 
   196 
   249 
   236 
   250   if (do_aot_loader_roots()) {
   237   if (do_aot_loader_roots()) {
   251    _complete = true;
   238    _complete = true;
   252     return true;
   239     return true;
   253   }
   240   }
   254 
       
   255 #if INCLUDE_JVMCI
       
   256   if (do_jvmci_roots()) {
       
   257    _complete = true;
       
   258     return true;
       
   259   }
       
   260 #endif
       
   261 
   241 
   262   return false;
   242   return false;
   263 }
   243 }
   264 
   244 
   265 class ReferenceToThreadRootClosure : public StackObj {
   245 class ReferenceToThreadRootClosure : public StackObj {