41 #include "classfile/classLoaderExt.hpp"
42 #include "classfile/dictionary.hpp"
43 #include "classfile/javaClasses.hpp"
44 #include "classfile/javaClasses.inline.hpp"
45 #include "classfile/symbolTable.hpp"
46 #include "classfile/systemDictionary.hpp"
47 #include "classfile/systemDictionaryShared.hpp"
48 #include "classfile/verificationType.hpp"
49 #include "classfile/vmClasses.hpp"
50 #include "classfile/vmSymbols.hpp"
51 #include "interpreter/bootstrapInfo.hpp"
52 #include "jfr/jfrEvents.hpp"
53 #include "logging/log.hpp"
54 #include "logging/logStream.hpp"
55 #include "memory/allocation.hpp"
56 #include "memory/metadataFactory.hpp"
57 #include "memory/metaspaceClosure.hpp"
58 #include "memory/oopFactory.hpp"
59 #include "memory/resourceArea.hpp"
60 #include "memory/universe.hpp"
61 #include "oops/instanceKlass.hpp"
62 #include "oops/klass.inline.hpp"
63 #include "oops/objArrayKlass.hpp"
64 #include "oops/objArrayOop.inline.hpp"
65 #include "oops/oop.inline.hpp"
66 #include "oops/oopHandle.inline.hpp"
67 #include "oops/typeArrayOop.inline.hpp"
68 #include "runtime/arguments.hpp"
69 #include "runtime/handles.inline.hpp"
70 #include "runtime/java.hpp"
71 #include "runtime/javaCalls.hpp"
72 #include "runtime/mutexLocker.hpp"
73 #include "utilities/resourceHash.hpp"
74 #include "utilities/stringUtils.hpp"
75
76 SystemDictionaryShared::ArchiveInfo SystemDictionaryShared::_static_archive;
77 SystemDictionaryShared::ArchiveInfo SystemDictionaryShared::_dynamic_archive;
78
79 DumpTimeSharedClassTable* SystemDictionaryShared::_dumptime_table = nullptr;
80 DumpTimeSharedClassTable* SystemDictionaryShared::_cloned_dumptime_table = nullptr;
1294 }
1295
1296 if (!MetaspaceShared::is_shared_dynamic(name)) {
1297 // The names of all shared classes in the static dict must also be in the
1298 // static archive
1299 record = static_dict->lookup(name, hash, 0);
1300 }
1301
1302 if (record == nullptr && DynamicArchive::is_mapped()) {
1303 record = dynamic_dict->lookup(name, hash, 0);
1304 }
1305
1306 return record;
1307 }
1308
1309 InstanceKlass* SystemDictionaryShared::find_builtin_class(Symbol* name) {
1310 const RunTimeClassInfo* record = find_record(&_static_archive._builtin_dictionary,
1311 &_dynamic_archive._builtin_dictionary,
1312 name);
1313 if (record != nullptr) {
1314 assert(!record->_klass->is_hidden(), "hidden class cannot be looked up by name");
1315 assert(check_alignment(record->_klass), "Address not aligned");
1316 // We did not save the classfile data of the generated LambdaForm invoker classes,
1317 // so we cannot support CLFH for such classes.
1318 if (record->_klass->is_generated_shared_class() && JvmtiExport::should_post_class_file_load_hook()) {
1319 return nullptr;
1320 }
1321 return record->_klass;
1322 } else {
1323 return nullptr;
1324 }
1325 }
1326
1327 void SystemDictionaryShared::update_shared_entry(InstanceKlass* k, int id) {
1328 assert(DumpSharedSpaces, "supported only when dumping");
1329 DumpTimeClassInfo* info = get_info(k);
1330 info->_id = id;
1331 }
1332
1333 const char* class_loader_name_for_shared(Klass* k) {
1334 assert(k != nullptr, "Sanity");
1335 assert(k->is_shared(), "Must be");
|
41 #include "classfile/classLoaderExt.hpp"
42 #include "classfile/dictionary.hpp"
43 #include "classfile/javaClasses.hpp"
44 #include "classfile/javaClasses.inline.hpp"
45 #include "classfile/symbolTable.hpp"
46 #include "classfile/systemDictionary.hpp"
47 #include "classfile/systemDictionaryShared.hpp"
48 #include "classfile/verificationType.hpp"
49 #include "classfile/vmClasses.hpp"
50 #include "classfile/vmSymbols.hpp"
51 #include "interpreter/bootstrapInfo.hpp"
52 #include "jfr/jfrEvents.hpp"
53 #include "logging/log.hpp"
54 #include "logging/logStream.hpp"
55 #include "memory/allocation.hpp"
56 #include "memory/metadataFactory.hpp"
57 #include "memory/metaspaceClosure.hpp"
58 #include "memory/oopFactory.hpp"
59 #include "memory/resourceArea.hpp"
60 #include "memory/universe.hpp"
61 #include "oops/compressedKlass.hpp"
62 #include "oops/instanceKlass.hpp"
63 #include "oops/klass.inline.hpp"
64 #include "oops/objArrayKlass.hpp"
65 #include "oops/objArrayOop.inline.hpp"
66 #include "oops/oop.inline.hpp"
67 #include "oops/oopHandle.inline.hpp"
68 #include "oops/typeArrayOop.inline.hpp"
69 #include "runtime/arguments.hpp"
70 #include "runtime/handles.inline.hpp"
71 #include "runtime/java.hpp"
72 #include "runtime/javaCalls.hpp"
73 #include "runtime/mutexLocker.hpp"
74 #include "utilities/resourceHash.hpp"
75 #include "utilities/stringUtils.hpp"
76
77 SystemDictionaryShared::ArchiveInfo SystemDictionaryShared::_static_archive;
78 SystemDictionaryShared::ArchiveInfo SystemDictionaryShared::_dynamic_archive;
79
80 DumpTimeSharedClassTable* SystemDictionaryShared::_dumptime_table = nullptr;
81 DumpTimeSharedClassTable* SystemDictionaryShared::_cloned_dumptime_table = nullptr;
1295 }
1296
1297 if (!MetaspaceShared::is_shared_dynamic(name)) {
1298 // The names of all shared classes in the static dict must also be in the
1299 // static archive
1300 record = static_dict->lookup(name, hash, 0);
1301 }
1302
1303 if (record == nullptr && DynamicArchive::is_mapped()) {
1304 record = dynamic_dict->lookup(name, hash, 0);
1305 }
1306
1307 return record;
1308 }
1309
1310 InstanceKlass* SystemDictionaryShared::find_builtin_class(Symbol* name) {
1311 const RunTimeClassInfo* record = find_record(&_static_archive._builtin_dictionary,
1312 &_dynamic_archive._builtin_dictionary,
1313 name);
1314 if (record != nullptr) {
1315 #ifdef ASSERT
1316 if (UseCompressedClassPointers) {
1317 CompressedKlassPointers::verify_klass_pointer(record->_klass);
1318 }
1319 #endif
1320 assert(!record->_klass->is_hidden(), "hidden class cannot be looked up by name");
1321 // We did not save the classfile data of the generated LambdaForm invoker classes,
1322 // so we cannot support CLFH for such classes.
1323 if (record->_klass->is_generated_shared_class() && JvmtiExport::should_post_class_file_load_hook()) {
1324 return nullptr;
1325 }
1326 return record->_klass;
1327 } else {
1328 return nullptr;
1329 }
1330 }
1331
1332 void SystemDictionaryShared::update_shared_entry(InstanceKlass* k, int id) {
1333 assert(DumpSharedSpaces, "supported only when dumping");
1334 DumpTimeClassInfo* info = get_info(k);
1335 info->_id = id;
1336 }
1337
1338 const char* class_loader_name_for_shared(Klass* k) {
1339 assert(k != nullptr, "Sanity");
1340 assert(k->is_shared(), "Must be");
|