< prev index next >

src/hotspot/share/classfile/systemDictionaryShared.cpp

Print this page

*** 904,922 **** SystemDictionary::is_platform_class_loader(class_loader())) { // Do nothing for the BUILTIN loaders. return NULL; } ! const RunTimeSharedClassInfo* record = find_record(&_unregistered_dictionary, class_name); ! if (record == NULL) { ! if (DynamicArchive::is_mapped()) { ! record = find_record(&_dynamic_unregistered_dictionary, class_name); ! } if (record == NULL) { return NULL; } - } int clsfile_size = cfs->length(); int clsfile_crc32 = ClassLoader::crc32(0, (const char*)cfs->buffer(), cfs->length()); if (!record->matches(clsfile_size, clsfile_crc32)) { --- 904,917 ---- SystemDictionary::is_platform_class_loader(class_loader())) { // Do nothing for the BUILTIN loaders. return NULL; } ! const RunTimeSharedClassInfo* record = find_record(&_unregistered_dictionary, &_dynamic_unregistered_dictionary, class_name); if (record == NULL) { return NULL; } int clsfile_size = cfs->length(); int clsfile_crc32 = ClassLoader::crc32(0, (const char*)cfs->buffer(), cfs->length()); if (!record->matches(clsfile_size, clsfile_crc32)) {
*** 1411,1443 **** _dynamic_unregistered_dictionary.serialize_header(soc); } } const RunTimeSharedClassInfo* ! SystemDictionaryShared::find_record(RunTimeSharedDictionary* dict, Symbol* name) { ! if (UseSharedSpaces) { ! unsigned int hash = primitive_hash<Symbol*>(name); ! return dict->lookup(name, hash, 0); ! } else { return NULL; } - } ! InstanceKlass* SystemDictionaryShared::find_builtin_class(Symbol* name) { ! const RunTimeSharedClassInfo* record = find_record(&_builtin_dictionary, name); ! if (record) { ! return record->_klass; } ! if (DynamicArchive::is_mapped()) { ! record = find_record(&_dynamic_builtin_dictionary, name); ! if (record) { ! return record->_klass; ! } } return NULL; } void SystemDictionaryShared::update_shared_entry(InstanceKlass* k, int id) { assert(DumpSharedSpaces, "supported only when dumping"); DumpTimeSharedClassInfo* info = find_or_allocate_info_for(k); --- 1406,1443 ---- _dynamic_unregistered_dictionary.serialize_header(soc); } } const RunTimeSharedClassInfo* ! SystemDictionaryShared::find_record(RunTimeSharedDictionary* static_dict, RunTimeSharedDictionary* dynamic_dict, Symbol* name) { ! if (!UseSharedSpaces || !name->is_shared()) { ! // The names of all shared classes must also be a shared Symbol. return NULL; } ! unsigned int hash = primitive_hash<Symbol*>(name); ! const RunTimeSharedClassInfo* record = NULL; ! if (!MetaspaceShared::is_shared_dynamic(name)) { ! // The names of all shared classes in the static dict must also be in the ! // static archive ! record = static_dict->lookup(name, hash, 0); } ! if (record == NULL && DynamicArchive::is_mapped()) { ! record = dynamic_dict->lookup(name, hash, 0); } + return record; + } + + InstanceKlass* SystemDictionaryShared::find_builtin_class(Symbol* name) { + const RunTimeSharedClassInfo* record = find_record(&_builtin_dictionary, &_dynamic_builtin_dictionary, name); + if (record != NULL) { + return record->_klass; + } else { return NULL; + } } void SystemDictionaryShared::update_shared_entry(InstanceKlass* k, int id) { assert(DumpSharedSpaces, "supported only when dumping"); DumpTimeSharedClassInfo* info = find_or_allocate_info_for(k);
< prev index next >