< prev index next >

src/hotspot/share/classfile/classLoaderDataGraph.cpp

Print this page




  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "classfile/classLoaderDataGraph.inline.hpp"
  27 #include "classfile/dictionary.hpp"
  28 #include "classfile/javaClasses.hpp"
  29 #include "classfile/metadataOnStackMark.hpp"
  30 #include "classfile/moduleEntry.hpp"
  31 #include "classfile/packageEntry.hpp"
  32 #include "code/dependencyContext.hpp"
  33 #include "logging/log.hpp"
  34 #include "logging/logStream.hpp"
  35 #include "memory/allocation.inline.hpp"
  36 #include "memory/metaspace.hpp"
  37 #include "memory/resourceArea.hpp"
  38 #include "runtime/atomic.hpp"
  39 #include "runtime/handles.inline.hpp"
  40 #include "runtime/mutex.hpp"
  41 #include "runtime/orderAccess.hpp"
  42 #include "runtime/safepoint.hpp"
  43 #include "runtime/safepointVerifiers.hpp"
  44 #include "utilities/growableArray.hpp"
  45 #include "utilities/macros.hpp"
  46 #include "utilities/ostream.hpp"
  47 
  48 volatile size_t ClassLoaderDataGraph::_num_array_classes = 0;
  49 volatile size_t ClassLoaderDataGraph::_num_instance_classes = 0;
  50 
  51 void ClassLoaderDataGraph::clear_claimed_marks() {
  52   // The claimed marks of the CLDs in the ClassLoaderDataGraph are cleared
  53   // outside a safepoint and without locking the ClassLoaderDataGraph_lock.
  54   // This is required to avoid a deadlock between concurrent GC threads and safepointing.
  55   //
  56   // We need to make sure that the CLD contents are fully visible to the
  57   // reader thread. This is accomplished by acquire/release of the _head,
  58   // and is sufficient.
  59   //
  60   // Any ClassLoaderData added after or during walking the list are prepended to
  61   // _head. Their claim mark need not be handled here.




  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "classfile/classLoaderDataGraph.inline.hpp"
  27 #include "classfile/dictionary.hpp"
  28 #include "classfile/javaClasses.hpp"
  29 #include "classfile/metadataOnStackMark.hpp"
  30 #include "classfile/moduleEntry.hpp"
  31 #include "classfile/packageEntry.hpp"
  32 #include "code/dependencyContext.hpp"
  33 #include "logging/log.hpp"
  34 #include "logging/logStream.hpp"
  35 #include "memory/allocation.inline.hpp"
  36 #include "memory/metaspace.hpp"
  37 #include "memory/resourceArea.hpp"
  38 #include "runtime/atomic.hpp"
  39 #include "runtime/handles.inline.hpp"
  40 #include "runtime/mutex.hpp"

  41 #include "runtime/safepoint.hpp"
  42 #include "runtime/safepointVerifiers.hpp"
  43 #include "utilities/growableArray.hpp"
  44 #include "utilities/macros.hpp"
  45 #include "utilities/ostream.hpp"
  46 
  47 volatile size_t ClassLoaderDataGraph::_num_array_classes = 0;
  48 volatile size_t ClassLoaderDataGraph::_num_instance_classes = 0;
  49 
  50 void ClassLoaderDataGraph::clear_claimed_marks() {
  51   // The claimed marks of the CLDs in the ClassLoaderDataGraph are cleared
  52   // outside a safepoint and without locking the ClassLoaderDataGraph_lock.
  53   // This is required to avoid a deadlock between concurrent GC threads and safepointing.
  54   //
  55   // We need to make sure that the CLD contents are fully visible to the
  56   // reader thread. This is accomplished by acquire/release of the _head,
  57   // and is sufficient.
  58   //
  59   // Any ClassLoaderData added after or during walking the list are prepended to
  60   // _head. Their claim mark need not be handled here.


< prev index next >