202 static const TypeFunc* _updateBytesCRC32_Type;
203 static const TypeFunc* _updateBytesCRC32C_Type;
204 static const TypeFunc* _updateBytesAdler32_Type;
205 static const TypeFunc* _osr_end_Type;
206 static const TypeFunc* _register_finalizer_Type;
207 #if INCLUDE_JFR
208 static const TypeFunc* _class_id_load_barrier_Type;
209 #endif // INCLUDE_JFR
210 #if INCLUDE_JVMTI
211 static const TypeFunc* _notify_jvmti_vthread_Type;
212 #endif // INCLUDE_JVMTI
213 static const TypeFunc* _dtrace_method_entry_exit_Type;
214 static const TypeFunc* _dtrace_object_alloc_Type;
215
216 // Stub names indexed by sharedStubId
217 static const char *_stub_names[];
218
219 // define stubs
220 static address generate_stub(ciEnv* ci_env, TypeFunc_generator gen, address C_function, const char* name, int is_fancy_jump, bool pass_tls, bool return_pc);
221
222 //
223 // Implementation of runtime methods
224 // =================================
225
226 // Allocate storage for a Java instance.
227 static void new_instance_C(Klass* instance_klass, JavaThread* current);
228
229 // Allocate storage for a objArray or typeArray
230 static void new_array_C(Klass* array_klass, int len, JavaThread* current);
231 static void new_array_nozero_C(Klass* array_klass, int len, JavaThread* current);
232
233 // Allocate storage for a multi-dimensional arrays
234 // Note: needs to be fixed for arbitrary number of dimensions
235 static void multianewarray2_C(Klass* klass, int len1, int len2, JavaThread* current);
236 static void multianewarray3_C(Klass* klass, int len1, int len2, int len3, JavaThread* current);
237 static void multianewarray4_C(Klass* klass, int len1, int len2, int len3, int len4, JavaThread* current);
238 static void multianewarray5_C(Klass* klass, int len1, int len2, int len3, int len4, int len5, JavaThread* current);
239 static void multianewarrayN_C(Klass* klass, arrayOopDesc* dims, JavaThread* current);
240
241 // local methods passed as arguments to stub generator that forward
252 private:
253
254 // Implicit exception support
255 static void throw_null_exception_C(JavaThread* thread);
256
257 // Exception handling
258 static address handle_exception_C (JavaThread* current);
259 static address handle_exception_C_helper(JavaThread* current, nmethod*& nm);
260 static address rethrow_C (oopDesc* exception, JavaThread *thread, address return_pc );
261 static void deoptimize_caller_frame (JavaThread *thread);
262 static void deoptimize_caller_frame (JavaThread *thread, bool doit);
263 static bool is_deoptimized_caller_frame (JavaThread *thread);
264
265 // CodeBlob support
266 // ===================================================================
267
268 static UncommonTrapBlob* generate_uncommon_trap_blob(void);
269 static ExceptionBlob* generate_exception_blob();
270
271 static void register_finalizer_C(oopDesc* obj, JavaThread* current);
272
273 public:
274
275 static bool is_callee_saved_register(MachRegisterNumbers reg);
276
277 // One time only generate runtime code stubs. Returns true
278 // when runtime stubs have been generated successfully and
279 // false otherwise.
280 static bool generate(ciEnv* env);
281
282 // Returns the name of a stub
283 static const char* stub_name(address entry);
284
285 // Returns the name associated with a given stub id
286 static const char* stub_name(OptoStubId id) {
287 assert(id > OptoStubId::NO_STUBID && id < OptoStubId::NUM_STUBIDS, "stub id out of range");
288 return _stub_names[(int)id];
289 }
290
291 // access to runtime stubs entry points for java code
292 static address new_instance_Java() { return _new_instance_Java; }
293 static address new_array_Java() { return _new_array_Java; }
294 static address new_array_nozero_Java() { return _new_array_nozero_Java; }
295 static address multianewarray2_Java() { return _multianewarray2_Java; }
296 static address multianewarray3_Java() { return _multianewarray3_Java; }
297 static address multianewarray4_Java() { return _multianewarray4_Java; }
298 static address multianewarray5_Java() { return _multianewarray5_Java; }
299 static address multianewarrayN_Java() { return _multianewarrayN_Java; }
300 static address complete_monitor_locking_Java() { return _complete_monitor_locking_Java; }
301 static address monitor_notify_Java() { return _monitor_notify_Java; }
302 static address monitor_notifyAll_Java() { return _monitor_notifyAll_Java; }
303
304 static address slow_arraycopy_Java() { return _slow_arraycopy_Java; }
305 static address register_finalizer_Java() { return _register_finalizer_Java; }
306 #if INCLUDE_JVMTI
307 static address notify_jvmti_vthread_start() { return _notify_jvmti_vthread_start; }
308 static address notify_jvmti_vthread_end() { return _notify_jvmti_vthread_end; }
309 static address notify_jvmti_vthread_mount() { return _notify_jvmti_vthread_mount; }
310 static address notify_jvmti_vthread_unmount() { return _notify_jvmti_vthread_unmount; }
311 #endif
312
313 static UncommonTrapBlob* uncommon_trap_blob() { return _uncommon_trap_blob; }
314 static ExceptionBlob* exception_blob() { return _exception_blob; }
315
316 // Implicit exception support
317 static void throw_div0_exception_C (JavaThread* thread);
318 static void throw_stack_overflow_error_C(JavaThread* thread);
319
320 // Exception handling
321 static address rethrow_stub() { return _rethrow_Java; }
322
323
324 // Type functions
325 // ======================================================
718
719
720 // leaf on stack replacement interpreter accessor types
721 static inline const TypeFunc* osr_end_Type() {
722 assert(_osr_end_Type != nullptr, "should be initialized");
723 return _osr_end_Type;
724 }
725
726 static inline const TypeFunc* register_finalizer_Type() {
727 assert(_register_finalizer_Type != nullptr, "should be initialized");
728 return _register_finalizer_Type;
729 }
730
731 #if INCLUDE_JFR
732 static inline const TypeFunc* class_id_load_barrier_Type() {
733 assert(_class_id_load_barrier_Type != nullptr, "should be initialized");
734 return _class_id_load_barrier_Type;
735 }
736 #endif // INCLUDE_JFR
737
738 #if INCLUDE_JVMTI
739 static inline const TypeFunc* notify_jvmti_vthread_Type() {
740 assert(_notify_jvmti_vthread_Type != nullptr, "should be initialized");
741 return _notify_jvmti_vthread_Type;
742 }
743 #endif
744
745 // Dtrace support. entry and exit probes have the same signature
746 static inline const TypeFunc* dtrace_method_entry_exit_Type() {
747 assert(_dtrace_method_entry_exit_Type != nullptr, "should be initialized");
748 return _dtrace_method_entry_exit_Type;
749 }
750
751 static inline const TypeFunc* dtrace_object_alloc_Type() {
752 assert(_dtrace_object_alloc_Type != nullptr, "should be initialized");
753 return _dtrace_object_alloc_Type;
754 }
755
756 private:
757 static NamedCounter * volatile _named_counters;
758
759 public:
760 // helper function which creates a named counter labeled with the
761 // if they are available
762 static NamedCounter* new_named_counter(JVMState* jvms, NamedCounter::CounterTag tag);
763
764 // dumps all the named counters
765 static void print_named_counters();
766
767 static void initialize_types();
768 };
769
770 #endif // SHARE_OPTO_RUNTIME_HPP
|
202 static const TypeFunc* _updateBytesCRC32_Type;
203 static const TypeFunc* _updateBytesCRC32C_Type;
204 static const TypeFunc* _updateBytesAdler32_Type;
205 static const TypeFunc* _osr_end_Type;
206 static const TypeFunc* _register_finalizer_Type;
207 #if INCLUDE_JFR
208 static const TypeFunc* _class_id_load_barrier_Type;
209 #endif // INCLUDE_JFR
210 #if INCLUDE_JVMTI
211 static const TypeFunc* _notify_jvmti_vthread_Type;
212 #endif // INCLUDE_JVMTI
213 static const TypeFunc* _dtrace_method_entry_exit_Type;
214 static const TypeFunc* _dtrace_object_alloc_Type;
215
216 // Stub names indexed by sharedStubId
217 static const char *_stub_names[];
218
219 // define stubs
220 static address generate_stub(ciEnv* ci_env, TypeFunc_generator gen, address C_function, const char* name, int is_fancy_jump, bool pass_tls, bool return_pc);
221
222 static address _vtable_must_compile_Java;
223
224 //
225 // Implementation of runtime methods
226 // =================================
227
228 // Allocate storage for a Java instance.
229 static void new_instance_C(Klass* instance_klass, JavaThread* current);
230
231 // Allocate storage for a objArray or typeArray
232 static void new_array_C(Klass* array_klass, int len, JavaThread* current);
233 static void new_array_nozero_C(Klass* array_klass, int len, JavaThread* current);
234
235 // Allocate storage for a multi-dimensional arrays
236 // Note: needs to be fixed for arbitrary number of dimensions
237 static void multianewarray2_C(Klass* klass, int len1, int len2, JavaThread* current);
238 static void multianewarray3_C(Klass* klass, int len1, int len2, int len3, JavaThread* current);
239 static void multianewarray4_C(Klass* klass, int len1, int len2, int len3, int len4, JavaThread* current);
240 static void multianewarray5_C(Klass* klass, int len1, int len2, int len3, int len4, int len5, JavaThread* current);
241 static void multianewarrayN_C(Klass* klass, arrayOopDesc* dims, JavaThread* current);
242
243 // local methods passed as arguments to stub generator that forward
254 private:
255
256 // Implicit exception support
257 static void throw_null_exception_C(JavaThread* thread);
258
259 // Exception handling
260 static address handle_exception_C (JavaThread* current);
261 static address handle_exception_C_helper(JavaThread* current, nmethod*& nm);
262 static address rethrow_C (oopDesc* exception, JavaThread *thread, address return_pc );
263 static void deoptimize_caller_frame (JavaThread *thread);
264 static void deoptimize_caller_frame (JavaThread *thread, bool doit);
265 static bool is_deoptimized_caller_frame (JavaThread *thread);
266
267 // CodeBlob support
268 // ===================================================================
269
270 static UncommonTrapBlob* generate_uncommon_trap_blob(void);
271 static ExceptionBlob* generate_exception_blob();
272
273 static void register_finalizer_C(oopDesc* obj, JavaThread* current);
274 static void class_init_barrier_C(Klass* k, JavaThread* current);
275 public:
276
277 static bool is_callee_saved_register(MachRegisterNumbers reg);
278
279 // One time only generate runtime code stubs. Returns true
280 // when runtime stubs have been generated successfully and
281 // false otherwise.
282 static bool generate(ciEnv* env);
283
284 // Returns the name of a stub
285 static const char* stub_name(address entry);
286
287 // Returns the name associated with a given stub id
288 static const char* stub_name(OptoStubId id) {
289 assert(id > OptoStubId::NO_STUBID && id < OptoStubId::NUM_STUBIDS, "stub id out of range");
290 return _stub_names[(int)id];
291 }
292
293 // access to runtime stubs entry points for java code
294 static address new_instance_Java() { return _new_instance_Java; }
295 static address new_array_Java() { return _new_array_Java; }
296 static address new_array_nozero_Java() { return _new_array_nozero_Java; }
297 static address multianewarray2_Java() { return _multianewarray2_Java; }
298 static address multianewarray3_Java() { return _multianewarray3_Java; }
299 static address multianewarray4_Java() { return _multianewarray4_Java; }
300 static address multianewarray5_Java() { return _multianewarray5_Java; }
301 static address multianewarrayN_Java() { return _multianewarrayN_Java; }
302 static address vtable_must_compile_stub() { return _vtable_must_compile_Java; }
303 static address complete_monitor_locking_Java() { return _complete_monitor_locking_Java; }
304 static address monitor_notify_Java() { return _monitor_notify_Java; }
305 static address monitor_notifyAll_Java() { return _monitor_notifyAll_Java; }
306
307 static address slow_arraycopy_Java() { return _slow_arraycopy_Java; }
308 static address register_finalizer_Java() { return _register_finalizer_Java; }
309 static address class_init_barrier_Java() { return _class_init_barrier_Java; }
310 #if INCLUDE_JVMTI
311 static address notify_jvmti_vthread_start() { return _notify_jvmti_vthread_start; }
312 static address notify_jvmti_vthread_end() { return _notify_jvmti_vthread_end; }
313 static address notify_jvmti_vthread_mount() { return _notify_jvmti_vthread_mount; }
314 static address notify_jvmti_vthread_unmount() { return _notify_jvmti_vthread_unmount; }
315 #endif
316
317 static UncommonTrapBlob* uncommon_trap_blob() { return _uncommon_trap_blob; }
318 static ExceptionBlob* exception_blob() { return _exception_blob; }
319
320 // Implicit exception support
321 static void throw_div0_exception_C (JavaThread* thread);
322 static void throw_stack_overflow_error_C(JavaThread* thread);
323
324 // Exception handling
325 static address rethrow_stub() { return _rethrow_Java; }
326
327
328 // Type functions
329 // ======================================================
722
723
724 // leaf on stack replacement interpreter accessor types
725 static inline const TypeFunc* osr_end_Type() {
726 assert(_osr_end_Type != nullptr, "should be initialized");
727 return _osr_end_Type;
728 }
729
730 static inline const TypeFunc* register_finalizer_Type() {
731 assert(_register_finalizer_Type != nullptr, "should be initialized");
732 return _register_finalizer_Type;
733 }
734
735 #if INCLUDE_JFR
736 static inline const TypeFunc* class_id_load_barrier_Type() {
737 assert(_class_id_load_barrier_Type != nullptr, "should be initialized");
738 return _class_id_load_barrier_Type;
739 }
740 #endif // INCLUDE_JFR
741
742 static const TypeFunc* class_init_barrier_Type();
743
744 #if INCLUDE_JVMTI
745 static inline const TypeFunc* notify_jvmti_vthread_Type() {
746 assert(_notify_jvmti_vthread_Type != nullptr, "should be initialized");
747 return _notify_jvmti_vthread_Type;
748 }
749 #endif
750
751 // runtime upcalls support
752 static const TypeFunc* runtime_up_call_Type();
753
754 // Dtrace support. entry and exit probes have the same signature
755 static inline const TypeFunc* dtrace_method_entry_exit_Type() {
756 assert(_dtrace_method_entry_exit_Type != nullptr, "should be initialized");
757 return _dtrace_method_entry_exit_Type;
758 }
759
760 static inline const TypeFunc* dtrace_object_alloc_Type() {
761 assert(_dtrace_object_alloc_Type != nullptr, "should be initialized");
762 return _dtrace_object_alloc_Type;
763 }
764
765 private:
766 static NamedCounter * volatile _named_counters;
767
768 public:
769 // helper function which creates a named counter labeled with the
770 // if they are available
771 static NamedCounter* new_named_counter(JVMState* jvms, NamedCounter::CounterTag tag);
772
773 // dumps all the named counters
774 static void print_named_counters();
775
776 public:
777 static void init_counters();
778 static void print_counters_on(outputStream* st);
779 static void initialize_types();
780 };
781
782 #endif // SHARE_OPTO_RUNTIME_HPP
|