187 static const TypeFunc* _base64_decodeBlock_Type;
188 static const TypeFunc* _string_IndexOf_Type;
189 static const TypeFunc* _poly1305_processBlocks_Type;
190 static const TypeFunc* _intpoly_montgomeryMult_P256_Type;
191 static const TypeFunc* _intpoly_assign_Type;
192 static const TypeFunc* _updateBytesCRC32_Type;
193 static const TypeFunc* _updateBytesCRC32C_Type;
194 static const TypeFunc* _updateBytesAdler32_Type;
195 static const TypeFunc* _osr_end_Type;
196 static const TypeFunc* _register_finalizer_Type;
197 static const TypeFunc* _vthread_transition_Type;
198 #if INCLUDE_JFR
199 static const TypeFunc* _class_id_load_barrier_Type;
200 #endif // INCLUDE_JFR
201 static const TypeFunc* _dtrace_method_entry_exit_Type;
202 static const TypeFunc* _dtrace_object_alloc_Type;
203
204 // define stubs
205 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);
206
207 //
208 // Implementation of runtime methods
209 // =================================
210
211 // Allocate storage for a Java instance.
212 static void new_instance_C(Klass* instance_klass, JavaThread* current);
213
214 // Allocate storage for a objArray or typeArray
215 static void new_array_C(Klass* array_klass, int len, JavaThread* current);
216 static void new_array_nozero_C(Klass* array_klass, int len, JavaThread* current);
217
218 // Allocate storage for a multi-dimensional arrays
219 // Note: needs to be fixed for arbitrary number of dimensions
220 static void multianewarray2_C(Klass* klass, int len1, int len2, JavaThread* current);
221 static void multianewarray3_C(Klass* klass, int len1, int len2, int len3, JavaThread* current);
222 static void multianewarray4_C(Klass* klass, int len1, int len2, int len3, int len4, JavaThread* current);
223 static void multianewarray5_C(Klass* klass, int len1, int len2, int len3, int len4, int len5, JavaThread* current);
224 static void multianewarrayN_C(Klass* klass, arrayOopDesc* dims, JavaThread* current);
225
226 // local methods passed as arguments to stub generator that forward
242 private:
243
244 // Implicit exception support
245 static void throw_null_exception_C(JavaThread* thread);
246
247 // Exception handling
248 static address handle_exception_C (JavaThread* current);
249 static address handle_exception_C_helper(JavaThread* current, nmethod*& nm);
250 static address rethrow_C (oopDesc* exception, JavaThread *thread, address return_pc );
251 static void deoptimize_caller_frame (JavaThread *thread);
252 static void deoptimize_caller_frame (JavaThread *thread, bool doit);
253 static bool is_deoptimized_caller_frame (JavaThread *thread);
254
255 // CodeBlob support
256 // ===================================================================
257
258 static UncommonTrapBlob* generate_uncommon_trap_blob(void);
259 static ExceptionBlob* generate_exception_blob();
260
261 static void register_finalizer_C(oopDesc* obj, JavaThread* current);
262
263 public:
264
265 static bool is_callee_saved_register(MachRegisterNumbers reg);
266
267 // One time only generate runtime code stubs. Returns true
268 // when runtime stubs have been generated successfully and
269 // false otherwise.
270 static bool generate(ciEnv* env);
271
272 // Returns the name of a stub
273 static const char* stub_name(address entry);
274
275 // Returns the name associated with a given stub id
276 static const char* stub_name(StubId id) {
277 assert(StubInfo::is_c2(id), "not a C2 stub %s", StubInfo::name(id));
278 return StubInfo::name(id);
279 }
280
281 // access to runtime stubs entry points for java code
282 static address new_instance_Java() { return _new_instance_Java; }
283 static address new_array_Java() { return _new_array_Java; }
284 static address new_array_nozero_Java() { return _new_array_nozero_Java; }
285 static address multianewarray2_Java() { return _multianewarray2_Java; }
286 static address multianewarray3_Java() { return _multianewarray3_Java; }
287 static address multianewarray4_Java() { return _multianewarray4_Java; }
288 static address multianewarray5_Java() { return _multianewarray5_Java; }
289 static address multianewarrayN_Java() { return _multianewarrayN_Java; }
290 static address complete_monitor_locking_Java() { return _complete_monitor_locking_Java; }
291 static address monitor_notify_Java() { return _monitor_notify_Java; }
292 static address monitor_notifyAll_Java() { return _monitor_notifyAll_Java; }
293
294 static address slow_arraycopy_Java() { return _slow_arraycopy_Java; }
295 static address register_finalizer_Java() { return _register_finalizer_Java; }
296
297 static address vthread_end_first_transition_Java() { return _vthread_end_first_transition_Java; }
298 static address vthread_start_final_transition_Java() { return _vthread_start_final_transition_Java; }
299 static address vthread_start_transition_Java() { return _vthread_start_transition_Java; }
300 static address vthread_end_transition_Java() { return _vthread_end_transition_Java; }
301
302 static UncommonTrapBlob* uncommon_trap_blob() { return _uncommon_trap_blob; }
303 static ExceptionBlob* exception_blob() { return _exception_blob; }
304
305 // Implicit exception support
306 static void throw_div0_exception_C (JavaThread* thread);
307 static void throw_stack_overflow_error_C(JavaThread* thread);
308
309 // Exception handling
310 static address rethrow_stub() { return _rethrow_Java; }
311
312
313 // Type functions
314 // ======================================================
315
728
729 static inline const TypeFunc* vthread_start_final_transition_Type() {
730 return vthread_transition_Type();
731 }
732
733 static inline const TypeFunc* vthread_start_transition_Type() {
734 return vthread_transition_Type();
735 }
736
737 static inline const TypeFunc* vthread_end_transition_Type() {
738 return vthread_transition_Type();
739 }
740
741 #if INCLUDE_JFR
742 static inline const TypeFunc* class_id_load_barrier_Type() {
743 assert(_class_id_load_barrier_Type != nullptr, "should be initialized");
744 return _class_id_load_barrier_Type;
745 }
746 #endif // INCLUDE_JFR
747
748 // Dtrace support. entry and exit probes have the same signature
749 static inline const TypeFunc* dtrace_method_entry_exit_Type() {
750 assert(_dtrace_method_entry_exit_Type != nullptr, "should be initialized");
751 return _dtrace_method_entry_exit_Type;
752 }
753
754 static inline const TypeFunc* dtrace_object_alloc_Type() {
755 assert(_dtrace_object_alloc_Type != nullptr, "should be initialized");
756 return _dtrace_object_alloc_Type;
757 }
758
759 #ifndef PRODUCT
760 // Signature for runtime calls in debug printing nodes, which depends on which nodes are actually passed
761 // Note: we do not allow more than 7 node arguments as GraphKit::make_runtime_call only allows 8, and we need
762 // one for the static string
763 static const TypeFunc* debug_print_Type(Node* parm0 = nullptr, Node* parm1 = nullptr,
764 Node* parm2 = nullptr, Node* parm3 = nullptr,
765 Node* parm4 = nullptr, Node* parm5 = nullptr,
766 Node* parm6 = nullptr);
767 #endif // PRODUCT
768
769 private:
770 static NamedCounter * volatile _named_counters;
771
772 public:
773 // helper function which creates a named counter labeled with the
774 // if they are available
775 static NamedCounter* new_named_counter(JVMState* jvms, NamedCounter::CounterTag tag);
776
777 // dumps all the named counters
778 static void print_named_counters();
779
780 static void initialize_types();
781 };
782
783 #endif // SHARE_OPTO_RUNTIME_HPP
|
187 static const TypeFunc* _base64_decodeBlock_Type;
188 static const TypeFunc* _string_IndexOf_Type;
189 static const TypeFunc* _poly1305_processBlocks_Type;
190 static const TypeFunc* _intpoly_montgomeryMult_P256_Type;
191 static const TypeFunc* _intpoly_assign_Type;
192 static const TypeFunc* _updateBytesCRC32_Type;
193 static const TypeFunc* _updateBytesCRC32C_Type;
194 static const TypeFunc* _updateBytesAdler32_Type;
195 static const TypeFunc* _osr_end_Type;
196 static const TypeFunc* _register_finalizer_Type;
197 static const TypeFunc* _vthread_transition_Type;
198 #if INCLUDE_JFR
199 static const TypeFunc* _class_id_load_barrier_Type;
200 #endif // INCLUDE_JFR
201 static const TypeFunc* _dtrace_method_entry_exit_Type;
202 static const TypeFunc* _dtrace_object_alloc_Type;
203
204 // define stubs
205 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);
206
207 static address _vtable_must_compile_Java;
208
209 //
210 // Implementation of runtime methods
211 // =================================
212
213 // Allocate storage for a Java instance.
214 static void new_instance_C(Klass* instance_klass, JavaThread* current);
215
216 // Allocate storage for a objArray or typeArray
217 static void new_array_C(Klass* array_klass, int len, JavaThread* current);
218 static void new_array_nozero_C(Klass* array_klass, int len, JavaThread* current);
219
220 // Allocate storage for a multi-dimensional arrays
221 // Note: needs to be fixed for arbitrary number of dimensions
222 static void multianewarray2_C(Klass* klass, int len1, int len2, JavaThread* current);
223 static void multianewarray3_C(Klass* klass, int len1, int len2, int len3, JavaThread* current);
224 static void multianewarray4_C(Klass* klass, int len1, int len2, int len3, int len4, JavaThread* current);
225 static void multianewarray5_C(Klass* klass, int len1, int len2, int len3, int len4, int len5, JavaThread* current);
226 static void multianewarrayN_C(Klass* klass, arrayOopDesc* dims, JavaThread* current);
227
228 // local methods passed as arguments to stub generator that forward
244 private:
245
246 // Implicit exception support
247 static void throw_null_exception_C(JavaThread* thread);
248
249 // Exception handling
250 static address handle_exception_C (JavaThread* current);
251 static address handle_exception_C_helper(JavaThread* current, nmethod*& nm);
252 static address rethrow_C (oopDesc* exception, JavaThread *thread, address return_pc );
253 static void deoptimize_caller_frame (JavaThread *thread);
254 static void deoptimize_caller_frame (JavaThread *thread, bool doit);
255 static bool is_deoptimized_caller_frame (JavaThread *thread);
256
257 // CodeBlob support
258 // ===================================================================
259
260 static UncommonTrapBlob* generate_uncommon_trap_blob(void);
261 static ExceptionBlob* generate_exception_blob();
262
263 static void register_finalizer_C(oopDesc* obj, JavaThread* current);
264 static void class_init_barrier_C(Klass* k, JavaThread* current);
265 public:
266
267 static bool is_callee_saved_register(MachRegisterNumbers reg);
268
269 // One time only generate runtime code stubs. Returns true
270 // when runtime stubs have been generated successfully and
271 // false otherwise.
272 static bool generate(ciEnv* env);
273
274 // Returns the name of a stub
275 static const char* stub_name(address entry);
276
277 // Returns the name associated with a given stub id
278 static const char* stub_name(StubId id) {
279 assert(StubInfo::is_c2(id), "not a C2 stub %s", StubInfo::name(id));
280 return StubInfo::name(id);
281 }
282
283 // access to runtime stubs entry points for java code
284 static address new_instance_Java() { return _new_instance_Java; }
285 static address new_array_Java() { return _new_array_Java; }
286 static address new_array_nozero_Java() { return _new_array_nozero_Java; }
287 static address multianewarray2_Java() { return _multianewarray2_Java; }
288 static address multianewarray3_Java() { return _multianewarray3_Java; }
289 static address multianewarray4_Java() { return _multianewarray4_Java; }
290 static address multianewarray5_Java() { return _multianewarray5_Java; }
291 static address multianewarrayN_Java() { return _multianewarrayN_Java; }
292 static address vtable_must_compile_stub() { return _vtable_must_compile_Java; }
293 static address complete_monitor_locking_Java() { return _complete_monitor_locking_Java; }
294 static address monitor_notify_Java() { return _monitor_notify_Java; }
295 static address monitor_notifyAll_Java() { return _monitor_notifyAll_Java; }
296
297 static address slow_arraycopy_Java() { return _slow_arraycopy_Java; }
298 static address register_finalizer_Java() { return _register_finalizer_Java; }
299 static address class_init_barrier_Java() { return _class_init_barrier_Java; }
300
301 static address vthread_end_first_transition_Java() { return _vthread_end_first_transition_Java; }
302 static address vthread_start_final_transition_Java() { return _vthread_start_final_transition_Java; }
303 static address vthread_start_transition_Java() { return _vthread_start_transition_Java; }
304 static address vthread_end_transition_Java() { return _vthread_end_transition_Java; }
305
306 static UncommonTrapBlob* uncommon_trap_blob() { return _uncommon_trap_blob; }
307 static ExceptionBlob* exception_blob() { return _exception_blob; }
308
309 // Implicit exception support
310 static void throw_div0_exception_C (JavaThread* thread);
311 static void throw_stack_overflow_error_C(JavaThread* thread);
312
313 // Exception handling
314 static address rethrow_stub() { return _rethrow_Java; }
315
316
317 // Type functions
318 // ======================================================
319
732
733 static inline const TypeFunc* vthread_start_final_transition_Type() {
734 return vthread_transition_Type();
735 }
736
737 static inline const TypeFunc* vthread_start_transition_Type() {
738 return vthread_transition_Type();
739 }
740
741 static inline const TypeFunc* vthread_end_transition_Type() {
742 return vthread_transition_Type();
743 }
744
745 #if INCLUDE_JFR
746 static inline const TypeFunc* class_id_load_barrier_Type() {
747 assert(_class_id_load_barrier_Type != nullptr, "should be initialized");
748 return _class_id_load_barrier_Type;
749 }
750 #endif // INCLUDE_JFR
751
752 static const TypeFunc* class_init_barrier_Type();
753
754 // runtime upcalls support
755 static const TypeFunc* runtime_up_call_Type();
756
757 // Dtrace support. entry and exit probes have the same signature
758 static inline const TypeFunc* dtrace_method_entry_exit_Type() {
759 assert(_dtrace_method_entry_exit_Type != nullptr, "should be initialized");
760 return _dtrace_method_entry_exit_Type;
761 }
762
763 static inline const TypeFunc* dtrace_object_alloc_Type() {
764 assert(_dtrace_object_alloc_Type != nullptr, "should be initialized");
765 return _dtrace_object_alloc_Type;
766 }
767
768 #ifndef PRODUCT
769 // Signature for runtime calls in debug printing nodes, which depends on which nodes are actually passed
770 // Note: we do not allow more than 7 node arguments as GraphKit::make_runtime_call only allows 8, and we need
771 // one for the static string
772 static const TypeFunc* debug_print_Type(Node* parm0 = nullptr, Node* parm1 = nullptr,
773 Node* parm2 = nullptr, Node* parm3 = nullptr,
774 Node* parm4 = nullptr, Node* parm5 = nullptr,
775 Node* parm6 = nullptr);
776 #endif // PRODUCT
777
778 private:
779 static NamedCounter * volatile _named_counters;
780
781 public:
782 // helper function which creates a named counter labeled with the
783 // if they are available
784 static NamedCounter* new_named_counter(JVMState* jvms, NamedCounter::CounterTag tag);
785
786 // dumps all the named counters
787 static void print_named_counters();
788
789 public:
790 static void init_counters();
791 static void print_counters_on(outputStream* st);
792 static void initialize_types();
793 };
794
795 #endif // SHARE_OPTO_RUNTIME_HPP
|