< 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

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





1411     assert(!record->_klass->is_hidden(), "hidden class cannot be looked up by name");
1412     assert(check_alignment(record->_klass), "Address not aligned");
1413     return record->_klass;
1414   } else {
1415     return NULL;
1416   }
1417 }
1418 
1419 void SystemDictionaryShared::update_shared_entry(InstanceKlass* k, int id) {
1420   assert(DumpSharedSpaces, "supported only when dumping");
1421   DumpTimeClassInfo* info = find_or_allocate_info_for(k);
1422   info->_id = id;
1423 }
1424 
1425 const char* class_loader_name_for_shared(Klass* k) {
1426   assert(k != nullptr, "Sanity");
1427   assert(k->is_shared(), "Must be");
1428   assert(k->is_instance_klass(), "Must be");
1429   InstanceKlass* ik = InstanceKlass::cast(k);
1430   if (ik->is_shared_boot_class()) {
1431     return "boot_loader";
1432   } else if (ik->is_shared_platform_class()) {

  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

1392       }
1393     }
1394   }
1395 
1396   if (!MetaspaceShared::is_shared_dynamic(name)) {
1397     // The names of all shared classes in the static dict must also be in the
1398     // static archive
1399     record = static_dict->lookup(name, hash, 0);
1400   }
1401 
1402   if (record == NULL && DynamicArchive::is_mapped()) {
1403     record = dynamic_dict->lookup(name, hash, 0);
1404   }
1405 
1406   return record;
1407 }
1408 
1409 InstanceKlass* SystemDictionaryShared::find_builtin_class(Symbol* name) {
1410   const RunTimeClassInfo* record = find_record(&_builtin_dictionary, &_dynamic_builtin_dictionary, name);
1411   if (record != NULL) {
1412 #ifdef ASSERT
1413     if (UseCompressedClassPointers) {
1414       CompressedKlassPointers::verify_klass_pointer(record->_klass);
1415     }
1416 #endif
1417     assert(!record->_klass->is_hidden(), "hidden class cannot be looked up by name");

1418     return record->_klass;
1419   } else {
1420     return NULL;
1421   }
1422 }
1423 
1424 void SystemDictionaryShared::update_shared_entry(InstanceKlass* k, int id) {
1425   assert(DumpSharedSpaces, "supported only when dumping");
1426   DumpTimeClassInfo* info = find_or_allocate_info_for(k);
1427   info->_id = id;
1428 }
1429 
1430 const char* class_loader_name_for_shared(Klass* k) {
1431   assert(k != nullptr, "Sanity");
1432   assert(k->is_shared(), "Must be");
1433   assert(k->is_instance_klass(), "Must be");
1434   InstanceKlass* ik = InstanceKlass::cast(k);
1435   if (ik->is_shared_boot_class()) {
1436     return "boot_loader";
1437   } else if (ik->is_shared_platform_class()) {
< prev index next >