< prev index next >

src/share/vm/classfile/systemDictionary.hpp

Print this page




  60 // Clients of this class who are interested in finding if a class has
  61 // been completely loaded -- not classes in the process of being loaded --
  62 // can read the SystemDictionary unlocked. This is safe because
  63 //    - entries are only deleted at safepoints
  64 //    - readers cannot come to a safepoint while actively examining
  65 //         an entry  (an entry cannot be deleted from under a reader)
  66 //    - entries must be fully formed before they are available to concurrent
  67 //         readers (we must ensure write ordering)
  68 //
  69 // Note that placeholders are deleted at any time, as they are removed
  70 // when a class is completely loaded. Therefore, readers as well as writers
  71 // of placeholders must hold the SystemDictionary_lock.
  72 //
  73 
  74 class Dictionary;
  75 class PlaceholderTable;
  76 class LoaderConstraintTable;
  77 template <MEMFLAGS F> class HashtableBucket;
  78 class ResolutionErrorTable;
  79 class SymbolPropertyTable;
  80 class Ticks;
  81 
  82 // Certain classes are preloaded, such as java.lang.Object and java.lang.String.
  83 // They are all "well-known", in the sense that no class loader is allowed
  84 // to provide a different definition.
  85 //
  86 // These klasses must all have names defined in vmSymbols.
  87 
  88 #define WK_KLASS_ENUM_NAME(kname)    kname##_knum
  89 
  90 // Each well-known class has a short klass name (like object_klass),
  91 // a vmSymbol name (like java_lang_Object), and a flag word
  92 // that makes some minor distinctions, like whether the klass
  93 // is preloaded, optional, release-specific, etc.
  94 // The order of these definitions is significant; it is the order in which
  95 // preloading is actually performed by initialize_preloaded_classes.
  96 
  97 #define WK_KLASSES_DO(do_klass)                                                                                          \
  98   /* well-known classes */                                                                                               \
  99   do_klass(Object_klass,                                java_lang_Object,                          Pre                 ) \
 100   do_klass(String_klass,                                java_lang_String,                          Pre                 ) \


 637                                                Handle protection_domain,
 638                                                TRAPS);
 639   static instanceKlassHandle load_instance_class(Symbol* class_name, Handle class_loader, TRAPS);
 640   static Handle compute_loader_lock_object(Handle class_loader, TRAPS);
 641   static void check_loader_lock_contention(Handle loader_lock, TRAPS);
 642   static bool is_parallelCapable(Handle class_loader);
 643   static bool is_parallelDefine(Handle class_loader);
 644 
 645 public:
 646   static instanceKlassHandle load_shared_class(Symbol* class_name,
 647                                                Handle class_loader,
 648                                                TRAPS);
 649   static bool is_ext_class_loader(Handle class_loader);
 650 
 651 protected:
 652   static Klass* find_shared_class(Symbol* class_name);
 653 
 654   // Setup link to hierarchy
 655   static void add_to_hierarchy(instanceKlassHandle k, TRAPS);
 656 
 657   // event based tracing
 658   static void post_class_load_event(const Ticks& start_time, instanceKlassHandle k,
 659                                     Handle initiating_loader);
 660   // We pass in the hashtable index so we can calculate it outside of
 661   // the SystemDictionary_lock.
 662 
 663   // Basic find on loaded classes
 664   static Klass* find_class(int index, unsigned int hash,
 665                              Symbol* name, ClassLoaderData* loader_data);
 666   static Klass* find_class(Symbol* class_name, ClassLoaderData* loader_data);
 667 
 668   // Basic find on classes in the midst of being loaded
 669   static Symbol* find_placeholder(Symbol* name, ClassLoaderData* loader_data);
 670 
 671   // Updating entry in dictionary
 672   // Add a completely loaded class
 673   static void add_klass(int index, Symbol* class_name,
 674                         ClassLoaderData* loader_data, KlassHandle obj);
 675 
 676   // Add a placeholder for a class being loaded
 677   static void add_placeholder(int index,
 678                               Symbol* class_name,
 679                               ClassLoaderData* loader_data);




  60 // Clients of this class who are interested in finding if a class has
  61 // been completely loaded -- not classes in the process of being loaded --
  62 // can read the SystemDictionary unlocked. This is safe because
  63 //    - entries are only deleted at safepoints
  64 //    - readers cannot come to a safepoint while actively examining
  65 //         an entry  (an entry cannot be deleted from under a reader)
  66 //    - entries must be fully formed before they are available to concurrent
  67 //         readers (we must ensure write ordering)
  68 //
  69 // Note that placeholders are deleted at any time, as they are removed
  70 // when a class is completely loaded. Therefore, readers as well as writers
  71 // of placeholders must hold the SystemDictionary_lock.
  72 //
  73 
  74 class Dictionary;
  75 class PlaceholderTable;
  76 class LoaderConstraintTable;
  77 template <MEMFLAGS F> class HashtableBucket;
  78 class ResolutionErrorTable;
  79 class SymbolPropertyTable;

  80 
  81 // Certain classes are preloaded, such as java.lang.Object and java.lang.String.
  82 // They are all "well-known", in the sense that no class loader is allowed
  83 // to provide a different definition.
  84 //
  85 // These klasses must all have names defined in vmSymbols.
  86 
  87 #define WK_KLASS_ENUM_NAME(kname)    kname##_knum
  88 
  89 // Each well-known class has a short klass name (like object_klass),
  90 // a vmSymbol name (like java_lang_Object), and a flag word
  91 // that makes some minor distinctions, like whether the klass
  92 // is preloaded, optional, release-specific, etc.
  93 // The order of these definitions is significant; it is the order in which
  94 // preloading is actually performed by initialize_preloaded_classes.
  95 
  96 #define WK_KLASSES_DO(do_klass)                                                                                          \
  97   /* well-known classes */                                                                                               \
  98   do_klass(Object_klass,                                java_lang_Object,                          Pre                 ) \
  99   do_klass(String_klass,                                java_lang_String,                          Pre                 ) \


 636                                                Handle protection_domain,
 637                                                TRAPS);
 638   static instanceKlassHandle load_instance_class(Symbol* class_name, Handle class_loader, TRAPS);
 639   static Handle compute_loader_lock_object(Handle class_loader, TRAPS);
 640   static void check_loader_lock_contention(Handle loader_lock, TRAPS);
 641   static bool is_parallelCapable(Handle class_loader);
 642   static bool is_parallelDefine(Handle class_loader);
 643 
 644 public:
 645   static instanceKlassHandle load_shared_class(Symbol* class_name,
 646                                                Handle class_loader,
 647                                                TRAPS);
 648   static bool is_ext_class_loader(Handle class_loader);
 649 
 650 protected:
 651   static Klass* find_shared_class(Symbol* class_name);
 652 
 653   // Setup link to hierarchy
 654   static void add_to_hierarchy(instanceKlassHandle k, TRAPS);
 655 



 656   // We pass in the hashtable index so we can calculate it outside of
 657   // the SystemDictionary_lock.
 658 
 659   // Basic find on loaded classes
 660   static Klass* find_class(int index, unsigned int hash,
 661                              Symbol* name, ClassLoaderData* loader_data);
 662   static Klass* find_class(Symbol* class_name, ClassLoaderData* loader_data);
 663 
 664   // Basic find on classes in the midst of being loaded
 665   static Symbol* find_placeholder(Symbol* name, ClassLoaderData* loader_data);
 666 
 667   // Updating entry in dictionary
 668   // Add a completely loaded class
 669   static void add_klass(int index, Symbol* class_name,
 670                         ClassLoaderData* loader_data, KlassHandle obj);
 671 
 672   // Add a placeholder for a class being loaded
 673   static void add_placeholder(int index,
 674                               Symbol* class_name,
 675                               ClassLoaderData* loader_data);


< prev index next >