src/hotspot/share/classfile/classLoaderDataGraph.cpp
changeset 59247 56bf71d64d51
parent 58291 a013100f7a35
child 59252 623722a6aeb9
equal deleted inserted replaced
59246:fcad92f425c5 59247:56bf71d64d51
    57   // reader thread. This is accomplished by acquire/release of the _head,
    57   // reader thread. This is accomplished by acquire/release of the _head,
    58   // and is sufficient.
    58   // and is sufficient.
    59   //
    59   //
    60   // Any ClassLoaderData added after or during walking the list are prepended to
    60   // Any ClassLoaderData added after or during walking the list are prepended to
    61   // _head. Their claim mark need not be handled here.
    61   // _head. Their claim mark need not be handled here.
    62   for (ClassLoaderData* cld = OrderAccess::load_acquire(&_head); cld != NULL; cld = cld->next()) {
    62   for (ClassLoaderData* cld = Atomic::load_acquire(&_head); cld != NULL; cld = cld->next()) {
    63     cld->clear_claim();
    63     cld->clear_claim();
    64   }
    64   }
    65 }
    65 }
    66 
    66 
    67 void ClassLoaderDataGraph::clear_claimed_marks(int claim) {
    67 void ClassLoaderDataGraph::clear_claimed_marks(int claim) {
    68  for (ClassLoaderData* cld = OrderAccess::load_acquire(&_head); cld != NULL; cld = cld->next()) {
    68  for (ClassLoaderData* cld = Atomic::load_acquire(&_head); cld != NULL; cld = cld->next()) {
    69     cld->clear_claim(claim);
    69     cld->clear_claim(claim);
    70   }
    70   }
    71 }
    71 }
    72 // Class iterator used by the compiler.  It gets some number of classes at
    72 // Class iterator used by the compiler.  It gets some number of classes at
    73 // a safepoint to decay invocation counters on the methods.
    73 // a safepoint to decay invocation counters on the methods.
   218 
   218 
   219   cld = new ClassLoaderData(loader, is_unsafe_anonymous);
   219   cld = new ClassLoaderData(loader, is_unsafe_anonymous);
   220 
   220 
   221   // First install the new CLD to the Graph.
   221   // First install the new CLD to the Graph.
   222   cld->set_next(_head);
   222   cld->set_next(_head);
   223   OrderAccess::release_store(&_head, cld);
   223   Atomic::release_store(&_head, cld);
   224 
   224 
   225   // Next associate with the class_loader.
   225   // Next associate with the class_loader.
   226   if (!is_unsafe_anonymous) {
   226   if (!is_unsafe_anonymous) {
   227     // Use OrderAccess, since readers need to get the loader_data only after
   227     // Use OrderAccess, since readers need to get the loader_data only after
   228     // it's added to the Graph
   228     // it's added to the Graph