47 #include "memory/universe.hpp"
48 #include "memory/universe.inline.hpp"
49 #include "oops/constantPool.hpp"
50 #include "oops/instanceClassLoaderKlass.hpp"
51 #include "oops/instanceKlass.hpp"
52 #include "oops/instanceMirrorKlass.hpp"
53 #include "oops/instanceRefKlass.hpp"
54 #include "oops/objArrayOop.inline.hpp"
55 #include "oops/oop.inline.hpp"
56 #include "oops/typeArrayKlass.hpp"
57 #include "prims/jvmtiRedefineClassesTrace.hpp"
58 #include "runtime/arguments.hpp"
59 #include "runtime/atomic.inline.hpp"
60 #include "runtime/commandLineFlagConstraintList.hpp"
61 #include "runtime/deoptimization.hpp"
62 #include "runtime/fprofiler.hpp"
63 #include "runtime/handles.inline.hpp"
64 #include "runtime/init.hpp"
65 #include "runtime/java.hpp"
66 #include "runtime/javaCalls.hpp"
67 #include "runtime/sharedRuntime.hpp"
68 #include "runtime/synchronizer.hpp"
69 #include "runtime/thread.inline.hpp"
70 #include "runtime/timer.hpp"
71 #include "runtime/vm_operations.hpp"
72 #include "services/memoryService.hpp"
73 #include "utilities/copy.hpp"
74 #include "utilities/events.hpp"
75 #include "utilities/hashtable.inline.hpp"
76 #include "utilities/macros.hpp"
77 #include "utilities/ostream.hpp"
78 #include "utilities/preserveException.hpp"
79 #if INCLUDE_ALL_GCS
80 #include "gc/cms/cmsCollectorPolicy.hpp"
81 #include "gc/g1/g1CollectedHeap.inline.hpp"
82 #include "gc/g1/g1CollectorPolicy.hpp"
83 #include "gc/parallel/parallelScavengeHeap.hpp"
84 #include "gc/shared/adaptiveSizePolicy.hpp"
85 #endif // INCLUDE_ALL_GCS
86 #if INCLUDE_CDS
609 // setting the low-order bit will ensure that the low half of the
610 // word will never look like that of a real oop.
611 //
612 // Using the OS-supplied non-memory-address word (usually 0 or -1)
613 // will take care of the high bits, however many there are.
614
615 if (_non_oop_bits == 0) {
616 _non_oop_bits = (intptr_t)os::non_memory_address_word() | 1;
617 }
618
619 return (void*)_non_oop_bits;
620 }
621
622 jint universe_init() {
623 assert(!Universe::_fully_initialized, "called after initialize_vtables");
624 guarantee(1 << LogHeapWordSize == sizeof(HeapWord),
625 "LogHeapWordSize is incorrect.");
626 guarantee(sizeof(oop) >= sizeof(HeapWord), "HeapWord larger than oop?");
627 guarantee(sizeof(oop) % sizeof(HeapWord) == 0,
628 "oop size is not not a multiple of HeapWord size");
629 TraceTime timer("Genesis", TraceStartupTime);
630 JavaClasses::compute_hard_coded_offsets();
631
632 jint status = Universe::initialize_heap();
633 if (status != JNI_OK) {
634 return status;
635 }
636
637 Metaspace::global_initialize();
638
639 // Checks 'AfterMemoryInit' constraints.
640 if (!CommandLineFlagConstraintList::check_constraints(CommandLineFlagConstraint::AfterMemoryInit)) {
641 return JNI_EINVAL;
642 }
643
644 // Create memory for metadata. Must be after initializing heap for
645 // DumpSharedSpaces.
646 ClassLoaderData::init_null_class_loader_data();
647
648 // We have a heap so create the Method* caches before
649 // Metaspace::initialize_shared_spaces() tries to populate them.
|
47 #include "memory/universe.hpp"
48 #include "memory/universe.inline.hpp"
49 #include "oops/constantPool.hpp"
50 #include "oops/instanceClassLoaderKlass.hpp"
51 #include "oops/instanceKlass.hpp"
52 #include "oops/instanceMirrorKlass.hpp"
53 #include "oops/instanceRefKlass.hpp"
54 #include "oops/objArrayOop.inline.hpp"
55 #include "oops/oop.inline.hpp"
56 #include "oops/typeArrayKlass.hpp"
57 #include "prims/jvmtiRedefineClassesTrace.hpp"
58 #include "runtime/arguments.hpp"
59 #include "runtime/atomic.inline.hpp"
60 #include "runtime/commandLineFlagConstraintList.hpp"
61 #include "runtime/deoptimization.hpp"
62 #include "runtime/fprofiler.hpp"
63 #include "runtime/handles.inline.hpp"
64 #include "runtime/init.hpp"
65 #include "runtime/java.hpp"
66 #include "runtime/javaCalls.hpp"
67 #include "runtime/logTimer.hpp"
68 #include "runtime/sharedRuntime.hpp"
69 #include "runtime/synchronizer.hpp"
70 #include "runtime/thread.inline.hpp"
71 #include "runtime/timer.hpp"
72 #include "runtime/vm_operations.hpp"
73 #include "services/memoryService.hpp"
74 #include "utilities/copy.hpp"
75 #include "utilities/events.hpp"
76 #include "utilities/hashtable.inline.hpp"
77 #include "utilities/macros.hpp"
78 #include "utilities/ostream.hpp"
79 #include "utilities/preserveException.hpp"
80 #if INCLUDE_ALL_GCS
81 #include "gc/cms/cmsCollectorPolicy.hpp"
82 #include "gc/g1/g1CollectedHeap.inline.hpp"
83 #include "gc/g1/g1CollectorPolicy.hpp"
84 #include "gc/parallel/parallelScavengeHeap.hpp"
85 #include "gc/shared/adaptiveSizePolicy.hpp"
86 #endif // INCLUDE_ALL_GCS
87 #if INCLUDE_CDS
610 // setting the low-order bit will ensure that the low half of the
611 // word will never look like that of a real oop.
612 //
613 // Using the OS-supplied non-memory-address word (usually 0 or -1)
614 // will take care of the high bits, however many there are.
615
616 if (_non_oop_bits == 0) {
617 _non_oop_bits = (intptr_t)os::non_memory_address_word() | 1;
618 }
619
620 return (void*)_non_oop_bits;
621 }
622
623 jint universe_init() {
624 assert(!Universe::_fully_initialized, "called after initialize_vtables");
625 guarantee(1 << LogHeapWordSize == sizeof(HeapWord),
626 "LogHeapWordSize is incorrect.");
627 guarantee(sizeof(oop) >= sizeof(HeapWord), "HeapWord larger than oop?");
628 guarantee(sizeof(oop) % sizeof(HeapWord) == 0,
629 "oop size is not not a multiple of HeapWord size");
630
631 TraceStartupTime timer("Genesis");
632
633 JavaClasses::compute_hard_coded_offsets();
634
635 jint status = Universe::initialize_heap();
636 if (status != JNI_OK) {
637 return status;
638 }
639
640 Metaspace::global_initialize();
641
642 // Checks 'AfterMemoryInit' constraints.
643 if (!CommandLineFlagConstraintList::check_constraints(CommandLineFlagConstraint::AfterMemoryInit)) {
644 return JNI_EINVAL;
645 }
646
647 // Create memory for metadata. Must be after initializing heap for
648 // DumpSharedSpaces.
649 ClassLoaderData::init_null_class_loader_data();
650
651 // We have a heap so create the Method* caches before
652 // Metaspace::initialize_shared_spaces() tries to populate them.
|