< prev index next >

src/hotspot/share/classfile/systemDictionary.cpp

Print this page
rev 48545 : Value-based classes (vbc) / Oop value test via metadata ptr


  95 SymbolPropertyTable*   SystemDictionary::_invoke_method_table = NULL;
  96 ProtectionDomainCacheTable*   SystemDictionary::_pd_cache_table = NULL;
  97 
  98 int         SystemDictionary::_number_of_modifications = 0;
  99 oop         SystemDictionary::_system_loader_lock_obj     =  NULL;
 100 
 101 InstanceKlass*      SystemDictionary::_well_known_klasses[SystemDictionary::WKID_LIMIT]
 102                                                           =  { NULL /*, NULL...*/ };
 103 
 104 InstanceKlass*      SystemDictionary::_box_klasses[T_VOID+1]      =  { NULL /*, NULL...*/ };
 105 
 106 oop         SystemDictionary::_java_system_loader         =  NULL;
 107 oop         SystemDictionary::_java_platform_loader       =  NULL;
 108 
 109 bool        SystemDictionary::_has_loadClassInternal      =  false;
 110 bool        SystemDictionary::_has_checkPackageAccess     =  false;
 111 
 112 // lazily initialized klass variables
 113 InstanceKlass* volatile SystemDictionary::_abstract_ownable_synchronizer_klass = NULL;
 114 




 115 // Default ProtectionDomainCacheSize value
 116 
 117 const int defaultProtectionDomainCacheSize = 1009;
 118 
 119 
 120 // ----------------------------------------------------------------------------
 121 // Java-level SystemLoader and PlatformLoader
 122 
 123 oop SystemDictionary::java_system_loader() {
 124   return _java_system_loader;
 125 }
 126 
 127 oop SystemDictionary::java_platform_loader() {
 128   return _java_platform_loader;
 129 }
 130 
 131 void SystemDictionary::compute_java_loaders(TRAPS) {
 132   JavaValue result(T_OBJECT);
 133   InstanceKlass* class_loader_klass = SystemDictionary::ClassLoader_klass();
 134   JavaCalls::call_static(&result,


2028   Klass* aos = _abstract_ownable_synchronizer_klass;
2029   if (aos == NULL) {
2030     Klass* k = resolve_or_fail(vmSymbols::java_util_concurrent_locks_AbstractOwnableSynchronizer(), true, CHECK);
2031     // Force a fence to prevent any read before the write completes
2032     OrderAccess::fence();
2033     _abstract_ownable_synchronizer_klass = InstanceKlass::cast(k);
2034   }
2035 }
2036 
2037 // ----------------------------------------------------------------------------
2038 // Initialization
2039 
2040 void SystemDictionary::initialize(TRAPS) {
2041   // Allocate arrays
2042   _placeholders        = new PlaceholderTable(_placeholder_table_size);
2043   _number_of_modifications = 0;
2044   _loader_constraints  = new LoaderConstraintTable(_loader_constraint_size);
2045   _resolution_errors   = new ResolutionErrorTable(_resolution_error_size);
2046   _invoke_method_table = new SymbolPropertyTable(_invoke_method_size);
2047   _pd_cache_table = new ProtectionDomainCacheTable(defaultProtectionDomainCacheSize);













































2048 
2049   // Allocate private object used as system class loader lock
2050   _system_loader_lock_obj = oopFactory::new_intArray(0, CHECK);
2051   // Initialize basic classes
2052   initialize_preloaded_classes(CHECK);
2053 }
2054 
2055 // Compact table of directions on the initialization of klasses:
2056 static const short wk_init_info[] = {
2057   #define WK_KLASS_INIT_INFO(name, symbol, option) \
2058     ( ((int)vmSymbols::VM_SYMBOL_ENUM_NAME(symbol) \
2059           << SystemDictionary::CEIL_LG_OPTION_LIMIT) \
2060       | (int)SystemDictionary::option ),
2061   WK_KLASSES_DO(WK_KLASS_INIT_INFO)
2062   #undef WK_KLASS_INIT_INFO
2063   0
2064 };
2065 
2066 bool SystemDictionary::initialize_wk_klass(WKID id, int init_opt, TRAPS) {
2067   assert(id >= (int)FIRST_WKID && id < (int)WKID_LIMIT, "oob");




  95 SymbolPropertyTable*   SystemDictionary::_invoke_method_table = NULL;
  96 ProtectionDomainCacheTable*   SystemDictionary::_pd_cache_table = NULL;
  97 
  98 int         SystemDictionary::_number_of_modifications = 0;
  99 oop         SystemDictionary::_system_loader_lock_obj     =  NULL;
 100 
 101 InstanceKlass*      SystemDictionary::_well_known_klasses[SystemDictionary::WKID_LIMIT]
 102                                                           =  { NULL /*, NULL...*/ };
 103 
 104 InstanceKlass*      SystemDictionary::_box_klasses[T_VOID+1]      =  { NULL /*, NULL...*/ };
 105 
 106 oop         SystemDictionary::_java_system_loader         =  NULL;
 107 oop         SystemDictionary::_java_platform_loader       =  NULL;
 108 
 109 bool        SystemDictionary::_has_loadClassInternal      =  false;
 110 bool        SystemDictionary::_has_checkPackageAccess     =  false;
 111 
 112 // lazily initialized klass variables
 113 InstanceKlass* volatile SystemDictionary::_abstract_ownable_synchronizer_klass = NULL;
 114 
 115 #if INCLUDE_VBC
 116 GrowableArray<Symbol*>* SystemDictionary::_value_based_classes    = NULL;
 117 #endif
 118 
 119 // Default ProtectionDomainCacheSize value
 120 
 121 const int defaultProtectionDomainCacheSize = 1009;
 122 
 123 
 124 // ----------------------------------------------------------------------------
 125 // Java-level SystemLoader and PlatformLoader
 126 
 127 oop SystemDictionary::java_system_loader() {
 128   return _java_system_loader;
 129 }
 130 
 131 oop SystemDictionary::java_platform_loader() {
 132   return _java_platform_loader;
 133 }
 134 
 135 void SystemDictionary::compute_java_loaders(TRAPS) {
 136   JavaValue result(T_OBJECT);
 137   InstanceKlass* class_loader_klass = SystemDictionary::ClassLoader_klass();
 138   JavaCalls::call_static(&result,


2032   Klass* aos = _abstract_ownable_synchronizer_klass;
2033   if (aos == NULL) {
2034     Klass* k = resolve_or_fail(vmSymbols::java_util_concurrent_locks_AbstractOwnableSynchronizer(), true, CHECK);
2035     // Force a fence to prevent any read before the write completes
2036     OrderAccess::fence();
2037     _abstract_ownable_synchronizer_klass = InstanceKlass::cast(k);
2038   }
2039 }
2040 
2041 // ----------------------------------------------------------------------------
2042 // Initialization
2043 
2044 void SystemDictionary::initialize(TRAPS) {
2045   // Allocate arrays
2046   _placeholders        = new PlaceholderTable(_placeholder_table_size);
2047   _number_of_modifications = 0;
2048   _loader_constraints  = new LoaderConstraintTable(_loader_constraint_size);
2049   _resolution_errors   = new ResolutionErrorTable(_resolution_error_size);
2050   _invoke_method_table = new SymbolPropertyTable(_invoke_method_size);
2051   _pd_cache_table = new ProtectionDomainCacheTable(defaultProtectionDomainCacheSize);
2052 
2053 #if INCLUDE_VBC
2054   if (ValueBasedClasses == NULL) {
2055     // Quick dirty hard-coded JDK value classes...
2056     ValueBasedClasses = "java/lang/Runtime$Version,"
2057       "java/time/Duration,"
2058       "java/time/Instant,"
2059       "java/time/LocalDate,"
2060       "java/time/LocalDateTime,"
2061       "java/time/LocalTime,"
2062       "java/time/MonthDay,"
2063       "java/time/OffsetDateTime,"
2064       "java/time/OffsetTime,"
2065       "java/time/Period,"
2066       "java/time/Year,"
2067       "java/time/YearMonth,"
2068       "java/time/ZonedDateTime,"
2069       "java/time/ZoneId,"
2070       "java/time/ZoneOffset,"
2071       "java/time/chrono/HijrahDate,"
2072       "java/time/chrono/JapaneseDate,"
2073       "java/time/chrono/MinguoDate,"
2074       "java/time/chrono/ThaiBuddhistDate,"
2075       "java/util/KeyValueHolder,"
2076       "java/util/Optional,"
2077       "java/util/OptionalDouble,"
2078       "java/util/OptionalInt,"
2079       "java/util/OptionalLong";
2080   }
2081   if (ValueBasedClasses != NULL) {
2082     Symbol* name_sym;
2083     _value_based_classes = new (ResourceObj::C_HEAP, mtInternal) GrowableArray<Symbol*>(3, true);
2084     char* name = os::strdup_check_oom(ValueBasedClasses);
2085     char* next = strchr(name, ',');
2086     while (next != NULL) {
2087       *next = '\0';
2088       name_sym = SymbolTable::new_permanent_symbol(name, CHECK);
2089       _value_based_classes->append(name_sym);
2090       name = next + 1;
2091       next = strchr(name, ',');
2092     }
2093     name_sym = SymbolTable::new_permanent_symbol(name, CHECK);
2094     _value_based_classes->append(name_sym);
2095   }
2096 #endif
2097 
2098   // Allocate private object used as system class loader lock
2099   _system_loader_lock_obj = oopFactory::new_intArray(0, CHECK);
2100   // Initialize basic classes
2101   initialize_preloaded_classes(CHECK);
2102 }
2103 
2104 // Compact table of directions on the initialization of klasses:
2105 static const short wk_init_info[] = {
2106   #define WK_KLASS_INIT_INFO(name, symbol, option) \
2107     ( ((int)vmSymbols::VM_SYMBOL_ENUM_NAME(symbol) \
2108           << SystemDictionary::CEIL_LG_OPTION_LIMIT) \
2109       | (int)SystemDictionary::option ),
2110   WK_KLASSES_DO(WK_KLASS_INIT_INFO)
2111   #undef WK_KLASS_INIT_INFO
2112   0
2113 };
2114 
2115 bool SystemDictionary::initialize_wk_klass(WKID id, int init_opt, TRAPS) {
2116   assert(id >= (int)FIRST_WKID && id < (int)WKID_LIMIT, "oob");


< prev index next >