47 #include "memory/metaspaceClosure.hpp"
48 #include "memory/metaspaceCounters.hpp"
49 #include "memory/metaspaceShared.hpp"
50 #include "memory/oopFactory.hpp"
51 #include "memory/resourceArea.hpp"
52 #include "memory/universe.hpp"
53 #include "oops/compressedOops.hpp"
54 #include "oops/constantPool.hpp"
55 #include "oops/instanceClassLoaderKlass.hpp"
56 #include "oops/instanceKlass.hpp"
57 #include "oops/instanceMirrorKlass.hpp"
58 #include "oops/instanceRefKlass.hpp"
59 #include "oops/objArrayOop.inline.hpp"
60 #include "oops/oop.inline.hpp"
61 #include "oops/typeArrayKlass.hpp"
62 #include "prims/resolvedMethodTable.hpp"
63 #include "runtime/arguments.hpp"
64 #include "runtime/atomic.hpp"
65 #include "runtime/deoptimization.hpp"
66 #include "runtime/flags/flagSetting.hpp"
67 #include "runtime/flags/jvmFlagConstraintList.hpp"
68 #include "runtime/handles.inline.hpp"
69 #include "runtime/init.hpp"
70 #include "runtime/java.hpp"
71 #include "runtime/javaCalls.hpp"
72 #include "runtime/sharedRuntime.hpp"
73 #include "runtime/synchronizer.hpp"
74 #include "runtime/thread.inline.hpp"
75 #include "runtime/timerTrace.hpp"
76 #include "runtime/vmOperations.hpp"
77 #include "services/memoryService.hpp"
78 #include "utilities/align.hpp"
79 #include "utilities/copy.hpp"
80 #include "utilities/debug.hpp"
81 #include "utilities/events.hpp"
82 #include "utilities/formatBuffer.hpp"
83 #include "utilities/hashtable.inline.hpp"
84 #include "utilities/macros.hpp"
85 #include "utilities/ostream.hpp"
86 #include "utilities/preserveException.hpp"
87
653 initialize_global_behaviours();
654
655 GCConfig::arguments()->initialize_heap_sizes();
656
657 jint status = Universe::initialize_heap();
658 if (status != JNI_OK) {
659 return status;
660 }
661
662 Universe::initialize_tlab();
663
664 Metaspace::global_initialize();
665
666 // Initialize performance counters for metaspaces
667 MetaspaceCounters::initialize_performance_counters();
668 CompressedClassSpaceCounters::initialize_performance_counters();
669
670 AOTLoader::universe_init();
671
672 // Checks 'AfterMemoryInit' constraints.
673 if (!JVMFlagConstraintList::check_constraints(JVMFlagConstraint::AfterMemoryInit)) {
674 return JNI_EINVAL;
675 }
676
677 // Create memory for metadata. Must be after initializing heap for
678 // DumpSharedSpaces.
679 ClassLoaderData::init_null_class_loader_data();
680
681 // We have a heap so create the Method* caches before
682 // Metaspace::initialize_shared_spaces() tries to populate them.
683 Universe::_finalizer_register_cache = new LatestMethodCache();
684 Universe::_loader_addClass_cache = new LatestMethodCache();
685 Universe::_throw_illegal_access_error_cache = new LatestMethodCache();
686 Universe::_throw_no_such_method_error_cache = new LatestMethodCache();
687 Universe::_do_stack_walk_cache = new LatestMethodCache();
688
689 #if INCLUDE_CDS
690 if (UseSharedSpaces) {
691 // Read the data structures supporting the shared spaces (shared
692 // system dictionary, symbol table, etc.). After that, access to
693 // the file (other than the mapped regions) is no longer needed, and
|
47 #include "memory/metaspaceClosure.hpp"
48 #include "memory/metaspaceCounters.hpp"
49 #include "memory/metaspaceShared.hpp"
50 #include "memory/oopFactory.hpp"
51 #include "memory/resourceArea.hpp"
52 #include "memory/universe.hpp"
53 #include "oops/compressedOops.hpp"
54 #include "oops/constantPool.hpp"
55 #include "oops/instanceClassLoaderKlass.hpp"
56 #include "oops/instanceKlass.hpp"
57 #include "oops/instanceMirrorKlass.hpp"
58 #include "oops/instanceRefKlass.hpp"
59 #include "oops/objArrayOop.inline.hpp"
60 #include "oops/oop.inline.hpp"
61 #include "oops/typeArrayKlass.hpp"
62 #include "prims/resolvedMethodTable.hpp"
63 #include "runtime/arguments.hpp"
64 #include "runtime/atomic.hpp"
65 #include "runtime/deoptimization.hpp"
66 #include "runtime/flags/flagSetting.hpp"
67 #include "runtime/handles.inline.hpp"
68 #include "runtime/init.hpp"
69 #include "runtime/java.hpp"
70 #include "runtime/javaCalls.hpp"
71 #include "runtime/sharedRuntime.hpp"
72 #include "runtime/synchronizer.hpp"
73 #include "runtime/thread.inline.hpp"
74 #include "runtime/timerTrace.hpp"
75 #include "runtime/vmOperations.hpp"
76 #include "services/memoryService.hpp"
77 #include "utilities/align.hpp"
78 #include "utilities/copy.hpp"
79 #include "utilities/debug.hpp"
80 #include "utilities/events.hpp"
81 #include "utilities/formatBuffer.hpp"
82 #include "utilities/hashtable.inline.hpp"
83 #include "utilities/macros.hpp"
84 #include "utilities/ostream.hpp"
85 #include "utilities/preserveException.hpp"
86
652 initialize_global_behaviours();
653
654 GCConfig::arguments()->initialize_heap_sizes();
655
656 jint status = Universe::initialize_heap();
657 if (status != JNI_OK) {
658 return status;
659 }
660
661 Universe::initialize_tlab();
662
663 Metaspace::global_initialize();
664
665 // Initialize performance counters for metaspaces
666 MetaspaceCounters::initialize_performance_counters();
667 CompressedClassSpaceCounters::initialize_performance_counters();
668
669 AOTLoader::universe_init();
670
671 // Checks 'AfterMemoryInit' constraints.
672 if (!JVMFlag::check_all_constraints(JVMFlag::AfterMemoryInit)) {
673 return JNI_EINVAL;
674 }
675
676 // Create memory for metadata. Must be after initializing heap for
677 // DumpSharedSpaces.
678 ClassLoaderData::init_null_class_loader_data();
679
680 // We have a heap so create the Method* caches before
681 // Metaspace::initialize_shared_spaces() tries to populate them.
682 Universe::_finalizer_register_cache = new LatestMethodCache();
683 Universe::_loader_addClass_cache = new LatestMethodCache();
684 Universe::_throw_illegal_access_error_cache = new LatestMethodCache();
685 Universe::_throw_no_such_method_error_cache = new LatestMethodCache();
686 Universe::_do_stack_walk_cache = new LatestMethodCache();
687
688 #if INCLUDE_CDS
689 if (UseSharedSpaces) {
690 // Read the data structures supporting the shared spaces (shared
691 // system dictionary, symbol table, etc.). After that, access to
692 // the file (other than the mapped regions) is no longer needed, and
|