< 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/objArrayOop.inline.hpp"
  64 #include "oops/oop.inline.hpp"
  65 #include "oops/oopHandle.inline.hpp"
  66 #include "oops/typeArrayOop.inline.hpp"
  67 #include "runtime/arguments.hpp"
  68 #include "runtime/handles.inline.hpp"
  69 #include "runtime/java.hpp"
  70 #include "runtime/javaCalls.hpp"
  71 #include "runtime/mutexLocker.hpp"
  72 #include "utilities/hashtable.inline.hpp"
  73 #include "utilities/resourceHash.hpp"
  74 #include "utilities/stringUtils.hpp"
  75 
  76 DumpTimeSharedClassTable* SystemDictionaryShared::_dumptime_table = NULL;
  77 DumpTimeSharedClassTable* SystemDictionaryShared::_cloned_dumptime_table = NULL;
  78 DumpTimeLambdaProxyClassDictionary* SystemDictionaryShared::_dumptime_lambda_proxy_class_dictionary = NULL;
  79 DumpTimeLambdaProxyClassDictionary* SystemDictionaryShared::_cloned_dumptime_lambda_proxy_class_dictionary = NULL;
  80 // SystemDictionaries in the base layer static archive

1396       }
1397     }
1398   }
1399 
1400   if (!MetaspaceShared::is_shared_dynamic(name)) {
1401     // The names of all shared classes in the static dict must also be in the
1402     // static archive
1403     record = static_dict->lookup(name, hash, 0);
1404   }
1405 
1406   if (record == NULL && DynamicArchive::is_mapped()) {
1407     record = dynamic_dict->lookup(name, hash, 0);
1408   }
1409 
1410   return record;
1411 }
1412 
1413 InstanceKlass* SystemDictionaryShared::find_builtin_class(Symbol* name) {
1414   const RunTimeClassInfo* record = find_record(&_builtin_dictionary, &_dynamic_builtin_dictionary, name);
1415   if (record != NULL) {





1416     assert(!record->_klass->is_hidden(), "hidden class cannot be looked up by name");
1417     assert(check_alignment(record->_klass), "Address not aligned");
1418     // We did not save the classfile data of the regenerated LambdaForm invoker classes,
1419     // so we cannot support CLFH for such classes.
1420     if (record->_klass->is_regenerated() && JvmtiExport::should_post_class_file_load_hook()) {
1421        return NULL;
1422     }
1423     return record->_klass;
1424   } else {
1425     return NULL;
1426   }
1427 }
1428 
1429 void SystemDictionaryShared::update_shared_entry(InstanceKlass* k, int id) {
1430   assert(DumpSharedSpaces, "supported only when dumping");
1431   DumpTimeClassInfo* info = find_or_allocate_info_for(k);
1432   info->_id = id;
1433 }
1434 
1435 const char* class_loader_name_for_shared(Klass* k) {
1436   assert(k != nullptr, "Sanity");
1437   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/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/hashtable.inline.hpp"
  74 #include "utilities/resourceHash.hpp"
  75 #include "utilities/stringUtils.hpp"
  76 
  77 DumpTimeSharedClassTable* SystemDictionaryShared::_dumptime_table = NULL;
  78 DumpTimeSharedClassTable* SystemDictionaryShared::_cloned_dumptime_table = NULL;
  79 DumpTimeLambdaProxyClassDictionary* SystemDictionaryShared::_dumptime_lambda_proxy_class_dictionary = NULL;
  80 DumpTimeLambdaProxyClassDictionary* SystemDictionaryShared::_cloned_dumptime_lambda_proxy_class_dictionary = NULL;
  81 // SystemDictionaries in the base layer static archive

1397       }
1398     }
1399   }
1400 
1401   if (!MetaspaceShared::is_shared_dynamic(name)) {
1402     // The names of all shared classes in the static dict must also be in the
1403     // static archive
1404     record = static_dict->lookup(name, hash, 0);
1405   }
1406 
1407   if (record == NULL && DynamicArchive::is_mapped()) {
1408     record = dynamic_dict->lookup(name, hash, 0);
1409   }
1410 
1411   return record;
1412 }
1413 
1414 InstanceKlass* SystemDictionaryShared::find_builtin_class(Symbol* name) {
1415   const RunTimeClassInfo* record = find_record(&_builtin_dictionary, &_dynamic_builtin_dictionary, name);
1416   if (record != NULL) {
1417 #ifdef ASSERT
1418     if (UseCompressedClassPointers) {
1419       CompressedKlassPointers::verify_klass_pointer(record->_klass);
1420     }
1421 #endif
1422     assert(!record->_klass->is_hidden(), "hidden class cannot be looked up by name");
1423     // assert(check_alignment(record->_klass), "Address not aligned");
1424     // We did not save the classfile data of the regenerated LambdaForm invoker classes,
1425     // so we cannot support CLFH for such classes.
1426     if (record->_klass->is_regenerated() && JvmtiExport::should_post_class_file_load_hook()) {
1427        return NULL;
1428     }
1429     return record->_klass;
1430   } else {
1431     return NULL;
1432   }
1433 }
1434 
1435 void SystemDictionaryShared::update_shared_entry(InstanceKlass* k, int id) {
1436   assert(DumpSharedSpaces, "supported only when dumping");
1437   DumpTimeClassInfo* info = find_or_allocate_info_for(k);
1438   info->_id = id;
1439 }
1440 
1441 const char* class_loader_name_for_shared(Klass* k) {
1442   assert(k != nullptr, "Sanity");
1443   assert(k->is_shared(), "Must be");
< prev index next >