131
132 // Heap
133 int Universe::_verify_count = 0;
134
135 // Oop verification (see MacroAssembler::verify_oop)
136 uintptr_t Universe::_verify_oop_mask = 0;
137 uintptr_t Universe::_verify_oop_bits = (uintptr_t) -1;
138
139 int Universe::_base_vtable_size = 0;
140 bool Universe::_bootstrapping = false;
141 bool Universe::_module_initialized = false;
142 bool Universe::_fully_initialized = false;
143
144 size_t Universe::_heap_capacity_at_last_gc;
145 size_t Universe::_heap_used_at_last_gc = 0;
146
147 OopStorage* Universe::_vm_weak = NULL;
148 OopStorage* Universe::_vm_global = NULL;
149
150 CollectedHeap* Universe::_collectedHeap = NULL;
151
152 objArrayOop Universe::the_empty_class_array () {
153 return (objArrayOop)_the_empty_class_array.resolve();
154 }
155
156 oop Universe::main_thread_group() { return _main_thread_group.resolve(); }
157 void Universe::set_main_thread_group(oop group) { _main_thread_group = OopHandle(vm_global(), group); }
158
159 oop Universe::system_thread_group() { return _system_thread_group.resolve(); }
160 void Universe::set_system_thread_group(oop group) { _system_thread_group = OopHandle(vm_global(), group); }
161
162 oop Universe::the_null_string() { return _the_null_string.resolve(); }
163 oop Universe::the_min_jint_string() { return _the_min_jint_string.resolve(); }
164
165 oop Universe::null_ptr_exception_instance() { return _null_ptr_exception_instance.resolve(); }
166 oop Universe::arithmetic_exception_instance() { return _arithmetic_exception_instance.resolve(); }
167 oop Universe::virtual_machine_error_instance() { return _virtual_machine_error_instance.resolve(); }
168
169 oop Universe::the_null_sentinel() { return _the_null_sentinel.resolve(); }
170
835 || UseParallelGC
836 || use_large_pages, "Wrong alignment to use large pages");
837
838 // Now create the space.
839 ReservedHeapSpace total_rs(total_reserved, alignment, use_large_pages, AllocateHeapAt);
840
841 if (total_rs.is_reserved()) {
842 assert((total_reserved == total_rs.size()) && ((uintptr_t)total_rs.base() % alignment == 0),
843 "must be exactly of required size and alignment");
844 // We are good.
845
846 if (AllocateHeapAt != NULL) {
847 log_info(gc,heap)("Successfully allocated Java heap at location %s", AllocateHeapAt);
848 }
849
850 if (UseCompressedOops) {
851 CompressedOops::initialize(total_rs);
852 }
853
854 Universe::calculate_verify_data((HeapWord*)total_rs.base(), (HeapWord*)total_rs.end());
855
856 return total_rs;
857 }
858
859 vm_exit_during_initialization(
860 err_msg("Could not reserve enough space for " SIZE_FORMAT "KB object heap",
861 total_reserved/K));
862
863 // satisfy compiler
864 ShouldNotReachHere();
865 return ReservedHeapSpace(0, 0, false);
866 }
867
868
869 // It's the caller's responsibility to ensure glitch-freedom
870 // (if required).
871 void Universe::update_heap_info_at_gc() {
872 _heap_capacity_at_last_gc = heap()->capacity();
873 _heap_used_at_last_gc = heap()->used();
874 }
|
131
132 // Heap
133 int Universe::_verify_count = 0;
134
135 // Oop verification (see MacroAssembler::verify_oop)
136 uintptr_t Universe::_verify_oop_mask = 0;
137 uintptr_t Universe::_verify_oop_bits = (uintptr_t) -1;
138
139 int Universe::_base_vtable_size = 0;
140 bool Universe::_bootstrapping = false;
141 bool Universe::_module_initialized = false;
142 bool Universe::_fully_initialized = false;
143
144 size_t Universe::_heap_capacity_at_last_gc;
145 size_t Universe::_heap_used_at_last_gc = 0;
146
147 OopStorage* Universe::_vm_weak = NULL;
148 OopStorage* Universe::_vm_global = NULL;
149
150 CollectedHeap* Universe::_collectedHeap = NULL;
151 intptr_t Universe::_non_heap_offset = 0;
152
153 objArrayOop Universe::the_empty_class_array () {
154 return (objArrayOop)_the_empty_class_array.resolve();
155 }
156
157 oop Universe::main_thread_group() { return _main_thread_group.resolve(); }
158 void Universe::set_main_thread_group(oop group) { _main_thread_group = OopHandle(vm_global(), group); }
159
160 oop Universe::system_thread_group() { return _system_thread_group.resolve(); }
161 void Universe::set_system_thread_group(oop group) { _system_thread_group = OopHandle(vm_global(), group); }
162
163 oop Universe::the_null_string() { return _the_null_string.resolve(); }
164 oop Universe::the_min_jint_string() { return _the_min_jint_string.resolve(); }
165
166 oop Universe::null_ptr_exception_instance() { return _null_ptr_exception_instance.resolve(); }
167 oop Universe::arithmetic_exception_instance() { return _arithmetic_exception_instance.resolve(); }
168 oop Universe::virtual_machine_error_instance() { return _virtual_machine_error_instance.resolve(); }
169
170 oop Universe::the_null_sentinel() { return _the_null_sentinel.resolve(); }
171
836 || UseParallelGC
837 || use_large_pages, "Wrong alignment to use large pages");
838
839 // Now create the space.
840 ReservedHeapSpace total_rs(total_reserved, alignment, use_large_pages, AllocateHeapAt);
841
842 if (total_rs.is_reserved()) {
843 assert((total_reserved == total_rs.size()) && ((uintptr_t)total_rs.base() % alignment == 0),
844 "must be exactly of required size and alignment");
845 // We are good.
846
847 if (AllocateHeapAt != NULL) {
848 log_info(gc,heap)("Successfully allocated Java heap at location %s", AllocateHeapAt);
849 }
850
851 if (UseCompressedOops) {
852 CompressedOops::initialize(total_rs);
853 }
854
855 Universe::calculate_verify_data((HeapWord*)total_rs.base(), (HeapWord*)total_rs.end());
856
857 // Make sure oop + offset is past the Java heap, plus some random positive offset.
858 // The offset should not hide the real alignment up to object alignment or cache line size.
859 intptr_t non_heap_offset = (intptr_t) total_rs.size() + abs(os::random());
860 non_heap_offset = align_up(non_heap_offset, MinObjAlignmentInBytes);
861 non_heap_offset = align_up(non_heap_offset, VM_Version::L1_data_cache_line_size());
862 Universe::_non_heap_offset = non_heap_offset;
863
864 return total_rs;
865 }
866
867 vm_exit_during_initialization(
868 err_msg("Could not reserve enough space for " SIZE_FORMAT "KB object heap",
869 total_reserved/K));
870
871 // satisfy compiler
872 ShouldNotReachHere();
873 return ReservedHeapSpace(0, 0, false);
874 }
875
876
877 // It's the caller's responsibility to ensure glitch-freedom
878 // (if required).
879 void Universe::update_heap_info_at_gc() {
880 _heap_capacity_at_last_gc = heap()->capacity();
881 _heap_used_at_last_gc = heap()->used();
882 }
|