175 176 static oop _main_thread_group; // Reference to the main thread group object 177 static oop _system_thread_group; // Reference to the system thread group object 178 179 static typeArrayOop _the_empty_byte_array; // Canonicalized byte array 180 static typeArrayOop _the_empty_short_array; // Canonicalized short array 181 static typeArrayOop _the_empty_int_array; // Canonicalized int array 182 static objArrayOop _the_empty_system_obj_array; // Canonicalized system obj array 183 static objArrayOop _the_empty_class_klass_array; // Canonicalized obj array of type java.lang.Class 184 static objArrayOop _the_array_interfaces_array; // Canonicalized 2-array of cloneable & serializable klasses 185 static oop _the_null_string; // A cache of "null" as a Java string 186 static oop _the_min_jint_string; // A cache of "-2147483648" as a Java string 187 static LatestMethodOopCache* _finalizer_register_cache; // static method for registering finalizable objects 188 static LatestMethodOopCache* _loader_addClass_cache; // method for registering loaded classes in class loader vector 189 static ActiveMethodOopsCache* _reflect_invoke_cache; // method for security checks 190 static oop _out_of_memory_error_java_heap; // preallocated error object (no backtrace) 191 static oop _out_of_memory_error_perm_gen; // preallocated error object (no backtrace) 192 static oop _out_of_memory_error_array_size;// preallocated error object (no backtrace) 193 static oop _out_of_memory_error_gc_overhead_limit; // preallocated error object (no backtrace) 194 195 // array of preallocated error objects with backtrace 196 static objArrayOop _preallocated_out_of_memory_error_array; 197 198 // number of preallocated error objects available for use 199 static volatile jint _preallocated_out_of_memory_error_avail_count; 200 201 static oop _null_ptr_exception_instance; // preallocated exception object 202 static oop _arithmetic_exception_instance; // preallocated exception object 203 static oop _virtual_machine_error_instance; // preallocated exception object 204 // The object used as an exception dummy when exceptions are thrown for 205 // the vm thread. 206 static oop _vm_exception; 207 208 // The particular choice of collected heap. 209 static CollectedHeap* _collectedHeap; 210 211 // For UseCompressedOops. 212 static struct NarrowOopStruct _narrow_oop; 213 214 // array of dummy objects used with +FullGCAlot 368 // 1 - Use zero based compressed oops with encoding when 369 // NarrowOopHeapBaseMin + heap_size < 32Gb 370 // 2 - Use compressed oops with heap base + encoding. 371 enum NARROW_OOP_MODE { 372 UnscaledNarrowOop = 0, 373 ZeroBasedNarrowOop = 1, 374 HeapBasedNarrowOop = 2 375 }; 376 static char* preferred_heap_base(size_t heap_size, NARROW_OOP_MODE mode); 377 378 // Historic gc information 379 static size_t get_heap_capacity_at_last_gc() { return _heap_capacity_at_last_gc; } 380 static size_t get_heap_free_at_last_gc() { return _heap_capacity_at_last_gc - _heap_used_at_last_gc; } 381 static size_t get_heap_used_at_last_gc() { return _heap_used_at_last_gc; } 382 static void update_heap_info_at_gc(); 383 384 // Testers 385 static bool is_bootstrapping() { return _bootstrapping; } 386 static bool is_fully_initialized() { return _fully_initialized; } 387 388 static inline bool element_type_should_be_aligned(BasicType type); 389 static inline bool field_type_should_be_aligned(BasicType type); 390 static bool on_page_boundary(void* addr); 391 static bool should_fill_in_stack_trace(Handle throwable); 392 static void check_alignment(uintx size, uintx alignment, const char* name); 393 394 // Finalizer support. 395 static void run_finalizers_on_exit(); 396 397 // Iteration 398 399 // Apply "f" to the addresses of all the direct heap pointers maintained 400 // as static fields of "Universe". 401 static void oops_do(OopClosure* f, bool do_all = false); 402 403 // Apply "f" to all klasses for basic types (classes not present in 404 // SystemDictionary). 405 static void basic_type_classes_do(void f(klassOop)); 406 407 // Apply "f" to all system klasses (classes not present in SystemDictionary). | 175 176 static oop _main_thread_group; // Reference to the main thread group object 177 static oop _system_thread_group; // Reference to the system thread group object 178 179 static typeArrayOop _the_empty_byte_array; // Canonicalized byte array 180 static typeArrayOop _the_empty_short_array; // Canonicalized short array 181 static typeArrayOop _the_empty_int_array; // Canonicalized int array 182 static objArrayOop _the_empty_system_obj_array; // Canonicalized system obj array 183 static objArrayOop _the_empty_class_klass_array; // Canonicalized obj array of type java.lang.Class 184 static objArrayOop _the_array_interfaces_array; // Canonicalized 2-array of cloneable & serializable klasses 185 static oop _the_null_string; // A cache of "null" as a Java string 186 static oop _the_min_jint_string; // A cache of "-2147483648" as a Java string 187 static LatestMethodOopCache* _finalizer_register_cache; // static method for registering finalizable objects 188 static LatestMethodOopCache* _loader_addClass_cache; // method for registering loaded classes in class loader vector 189 static ActiveMethodOopsCache* _reflect_invoke_cache; // method for security checks 190 static oop _out_of_memory_error_java_heap; // preallocated error object (no backtrace) 191 static oop _out_of_memory_error_perm_gen; // preallocated error object (no backtrace) 192 static oop _out_of_memory_error_array_size;// preallocated error object (no backtrace) 193 static oop _out_of_memory_error_gc_overhead_limit; // preallocated error object (no backtrace) 194 195 static oop _primordial_loader_cache; // Cache a ref to the primordial app loader to avoid searching for it 196 197 // array of preallocated error objects with backtrace 198 static objArrayOop _preallocated_out_of_memory_error_array; 199 200 // number of preallocated error objects available for use 201 static volatile jint _preallocated_out_of_memory_error_avail_count; 202 203 static oop _null_ptr_exception_instance; // preallocated exception object 204 static oop _arithmetic_exception_instance; // preallocated exception object 205 static oop _virtual_machine_error_instance; // preallocated exception object 206 // The object used as an exception dummy when exceptions are thrown for 207 // the vm thread. 208 static oop _vm_exception; 209 210 // The particular choice of collected heap. 211 static CollectedHeap* _collectedHeap; 212 213 // For UseCompressedOops. 214 static struct NarrowOopStruct _narrow_oop; 215 216 // array of dummy objects used with +FullGCAlot 370 // 1 - Use zero based compressed oops with encoding when 371 // NarrowOopHeapBaseMin + heap_size < 32Gb 372 // 2 - Use compressed oops with heap base + encoding. 373 enum NARROW_OOP_MODE { 374 UnscaledNarrowOop = 0, 375 ZeroBasedNarrowOop = 1, 376 HeapBasedNarrowOop = 2 377 }; 378 static char* preferred_heap_base(size_t heap_size, NARROW_OOP_MODE mode); 379 380 // Historic gc information 381 static size_t get_heap_capacity_at_last_gc() { return _heap_capacity_at_last_gc; } 382 static size_t get_heap_free_at_last_gc() { return _heap_capacity_at_last_gc - _heap_used_at_last_gc; } 383 static size_t get_heap_used_at_last_gc() { return _heap_used_at_last_gc; } 384 static void update_heap_info_at_gc(); 385 386 // Testers 387 static bool is_bootstrapping() { return _bootstrapping; } 388 static bool is_fully_initialized() { return _fully_initialized; } 389 390 // Used by JVM_LatestUserDefinedLoader to avoid stack walking to find the loader 391 static oop get_cached_loader(); 392 static bool check_or_set_cached_loader(oop loader); 393 394 static inline bool element_type_should_be_aligned(BasicType type); 395 static inline bool field_type_should_be_aligned(BasicType type); 396 static bool on_page_boundary(void* addr); 397 static bool should_fill_in_stack_trace(Handle throwable); 398 static void check_alignment(uintx size, uintx alignment, const char* name); 399 400 // Finalizer support. 401 static void run_finalizers_on_exit(); 402 403 // Iteration 404 405 // Apply "f" to the addresses of all the direct heap pointers maintained 406 // as static fields of "Universe". 407 static void oops_do(OopClosure* f, bool do_all = false); 408 409 // Apply "f" to all klasses for basic types (classes not present in 410 // SystemDictionary). 411 static void basic_type_classes_do(void f(klassOop)); 412 413 // Apply "f" to all system klasses (classes not present in SystemDictionary). |