有时,HotSpot注入内部特定于VM的字段,这些字段在Java级别不可见。在
ClassLoader情况下,这是一个指向
ClassLoaderData:
#define CLASSLOADER_INJECTED_FIELDS(macro) macro(java_lang_ClassLoader, loader_data, intptr_signature, false)
这是一个
intptr_t类型的字段,即恰好8个字节长。
这是HotSpot源描述
ClassLoaderData的方式:
// A ClassLoaderData identifies the full set of class types that a class// loader's name resolution strategy produces for a given configuration of the// class loader.// Class types in the ClassLoaderData may be defined by from class file binaries// provided by the class loader, or from other class loader it interacts with// according to its name resolution strategy.//// Class loaders that implement a deterministic name resolution strategy// (including with respect to their delegation behavior), such as the boot, the// extension, and the system loaders of the JDK's built-in class loader// hierarchy, always produce the same linkset for a given configuration.//// ClassLoaderData carries information related to a linkset (e.g.,// metaspace holding its klass definitions).// The System Dictionary and related data structures (e.g., placeholder table,// loader constraints table) as well as the runtime representation of classes// only reference ClassLoaderData.//// Instances of java.lang.ClassLoader holds a pointer to a ClassLoaderData that// that represent the loader's "linking domain" in the JVM.//// The bootstrap loader (represented by NULL) also has a ClassLoaderData,// the singleton class the_null_class_loader_data().
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)