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.
|
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
630 TraceTime timer("Genesis", log_is_enabled(Info, startuptime), LogTag::_startuptime);
631
632 JavaClasses::compute_hard_coded_offsets();
633
634 jint status = Universe::initialize_heap();
635 if (status != JNI_OK) {
636 return status;
637 }
638
639 Metaspace::global_initialize();
640
641 // Checks 'AfterMemoryInit' constraints.
642 if (!CommandLineFlagConstraintList::check_constraints(CommandLineFlagConstraint::AfterMemoryInit)) {
643 return JNI_EINVAL;
644 }
645
646 // Create memory for metadata. Must be after initializing heap for
647 // DumpSharedSpaces.
648 ClassLoaderData::init_null_class_loader_data();
649
650 // We have a heap so create the Method* caches before
651 // Metaspace::initialize_shared_spaces() tries to populate them.
|