equal
deleted
inserted
replaced
97 |
97 |
98 size_t Universe::_heap_capacity_at_last_gc; |
98 size_t Universe::_heap_capacity_at_last_gc; |
99 size_t Universe::_heap_used_at_last_gc; |
99 size_t Universe::_heap_used_at_last_gc; |
100 |
100 |
101 CollectedHeap* Universe::_collectedHeap = NULL; |
101 CollectedHeap* Universe::_collectedHeap = NULL; |
|
102 address Universe::_heap_base = NULL; |
102 |
103 |
103 |
104 |
104 void Universe::basic_type_classes_do(void f(klassOop)) { |
105 void Universe::basic_type_classes_do(void f(klassOop)) { |
105 f(boolArrayKlassObj()); |
106 f(boolArrayKlassObj()); |
106 f(byteArrayKlassObj()); |
107 f(byteArrayKlassObj()); |
462 } |
463 } |
463 |
464 |
464 |
465 |
465 class FixupMirrorClosure: public ObjectClosure { |
466 class FixupMirrorClosure: public ObjectClosure { |
466 public: |
467 public: |
467 void do_object(oop obj) { |
468 virtual void do_object(oop obj) { |
468 if (obj->is_klass()) { |
469 if (obj->is_klass()) { |
469 EXCEPTION_MARK; |
470 EXCEPTION_MARK; |
470 KlassHandle k(THREAD, klassOop(obj)); |
471 KlassHandle k(THREAD, klassOop(obj)); |
471 // We will never reach the CATCH below since Exceptions::_throw will cause |
472 // We will never reach the CATCH below since Exceptions::_throw will cause |
472 // the VM to exit if an exception is thrown during initialization |
473 // the VM to exit if an exception is thrown during initialization |
665 assert(!Universe::_fully_initialized, "called after initialize_vtables"); |
666 assert(!Universe::_fully_initialized, "called after initialize_vtables"); |
666 guarantee(1 << LogHeapWordSize == sizeof(HeapWord), |
667 guarantee(1 << LogHeapWordSize == sizeof(HeapWord), |
667 "LogHeapWordSize is incorrect."); |
668 "LogHeapWordSize is incorrect."); |
668 guarantee(sizeof(oop) >= sizeof(HeapWord), "HeapWord larger than oop?"); |
669 guarantee(sizeof(oop) >= sizeof(HeapWord), "HeapWord larger than oop?"); |
669 guarantee(sizeof(oop) % sizeof(HeapWord) == 0, |
670 guarantee(sizeof(oop) % sizeof(HeapWord) == 0, |
670 "oop size is not not a multiple of HeapWord size"); |
671 "oop size is not not a multiple of HeapWord size"); |
671 TraceTime timer("Genesis", TraceStartupTime); |
672 TraceTime timer("Genesis", TraceStartupTime); |
672 GC_locker::lock(); // do not allow gc during bootstrapping |
673 GC_locker::lock(); // do not allow gc during bootstrapping |
673 JavaClasses::compute_hard_coded_offsets(); |
674 JavaClasses::compute_hard_coded_offsets(); |
674 |
675 |
675 // Get map info from shared archive file. |
676 // Get map info from shared archive file. |
756 } |
757 } |
757 |
758 |
758 jint status = Universe::heap()->initialize(); |
759 jint status = Universe::heap()->initialize(); |
759 if (status != JNI_OK) { |
760 if (status != JNI_OK) { |
760 return status; |
761 return status; |
|
762 } |
|
763 if (UseCompressedOops) { |
|
764 // Subtract a page because something can get allocated at heap base. |
|
765 // This also makes implicit null checking work, because the |
|
766 // memory+1 page below heap_base needs to cause a signal. |
|
767 // See needs_explicit_null_check. |
|
768 // Only set the heap base for compressed oops because it indicates |
|
769 // compressed oops for pstack code. |
|
770 Universe::_heap_base = Universe::heap()->base() - os::vm_page_size(); |
761 } |
771 } |
762 |
772 |
763 // We will never reach the CATCH below since Exceptions::_throw will cause |
773 // We will never reach the CATCH below since Exceptions::_throw will cause |
764 // the VM to exit if an exception is thrown during initialization |
774 // the VM to exit if an exception is thrown during initialization |
765 |
775 |