< prev index next >

src/hotspot/share/classfile/systemDictionaryShared.cpp

Print this page

  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 = NULL;
  80 DumpTimeSharedClassTable* SystemDictionaryShared::_cloned_dumptime_table = NULL;

1292   }
1293 
1294   if (!MetaspaceShared::is_shared_dynamic(name)) {
1295     // The names of all shared classes in the static dict must also be in the
1296     // static archive
1297     record = static_dict->lookup(name, hash, 0);
1298   }
1299 
1300   if (record == NULL && DynamicArchive::is_mapped()) {
1301     record = dynamic_dict->lookup(name, hash, 0);
1302   }
1303 
1304   return record;
1305 }
1306 
1307 InstanceKlass* SystemDictionaryShared::find_builtin_class(Symbol* name) {
1308   const RunTimeClassInfo* record = find_record(&_static_archive._builtin_dictionary,
1309                                                &_dynamic_archive._builtin_dictionary,
1310                                                name);
1311   if (record != NULL) {





1312     assert(!record->_klass->is_hidden(), "hidden class cannot be looked up by name");
1313     assert(check_alignment(record->_klass), "Address not aligned");
1314     // We did not save the classfile data of the generated LambdaForm invoker classes,
1315     // so we cannot support CLFH for such classes.
1316     if (record->_klass->is_generated_shared_class() && JvmtiExport::should_post_class_file_load_hook()) {
1317        return NULL;
1318     }
1319     return record->_klass;
1320   } else {
1321     return NULL;
1322   }
1323 }
1324 
1325 void SystemDictionaryShared::update_shared_entry(InstanceKlass* k, int id) {
1326   assert(DumpSharedSpaces, "supported only when dumping");
1327   DumpTimeClassInfo* info = get_info(k);
1328   info->_id = id;
1329 }
1330 
1331 const char* class_loader_name_for_shared(Klass* k) {
1332   assert(k != nullptr, "Sanity");
1333   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 = NULL;
  81 DumpTimeSharedClassTable* SystemDictionaryShared::_cloned_dumptime_table = NULL;

1293   }
1294 
1295   if (!MetaspaceShared::is_shared_dynamic(name)) {
1296     // The names of all shared classes in the static dict must also be in the
1297     // static archive
1298     record = static_dict->lookup(name, hash, 0);
1299   }
1300 
1301   if (record == NULL && DynamicArchive::is_mapped()) {
1302     record = dynamic_dict->lookup(name, hash, 0);
1303   }
1304 
1305   return record;
1306 }
1307 
1308 InstanceKlass* SystemDictionaryShared::find_builtin_class(Symbol* name) {
1309   const RunTimeClassInfo* record = find_record(&_static_archive._builtin_dictionary,
1310                                                &_dynamic_archive._builtin_dictionary,
1311                                                name);
1312   if (record != NULL) {
1313 #ifdef ASSERT
1314     if (UseCompressedClassPointers) {
1315       CompressedKlassPointers::verify_klass_pointer(record->_klass);
1316     }
1317 #endif
1318     assert(!record->_klass->is_hidden(), "hidden class cannot be looked up by name");

1319     // We did not save the classfile data of the generated LambdaForm invoker classes,
1320     // so we cannot support CLFH for such classes.
1321     if (record->_klass->is_generated_shared_class() && JvmtiExport::should_post_class_file_load_hook()) {
1322        return NULL;
1323     }
1324     return record->_klass;
1325   } else {
1326     return NULL;
1327   }
1328 }
1329 
1330 void SystemDictionaryShared::update_shared_entry(InstanceKlass* k, int id) {
1331   assert(DumpSharedSpaces, "supported only when dumping");
1332   DumpTimeClassInfo* info = get_info(k);
1333   info->_id = id;
1334 }
1335 
1336 const char* class_loader_name_for_shared(Klass* k) {
1337   assert(k != nullptr, "Sanity");
1338   assert(k->is_shared(), "Must be");
< prev index next >