186 static const TypeFunc* _poly1305_processBlocks_Type;
187 static const TypeFunc* _intpoly_montgomeryMult_P256_Type;
188 static const TypeFunc* _intpoly_assign_Type;
189 static const TypeFunc* _updateBytesCRC32_Type;
190 static const TypeFunc* _updateBytesCRC32C_Type;
191 static const TypeFunc* _updateBytesAdler32_Type;
192 static const TypeFunc* _osr_end_Type;
193 static const TypeFunc* _register_finalizer_Type;
194 #if INCLUDE_JFR
195 static const TypeFunc* _class_id_load_barrier_Type;
196 #endif // INCLUDE_JFR
197 #if INCLUDE_JVMTI
198 static const TypeFunc* _notify_jvmti_vthread_Type;
199 #endif // INCLUDE_JVMTI
200 static const TypeFunc* _dtrace_method_entry_exit_Type;
201 static const TypeFunc* _dtrace_object_alloc_Type;
202
203 // define stubs
204 static address generate_stub(ciEnv* ci_env, TypeFunc_generator gen, address C_function, const char* name, StubId stub_id, int is_fancy_jump, bool pass_tls, bool return_pc);
205
206 //
207 // Implementation of runtime methods
208 // =================================
209
210 // Allocate storage for a Java instance.
211 static void new_instance_C(Klass* instance_klass, JavaThread* current);
212
213 // Allocate storage for a objArray or typeArray
214 static void new_array_C(Klass* array_klass, int len, JavaThread* current);
215 static void new_array_nozero_C(Klass* array_klass, int len, JavaThread* current);
216
217 // Allocate storage for a multi-dimensional arrays
218 // Note: needs to be fixed for arbitrary number of dimensions
219 static void multianewarray2_C(Klass* klass, int len1, int len2, JavaThread* current);
220 static void multianewarray3_C(Klass* klass, int len1, int len2, int len3, JavaThread* current);
221 static void multianewarray4_C(Klass* klass, int len1, int len2, int len3, int len4, JavaThread* current);
222 static void multianewarray5_C(Klass* klass, int len1, int len2, int len3, int len4, int len5, JavaThread* current);
223 static void multianewarrayN_C(Klass* klass, arrayOopDesc* dims, JavaThread* current);
224
225 // local methods passed as arguments to stub generator that forward
236 private:
237
238 // Implicit exception support
239 static void throw_null_exception_C(JavaThread* thread);
240
241 // Exception handling
242 static address handle_exception_C (JavaThread* current);
243 static address handle_exception_C_helper(JavaThread* current, nmethod*& nm);
244 static address rethrow_C (oopDesc* exception, JavaThread *thread, address return_pc );
245 static void deoptimize_caller_frame (JavaThread *thread);
246 static void deoptimize_caller_frame (JavaThread *thread, bool doit);
247 static bool is_deoptimized_caller_frame (JavaThread *thread);
248
249 // CodeBlob support
250 // ===================================================================
251
252 static UncommonTrapBlob* generate_uncommon_trap_blob(void);
253 static ExceptionBlob* generate_exception_blob();
254
255 static void register_finalizer_C(oopDesc* obj, JavaThread* current);
256
257 public:
258
259 static bool is_callee_saved_register(MachRegisterNumbers reg);
260
261 // One time only generate runtime code stubs. Returns true
262 // when runtime stubs have been generated successfully and
263 // false otherwise.
264 static bool generate(ciEnv* env);
265
266 // Returns the name of a stub
267 static const char* stub_name(address entry);
268
269 // Returns the name associated with a given stub id
270 static const char* stub_name(StubId id) {
271 assert(StubInfo::is_c2(id), "not a C2 stub %s", StubInfo::name(id));
272 return StubInfo::name(id);
273 }
274
275 // access to runtime stubs entry points for java code
276 static address new_instance_Java() { return _new_instance_Java; }
277 static address new_array_Java() { return _new_array_Java; }
278 static address new_array_nozero_Java() { return _new_array_nozero_Java; }
279 static address multianewarray2_Java() { return _multianewarray2_Java; }
280 static address multianewarray3_Java() { return _multianewarray3_Java; }
281 static address multianewarray4_Java() { return _multianewarray4_Java; }
282 static address multianewarray5_Java() { return _multianewarray5_Java; }
283 static address multianewarrayN_Java() { return _multianewarrayN_Java; }
284 static address complete_monitor_locking_Java() { return _complete_monitor_locking_Java; }
285 static address monitor_notify_Java() { return _monitor_notify_Java; }
286 static address monitor_notifyAll_Java() { return _monitor_notifyAll_Java; }
287
288 static address slow_arraycopy_Java() { return _slow_arraycopy_Java; }
289 static address register_finalizer_Java() { return _register_finalizer_Java; }
290 #if INCLUDE_JVMTI
291 static address notify_jvmti_vthread_start() { return _notify_jvmti_vthread_start; }
292 static address notify_jvmti_vthread_end() { return _notify_jvmti_vthread_end; }
293 static address notify_jvmti_vthread_mount() { return _notify_jvmti_vthread_mount; }
294 static address notify_jvmti_vthread_unmount() { return _notify_jvmti_vthread_unmount; }
295 #endif
296
297 static UncommonTrapBlob* uncommon_trap_blob() { return _uncommon_trap_blob; }
298 static ExceptionBlob* exception_blob() { return _exception_blob; }
299
300 // Implicit exception support
301 static void throw_div0_exception_C (JavaThread* thread);
302 static void throw_stack_overflow_error_C(JavaThread* thread);
303
304 // Exception handling
305 static address rethrow_stub() { return _rethrow_Java; }
306
307
308 // Type functions
309 // ======================================================
702
703
704 // leaf on stack replacement interpreter accessor types
705 static inline const TypeFunc* osr_end_Type() {
706 assert(_osr_end_Type != nullptr, "should be initialized");
707 return _osr_end_Type;
708 }
709
710 static inline const TypeFunc* register_finalizer_Type() {
711 assert(_register_finalizer_Type != nullptr, "should be initialized");
712 return _register_finalizer_Type;
713 }
714
715 #if INCLUDE_JFR
716 static inline const TypeFunc* class_id_load_barrier_Type() {
717 assert(_class_id_load_barrier_Type != nullptr, "should be initialized");
718 return _class_id_load_barrier_Type;
719 }
720 #endif // INCLUDE_JFR
721
722 #if INCLUDE_JVMTI
723 static inline const TypeFunc* notify_jvmti_vthread_Type() {
724 assert(_notify_jvmti_vthread_Type != nullptr, "should be initialized");
725 return _notify_jvmti_vthread_Type;
726 }
727 #endif
728
729 // Dtrace support. entry and exit probes have the same signature
730 static inline const TypeFunc* dtrace_method_entry_exit_Type() {
731 assert(_dtrace_method_entry_exit_Type != nullptr, "should be initialized");
732 return _dtrace_method_entry_exit_Type;
733 }
734
735 static inline const TypeFunc* dtrace_object_alloc_Type() {
736 assert(_dtrace_object_alloc_Type != nullptr, "should be initialized");
737 return _dtrace_object_alloc_Type;
738 }
739
740 private:
741 static NamedCounter * volatile _named_counters;
742
743 public:
744 // helper function which creates a named counter labeled with the
745 // if they are available
746 static NamedCounter* new_named_counter(JVMState* jvms, NamedCounter::CounterTag tag);
747
748 // dumps all the named counters
749 static void print_named_counters();
750
751 static void initialize_types();
752 };
753
754 #endif // SHARE_OPTO_RUNTIME_HPP
|
186 static const TypeFunc* _poly1305_processBlocks_Type;
187 static const TypeFunc* _intpoly_montgomeryMult_P256_Type;
188 static const TypeFunc* _intpoly_assign_Type;
189 static const TypeFunc* _updateBytesCRC32_Type;
190 static const TypeFunc* _updateBytesCRC32C_Type;
191 static const TypeFunc* _updateBytesAdler32_Type;
192 static const TypeFunc* _osr_end_Type;
193 static const TypeFunc* _register_finalizer_Type;
194 #if INCLUDE_JFR
195 static const TypeFunc* _class_id_load_barrier_Type;
196 #endif // INCLUDE_JFR
197 #if INCLUDE_JVMTI
198 static const TypeFunc* _notify_jvmti_vthread_Type;
199 #endif // INCLUDE_JVMTI
200 static const TypeFunc* _dtrace_method_entry_exit_Type;
201 static const TypeFunc* _dtrace_object_alloc_Type;
202
203 // define stubs
204 static address generate_stub(ciEnv* ci_env, TypeFunc_generator gen, address C_function, const char* name, StubId stub_id, int is_fancy_jump, bool pass_tls, bool return_pc);
205
206 static address _vtable_must_compile_Java;
207
208 //
209 // Implementation of runtime methods
210 // =================================
211
212 // Allocate storage for a Java instance.
213 static void new_instance_C(Klass* instance_klass, JavaThread* current);
214
215 // Allocate storage for a objArray or typeArray
216 static void new_array_C(Klass* array_klass, int len, JavaThread* current);
217 static void new_array_nozero_C(Klass* array_klass, int len, JavaThread* current);
218
219 // Allocate storage for a multi-dimensional arrays
220 // Note: needs to be fixed for arbitrary number of dimensions
221 static void multianewarray2_C(Klass* klass, int len1, int len2, JavaThread* current);
222 static void multianewarray3_C(Klass* klass, int len1, int len2, int len3, JavaThread* current);
223 static void multianewarray4_C(Klass* klass, int len1, int len2, int len3, int len4, JavaThread* current);
224 static void multianewarray5_C(Klass* klass, int len1, int len2, int len3, int len4, int len5, JavaThread* current);
225 static void multianewarrayN_C(Klass* klass, arrayOopDesc* dims, JavaThread* current);
226
227 // local methods passed as arguments to stub generator that forward
238 private:
239
240 // Implicit exception support
241 static void throw_null_exception_C(JavaThread* thread);
242
243 // Exception handling
244 static address handle_exception_C (JavaThread* current);
245 static address handle_exception_C_helper(JavaThread* current, nmethod*& nm);
246 static address rethrow_C (oopDesc* exception, JavaThread *thread, address return_pc );
247 static void deoptimize_caller_frame (JavaThread *thread);
248 static void deoptimize_caller_frame (JavaThread *thread, bool doit);
249 static bool is_deoptimized_caller_frame (JavaThread *thread);
250
251 // CodeBlob support
252 // ===================================================================
253
254 static UncommonTrapBlob* generate_uncommon_trap_blob(void);
255 static ExceptionBlob* generate_exception_blob();
256
257 static void register_finalizer_C(oopDesc* obj, JavaThread* current);
258 static void class_init_barrier_C(Klass* k, JavaThread* current);
259 public:
260
261 static bool is_callee_saved_register(MachRegisterNumbers reg);
262
263 // One time only generate runtime code stubs. Returns true
264 // when runtime stubs have been generated successfully and
265 // false otherwise.
266 static bool generate(ciEnv* env);
267
268 // Returns the name of a stub
269 static const char* stub_name(address entry);
270
271 // Returns the name associated with a given stub id
272 static const char* stub_name(StubId id) {
273 assert(StubInfo::is_c2(id), "not a C2 stub %s", StubInfo::name(id));
274 return StubInfo::name(id);
275 }
276
277 // access to runtime stubs entry points for java code
278 static address new_instance_Java() { return _new_instance_Java; }
279 static address new_array_Java() { return _new_array_Java; }
280 static address new_array_nozero_Java() { return _new_array_nozero_Java; }
281 static address multianewarray2_Java() { return _multianewarray2_Java; }
282 static address multianewarray3_Java() { return _multianewarray3_Java; }
283 static address multianewarray4_Java() { return _multianewarray4_Java; }
284 static address multianewarray5_Java() { return _multianewarray5_Java; }
285 static address multianewarrayN_Java() { return _multianewarrayN_Java; }
286 static address vtable_must_compile_stub() { return _vtable_must_compile_Java; }
287 static address complete_monitor_locking_Java() { return _complete_monitor_locking_Java; }
288 static address monitor_notify_Java() { return _monitor_notify_Java; }
289 static address monitor_notifyAll_Java() { return _monitor_notifyAll_Java; }
290
291 static address slow_arraycopy_Java() { return _slow_arraycopy_Java; }
292 static address register_finalizer_Java() { return _register_finalizer_Java; }
293 static address class_init_barrier_Java() { return _class_init_barrier_Java; }
294 #if INCLUDE_JVMTI
295 static address notify_jvmti_vthread_start() { return _notify_jvmti_vthread_start; }
296 static address notify_jvmti_vthread_end() { return _notify_jvmti_vthread_end; }
297 static address notify_jvmti_vthread_mount() { return _notify_jvmti_vthread_mount; }
298 static address notify_jvmti_vthread_unmount() { return _notify_jvmti_vthread_unmount; }
299 #endif
300
301 static UncommonTrapBlob* uncommon_trap_blob() { return _uncommon_trap_blob; }
302 static ExceptionBlob* exception_blob() { return _exception_blob; }
303
304 // Implicit exception support
305 static void throw_div0_exception_C (JavaThread* thread);
306 static void throw_stack_overflow_error_C(JavaThread* thread);
307
308 // Exception handling
309 static address rethrow_stub() { return _rethrow_Java; }
310
311
312 // Type functions
313 // ======================================================
706
707
708 // leaf on stack replacement interpreter accessor types
709 static inline const TypeFunc* osr_end_Type() {
710 assert(_osr_end_Type != nullptr, "should be initialized");
711 return _osr_end_Type;
712 }
713
714 static inline const TypeFunc* register_finalizer_Type() {
715 assert(_register_finalizer_Type != nullptr, "should be initialized");
716 return _register_finalizer_Type;
717 }
718
719 #if INCLUDE_JFR
720 static inline const TypeFunc* class_id_load_barrier_Type() {
721 assert(_class_id_load_barrier_Type != nullptr, "should be initialized");
722 return _class_id_load_barrier_Type;
723 }
724 #endif // INCLUDE_JFR
725
726 static const TypeFunc* class_init_barrier_Type();
727
728 #if INCLUDE_JVMTI
729 static inline const TypeFunc* notify_jvmti_vthread_Type() {
730 assert(_notify_jvmti_vthread_Type != nullptr, "should be initialized");
731 return _notify_jvmti_vthread_Type;
732 }
733 #endif
734
735 // runtime upcalls support
736 static const TypeFunc* runtime_up_call_Type();
737
738 // Dtrace support. entry and exit probes have the same signature
739 static inline const TypeFunc* dtrace_method_entry_exit_Type() {
740 assert(_dtrace_method_entry_exit_Type != nullptr, "should be initialized");
741 return _dtrace_method_entry_exit_Type;
742 }
743
744 static inline const TypeFunc* dtrace_object_alloc_Type() {
745 assert(_dtrace_object_alloc_Type != nullptr, "should be initialized");
746 return _dtrace_object_alloc_Type;
747 }
748
749 private:
750 static NamedCounter * volatile _named_counters;
751
752 public:
753 // helper function which creates a named counter labeled with the
754 // if they are available
755 static NamedCounter* new_named_counter(JVMState* jvms, NamedCounter::CounterTag tag);
756
757 // dumps all the named counters
758 static void print_named_counters();
759
760 public:
761 static void init_counters();
762 static void print_counters_on(outputStream* st);
763 static void initialize_types();
764 };
765
766 #endif // SHARE_OPTO_RUNTIME_HPP
|