src/share/vm/classfile/systemDictionary.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 8000740 Cdiff src/share/vm/classfile/systemDictionary.cpp

src/share/vm/classfile/systemDictionary.cpp

Print this page

        

*** 289,308 **** Symbol* class_name, Handle class_loader, Handle protection_domain, bool is_superclass, TRAPS) { - - // Try to get one of the well-known klasses. - // They are trusted, and do not participate in circularities. - if (LinkWellKnownClasses) { - Klass* k = find_well_known_klass(class_name); - if (k != NULL) { - return k; - } - } - // Double-check, if child class is already loaded, just return super-class,interface // Don't add a placedholder if already loaded, i.e. already in system dictionary // Make sure there's a placeholder for the *child* before resolving. // Used as a claim that this thread is currently loading superclass/classloader // Used here for ClassCircularity checks and also for heap verification --- 289,298 ----
*** 924,941 **** Handle protection_domain, TRAPS) { Klass* k = NULL; assert(class_name != NULL, "class name must be non NULL"); - // Try to get one of the well-known klasses. - if (LinkWellKnownClasses) { - k = find_well_known_klass(class_name); - if (k != NULL) { - return k; - } - } - if (FieldType::is_array(class_name)) { // The name refers to an array. Parse the name. // dimension and object_key in FieldArrayInfo are assigned as a // side-effect of this call FieldArrayInfo fd; --- 914,923 ----
*** 952,996 **** k = find(class_name, class_loader, protection_domain, THREAD); } return k; } - // Quick range check for names of well-known classes: - static Symbol* wk_klass_name_limits[2] = {NULL, NULL}; - - #ifndef PRODUCT - static int find_wkk_calls, find_wkk_probes, find_wkk_wins; - // counts for "hello world": 3983, 1616, 1075 - // => 60% hit after limit guard, 25% total win rate - #endif - - Klass* SystemDictionary::find_well_known_klass(Symbol* class_name) { - // A bounds-check on class_name will quickly get a negative result. - NOT_PRODUCT(find_wkk_calls++); - if (class_name >= wk_klass_name_limits[0] && - class_name <= wk_klass_name_limits[1]) { - NOT_PRODUCT(find_wkk_probes++); - vmSymbols::SID sid = vmSymbols::find_sid(class_name); - if (sid != vmSymbols::NO_SID) { - Klass* k = NULL; - switch (sid) { - #define WK_KLASS_CASE(name, symbol, option) \ - case vmSymbols::VM_SYMBOL_ENUM_NAME(symbol): \ - if (option == Pre_Link) { \ - k = WK_KLASS(name); \ - } \ - break; - WK_KLASSES_DO(WK_KLASS_CASE) - #undef WK_KLASS_CASE - } - NOT_PRODUCT(if (k != NULL) find_wkk_wins++); - return k; - } - } - return NULL; - } - // Note: this method is much like resolve_from_stream, but // updates no supplemental data structures. // TODO consolidate the two methods with a helper routine? Klass* SystemDictionary::parse_stream(Symbol* class_name, Handle class_loader, --- 934,943 ----
*** 1940,1976 **** int info = wk_init_info[id - FIRST_WKID]; int sid = (info >> CEIL_LG_OPTION_LIMIT); int opt = (info & right_n_bits(CEIL_LG_OPTION_LIMIT)); initialize_wk_klass((WKID)id, opt, CHECK); - - // Update limits, so find_well_known_klass can be very fast: - Symbol* s = vmSymbols::symbol_at((vmSymbols::SID)sid); - if (wk_klass_name_limits[1] == NULL) { - wk_klass_name_limits[0] = wk_klass_name_limits[1] = s; - } else if (wk_klass_name_limits[1] < s) { - wk_klass_name_limits[1] = s; - } else if (wk_klass_name_limits[0] > s) { - wk_klass_name_limits[0] = s; - } } // move the starting value forward to the limit: start_id = limit_id; } - #ifdef ASSERT - void SystemDictionary::check_wk_pre_link_klasses() { - #define WK_KLASS_CHECK(name, symbol, option) \ - if (option == Pre_Link) { \ - assert(name()->is_public(), ""); \ - } - WK_KLASSES_DO(WK_KLASS_CHECK); - #undef WK_KLASS_CHECK - } - #endif - void SystemDictionary::initialize_preloaded_classes(TRAPS) { assert(WK_KLASS(Object_klass) == NULL, "preloaded classes should only be initialized once"); // Preload commonly used klasses WKID scan = FIRST_WKID; // first do Object, then String, Class --- 1887,1902 ----
*** 2021,2032 **** scan = WKID(jsr292_group_end + 1); } initialize_wk_klasses_until(WKID_LIMIT, scan, CHECK); - check_wk_pre_link_klasses(); - _box_klasses[T_BOOLEAN] = WK_KLASS(Boolean_klass); _box_klasses[T_CHAR] = WK_KLASS(Character_klass); _box_klasses[T_FLOAT] = WK_KLASS(Float_klass); _box_klasses[T_DOUBLE] = WK_KLASS(Double_klass); _box_klasses[T_BYTE] = WK_KLASS(Byte_klass); --- 1947,1956 ----
src/share/vm/classfile/systemDictionary.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File