639 return (void*)_non_oop_bits; 640 } 641 642 jint universe_init() { 643 assert(!Universe::_fully_initialized, "called after initialize_vtables"); 644 guarantee(1 << LogHeapWordSize == sizeof(HeapWord), 645 "LogHeapWordSize is incorrect."); 646 guarantee(sizeof(oop) >= sizeof(HeapWord), "HeapWord larger than oop?"); 647 guarantee(sizeof(oop) % sizeof(HeapWord) == 0, 648 "oop size is not not a multiple of HeapWord size"); 649 TraceTime timer("Genesis", TraceStartupTime); 650 JavaClasses::compute_hard_coded_offsets(); 651 652 jint status = Universe::initialize_heap(); 653 if (status != JNI_OK) { 654 return status; 655 } 656 657 Metaspace::global_initialize(); 658 659 // Create memory for metadata. Must be after initializing heap for 660 // DumpSharedSpaces. 661 ClassLoaderData::init_null_class_loader_data(); 662 663 // We have a heap so create the Method* caches before 664 // Metaspace::initialize_shared_spaces() tries to populate them. 665 Universe::_finalizer_register_cache = new LatestMethodCache(); 666 Universe::_loader_addClass_cache = new LatestMethodCache(); 667 Universe::_pd_implies_cache = new LatestMethodCache(); 668 Universe::_throw_illegal_access_error_cache = new LatestMethodCache(); 669 670 if (UseSharedSpaces) { 671 // Read the data structures supporting the shared spaces (shared 672 // system dictionary, symbol table, etc.). After that, access to 673 // the file (other than the mapped regions) is no longer needed, and 674 // the file is closed. Closing the file does not affect the 675 // currently mapped regions. 676 MetaspaceShared::initialize_shared_spaces(); 677 StringTable::create_table(); 678 } else { | 639 return (void*)_non_oop_bits; 640 } 641 642 jint universe_init() { 643 assert(!Universe::_fully_initialized, "called after initialize_vtables"); 644 guarantee(1 << LogHeapWordSize == sizeof(HeapWord), 645 "LogHeapWordSize is incorrect."); 646 guarantee(sizeof(oop) >= sizeof(HeapWord), "HeapWord larger than oop?"); 647 guarantee(sizeof(oop) % sizeof(HeapWord) == 0, 648 "oop size is not not a multiple of HeapWord size"); 649 TraceTime timer("Genesis", TraceStartupTime); 650 JavaClasses::compute_hard_coded_offsets(); 651 652 jint status = Universe::initialize_heap(); 653 if (status != JNI_OK) { 654 return status; 655 } 656 657 Metaspace::global_initialize(); 658 659 // Checks 'AfterMemoryInit' constraints. 660 if (!CommandLineFlags::check_constraints_of_after_memory_init()) { 661 return JNI_EINVAL; 662 } 663 664 // Create memory for metadata. Must be after initializing heap for 665 // DumpSharedSpaces. 666 ClassLoaderData::init_null_class_loader_data(); 667 668 // We have a heap so create the Method* caches before 669 // Metaspace::initialize_shared_spaces() tries to populate them. 670 Universe::_finalizer_register_cache = new LatestMethodCache(); 671 Universe::_loader_addClass_cache = new LatestMethodCache(); 672 Universe::_pd_implies_cache = new LatestMethodCache(); 673 Universe::_throw_illegal_access_error_cache = new LatestMethodCache(); 674 675 if (UseSharedSpaces) { 676 // Read the data structures supporting the shared spaces (shared 677 // system dictionary, symbol table, etc.). After that, access to 678 // the file (other than the mapped regions) is no longer needed, and 679 // the file is closed. Closing the file does not affect the 680 // currently mapped regions. 681 MetaspaceShared::initialize_shared_spaces(); 682 StringTable::create_table(); 683 } else { |