141
142 static oop _main_thread_group; // Reference to the main thread group object
143 static oop _system_thread_group; // Reference to the system thread group object
144
145 static objArrayOop _the_empty_class_klass_array; // Canonicalized obj array of type java.lang.Class
146 static oop _the_null_string; // A cache of "null" as a Java string
147 static oop _the_min_jint_string; // A cache of "-2147483648" as a Java string
148 static LatestMethodCache* _finalizer_register_cache; // static method for registering finalizable objects
149 static LatestMethodCache* _loader_addClass_cache; // method for registering loaded classes in class loader vector
150 static LatestMethodCache* _pd_implies_cache; // method for checking protection domain attributes
151 static LatestMethodCache* _throw_illegal_access_error_cache; // Unsafe.throwIllegalAccessError() method
152
153 // preallocated error objects (no backtrace)
154 static oop _out_of_memory_error_java_heap;
155 static oop _out_of_memory_error_metaspace;
156 static oop _out_of_memory_error_class_metaspace;
157 static oop _out_of_memory_error_array_size;
158 static oop _out_of_memory_error_gc_overhead_limit;
159 static oop _out_of_memory_error_realloc_objects;
160
161 static Array<int>* _the_empty_int_array; // Canonicalized int array
162 static Array<u2>* _the_empty_short_array; // Canonicalized short array
163 static Array<Klass*>* _the_empty_klass_array; // Canonicalized klass obj array
164 static Array<Method*>* _the_empty_method_array; // Canonicalized method obj array
165
166 static Array<Klass*>* _the_array_interfaces_array;
167
168 // array of preallocated error objects with backtrace
169 static objArrayOop _preallocated_out_of_memory_error_array;
170
171 // number of preallocated error objects available for use
172 static volatile jint _preallocated_out_of_memory_error_avail_count;
173
174 static oop _null_ptr_exception_instance; // preallocated exception object
175 static oop _arithmetic_exception_instance; // preallocated exception object
176 static oop _virtual_machine_error_instance; // preallocated exception object
177 // The object used as an exception dummy when exceptions are thrown for
178 // the vm thread.
179 static oop _vm_exception;
180
319 static oop virtual_machine_error_instance() { return _virtual_machine_error_instance; }
320 static oop vm_exception() { return _vm_exception; }
321
322 static inline oop allocation_context_notification_obj();
323 static inline void set_allocation_context_notification_obj(oop obj);
324
325 static Array<int>* the_empty_int_array() { return _the_empty_int_array; }
326 static Array<u2>* the_empty_short_array() { return _the_empty_short_array; }
327 static Array<Method*>* the_empty_method_array() { return _the_empty_method_array; }
328 static Array<Klass*>* the_empty_klass_array() { return _the_empty_klass_array; }
329
330 // OutOfMemoryError support. Returns an error with the required message. The returned error
331 // may or may not have a backtrace. If error has a backtrace then the stack trace is already
332 // filled in.
333 static oop out_of_memory_error_java_heap() { return gen_out_of_memory_error(_out_of_memory_error_java_heap); }
334 static oop out_of_memory_error_metaspace() { return gen_out_of_memory_error(_out_of_memory_error_metaspace); }
335 static oop out_of_memory_error_class_metaspace() { return gen_out_of_memory_error(_out_of_memory_error_class_metaspace); }
336 static oop out_of_memory_error_array_size() { return gen_out_of_memory_error(_out_of_memory_error_array_size); }
337 static oop out_of_memory_error_gc_overhead_limit() { return gen_out_of_memory_error(_out_of_memory_error_gc_overhead_limit); }
338 static oop out_of_memory_error_realloc_objects() { return gen_out_of_memory_error(_out_of_memory_error_realloc_objects); }
339
340 // Accessors needed for fast allocation
341 static Klass** boolArrayKlassObj_addr() { return &_boolArrayKlassObj; }
342 static Klass** byteArrayKlassObj_addr() { return &_byteArrayKlassObj; }
343 static Klass** charArrayKlassObj_addr() { return &_charArrayKlassObj; }
344 static Klass** intArrayKlassObj_addr() { return &_intArrayKlassObj; }
345 static Klass** shortArrayKlassObj_addr() { return &_shortArrayKlassObj; }
346 static Klass** longArrayKlassObj_addr() { return &_longArrayKlassObj; }
347 static Klass** singleArrayKlassObj_addr() { return &_singleArrayKlassObj; }
348 static Klass** doubleArrayKlassObj_addr() { return &_doubleArrayKlassObj; }
349 static Klass** objectArrayKlassObj_addr() { return &_objectArrayKlassObj; }
350
351 // The particular choice of collected heap.
352 static CollectedHeap* heap() { return _collectedHeap; }
353
354 // For UseCompressedOops
355 // Narrow Oop encoding mode:
356 // 0 - Use 32-bits oops without encoding when
357 // NarrowOopHeapBaseMin + heap_size < 4Gb
358 // 1 - Use zero based compressed oops with encoding when
|
141
142 static oop _main_thread_group; // Reference to the main thread group object
143 static oop _system_thread_group; // Reference to the system thread group object
144
145 static objArrayOop _the_empty_class_klass_array; // Canonicalized obj array of type java.lang.Class
146 static oop _the_null_string; // A cache of "null" as a Java string
147 static oop _the_min_jint_string; // A cache of "-2147483648" as a Java string
148 static LatestMethodCache* _finalizer_register_cache; // static method for registering finalizable objects
149 static LatestMethodCache* _loader_addClass_cache; // method for registering loaded classes in class loader vector
150 static LatestMethodCache* _pd_implies_cache; // method for checking protection domain attributes
151 static LatestMethodCache* _throw_illegal_access_error_cache; // Unsafe.throwIllegalAccessError() method
152
153 // preallocated error objects (no backtrace)
154 static oop _out_of_memory_error_java_heap;
155 static oop _out_of_memory_error_metaspace;
156 static oop _out_of_memory_error_class_metaspace;
157 static oop _out_of_memory_error_array_size;
158 static oop _out_of_memory_error_gc_overhead_limit;
159 static oop _out_of_memory_error_realloc_objects;
160
161 // preallocated cause message for delayed StackOverflowError
162 static oop _delayed_stack_overflow_error_message;
163
164 static Array<int>* _the_empty_int_array; // Canonicalized int array
165 static Array<u2>* _the_empty_short_array; // Canonicalized short array
166 static Array<Klass*>* _the_empty_klass_array; // Canonicalized klass obj array
167 static Array<Method*>* _the_empty_method_array; // Canonicalized method obj array
168
169 static Array<Klass*>* _the_array_interfaces_array;
170
171 // array of preallocated error objects with backtrace
172 static objArrayOop _preallocated_out_of_memory_error_array;
173
174 // number of preallocated error objects available for use
175 static volatile jint _preallocated_out_of_memory_error_avail_count;
176
177 static oop _null_ptr_exception_instance; // preallocated exception object
178 static oop _arithmetic_exception_instance; // preallocated exception object
179 static oop _virtual_machine_error_instance; // preallocated exception object
180 // The object used as an exception dummy when exceptions are thrown for
181 // the vm thread.
182 static oop _vm_exception;
183
322 static oop virtual_machine_error_instance() { return _virtual_machine_error_instance; }
323 static oop vm_exception() { return _vm_exception; }
324
325 static inline oop allocation_context_notification_obj();
326 static inline void set_allocation_context_notification_obj(oop obj);
327
328 static Array<int>* the_empty_int_array() { return _the_empty_int_array; }
329 static Array<u2>* the_empty_short_array() { return _the_empty_short_array; }
330 static Array<Method*>* the_empty_method_array() { return _the_empty_method_array; }
331 static Array<Klass*>* the_empty_klass_array() { return _the_empty_klass_array; }
332
333 // OutOfMemoryError support. Returns an error with the required message. The returned error
334 // may or may not have a backtrace. If error has a backtrace then the stack trace is already
335 // filled in.
336 static oop out_of_memory_error_java_heap() { return gen_out_of_memory_error(_out_of_memory_error_java_heap); }
337 static oop out_of_memory_error_metaspace() { return gen_out_of_memory_error(_out_of_memory_error_metaspace); }
338 static oop out_of_memory_error_class_metaspace() { return gen_out_of_memory_error(_out_of_memory_error_class_metaspace); }
339 static oop out_of_memory_error_array_size() { return gen_out_of_memory_error(_out_of_memory_error_array_size); }
340 static oop out_of_memory_error_gc_overhead_limit() { return gen_out_of_memory_error(_out_of_memory_error_gc_overhead_limit); }
341 static oop out_of_memory_error_realloc_objects() { return gen_out_of_memory_error(_out_of_memory_error_realloc_objects); }
342 static oop delayed_stack_overflow_error_message() { return _delayed_stack_overflow_error_message; }
343
344 // Accessors needed for fast allocation
345 static Klass** boolArrayKlassObj_addr() { return &_boolArrayKlassObj; }
346 static Klass** byteArrayKlassObj_addr() { return &_byteArrayKlassObj; }
347 static Klass** charArrayKlassObj_addr() { return &_charArrayKlassObj; }
348 static Klass** intArrayKlassObj_addr() { return &_intArrayKlassObj; }
349 static Klass** shortArrayKlassObj_addr() { return &_shortArrayKlassObj; }
350 static Klass** longArrayKlassObj_addr() { return &_longArrayKlassObj; }
351 static Klass** singleArrayKlassObj_addr() { return &_singleArrayKlassObj; }
352 static Klass** doubleArrayKlassObj_addr() { return &_doubleArrayKlassObj; }
353 static Klass** objectArrayKlassObj_addr() { return &_objectArrayKlassObj; }
354
355 // The particular choice of collected heap.
356 static CollectedHeap* heap() { return _collectedHeap; }
357
358 // For UseCompressedOops
359 // Narrow Oop encoding mode:
360 // 0 - Use 32-bits oops without encoding when
361 // NarrowOopHeapBaseMin + heap_size < 4Gb
362 // 1 - Use zero based compressed oops with encoding when
|