67 id == SharedStubId::wrong_method_abstract_id ||
68 id == SharedStubId::ic_miss_id ||
69 id == SharedStubId::resolve_opt_virtual_call_id ||
70 id == SharedStubId::resolve_virtual_call_id ||
71 id == SharedStubId::resolve_static_call_id);
72 }
73 static bool is_polling_page_id(SharedStubId id) {
74 return (id == SharedStubId::polling_page_vectors_safepoint_handler_id ||
75 id == SharedStubId::polling_page_safepoint_handler_id ||
76 id == SharedStubId::polling_page_return_handler_id);
77 }
78 static bool is_throw_id(SharedStubId id) {
79 return (id == SharedStubId::throw_AbstractMethodError_id ||
80 id == SharedStubId::throw_IncompatibleClassChangeError_id ||
81 id == SharedStubId::throw_NullPointerException_at_call_id ||
82 id == SharedStubId::throw_StackOverflowError_id ||
83 id == SharedStubId::throw_delayed_StackOverflowError_id);
84 }
85 #endif
86
87 // cont_doYieldStub is not yet folded into the general model for
88 // shared stub/blob handling. It is actually a specially generated
89 // native wrapper for a specific native method, as also is it's
90 // counterpart the continuation do_enter method.
91 static nmethod* _cont_doYield_stub;
92
93 // Stub names indexed by SharedStubId
94 static const char *_stub_names[];
95
96 #ifndef PRODUCT
97 // Counters
98 static int64_t _nof_megamorphic_calls; // total # of megamorphic calls (through vtable)
99 #endif // !PRODUCT
100
101 private:
102 static SafepointBlob* generate_handler_blob(SharedStubId id, address call_ptr);
103 static RuntimeStub* generate_resolve_blob(SharedStubId id, address destination);
104 static RuntimeStub* generate_throw_exception(SharedStubId id, address runtime_entry);
105 public:
106 static void generate_initial_stubs(void);
107 static void generate_stubs(void);
108 #if INCLUDE_JFR
109 static void generate_jfr_stubs(void);
110 // For c2: c_rarg0 is junk, call to runtime to write a checkpoint.
111 // It returns a jobject handle to the event writer.
112 // The handle is dereferenced and the return value is the event writer oop.
262 return _wrong_method_abstract_blob->entry_point();
263 }
264
265 static address get_resolve_opt_virtual_call_stub() {
266 assert(_resolve_opt_virtual_call_blob != nullptr, "oops");
267 return _resolve_opt_virtual_call_blob->entry_point();
268 }
269 static address get_resolve_virtual_call_stub() {
270 assert(_resolve_virtual_call_blob != nullptr, "oops");
271 return _resolve_virtual_call_blob->entry_point();
272 }
273 static address get_resolve_static_call_stub() {
274 assert(_resolve_static_call_blob != nullptr, "oops");
275 return _resolve_static_call_blob->entry_point();
276 }
277
278 static SafepointBlob* polling_page_return_handler_blob() { return _polling_page_return_handler_blob; }
279 static SafepointBlob* polling_page_safepoint_handler_blob() { return _polling_page_safepoint_handler_blob; }
280 static SafepointBlob* polling_page_vectors_safepoint_handler_blob() { return _polling_page_vectors_safepoint_handler_blob; }
281
282 static nmethod* cont_doYield_stub() {
283 assert(_cont_doYield_stub != nullptr, "oops");
284 return _cont_doYield_stub;
285 }
286
287 // Implicit exceptions
288 static address throw_AbstractMethodError_entry() { return _throw_AbstractMethodError_blob->entry_point(); }
289 static address throw_IncompatibleClassChangeError_entry() { return _throw_IncompatibleClassChangeError_blob->entry_point(); }
290 static address throw_NullPointerException_at_call_entry() { return _throw_NullPointerException_at_call_blob->entry_point(); }
291 static address throw_StackOverflowError_entry() { return _throw_StackOverflowError_blob->entry_point(); }
292 static address throw_delayed_StackOverflowError_entry() { return _throw_delayed_StackOverflowError_blob->entry_point(); }
293
294 #if INCLUDE_JFR
295 static address jfr_write_checkpoint() { return _jfr_write_checkpoint_blob->entry_point(); }
296 static address jfr_return_lease() { return _jfr_return_lease_blob->entry_point(); }
297 #endif
298
299 // Counters
300 #ifndef PRODUCT
301 static address nof_megamorphic_calls_addr() { return (address)&_nof_megamorphic_calls; }
302 #endif // PRODUCT
303
304 // Helper routine for full-speed JVMTI exception throwing support
305 static void throw_and_post_jvmti_exception(JavaThread* current, Handle h_exception);
306 static void throw_and_post_jvmti_exception(JavaThread* current, Symbol* name, const char *message = nullptr);
|
67 id == SharedStubId::wrong_method_abstract_id ||
68 id == SharedStubId::ic_miss_id ||
69 id == SharedStubId::resolve_opt_virtual_call_id ||
70 id == SharedStubId::resolve_virtual_call_id ||
71 id == SharedStubId::resolve_static_call_id);
72 }
73 static bool is_polling_page_id(SharedStubId id) {
74 return (id == SharedStubId::polling_page_vectors_safepoint_handler_id ||
75 id == SharedStubId::polling_page_safepoint_handler_id ||
76 id == SharedStubId::polling_page_return_handler_id);
77 }
78 static bool is_throw_id(SharedStubId id) {
79 return (id == SharedStubId::throw_AbstractMethodError_id ||
80 id == SharedStubId::throw_IncompatibleClassChangeError_id ||
81 id == SharedStubId::throw_NullPointerException_at_call_id ||
82 id == SharedStubId::throw_StackOverflowError_id ||
83 id == SharedStubId::throw_delayed_StackOverflowError_id);
84 }
85 #endif
86
87 // Stub names indexed by SharedStubId
88 static const char *_stub_names[];
89
90 #ifndef PRODUCT
91 // Counters
92 static int64_t _nof_megamorphic_calls; // total # of megamorphic calls (through vtable)
93 #endif // !PRODUCT
94
95 private:
96 static SafepointBlob* generate_handler_blob(SharedStubId id, address call_ptr);
97 static RuntimeStub* generate_resolve_blob(SharedStubId id, address destination);
98 static RuntimeStub* generate_throw_exception(SharedStubId id, address runtime_entry);
99 public:
100 static void generate_initial_stubs(void);
101 static void generate_stubs(void);
102 #if INCLUDE_JFR
103 static void generate_jfr_stubs(void);
104 // For c2: c_rarg0 is junk, call to runtime to write a checkpoint.
105 // It returns a jobject handle to the event writer.
106 // The handle is dereferenced and the return value is the event writer oop.
256 return _wrong_method_abstract_blob->entry_point();
257 }
258
259 static address get_resolve_opt_virtual_call_stub() {
260 assert(_resolve_opt_virtual_call_blob != nullptr, "oops");
261 return _resolve_opt_virtual_call_blob->entry_point();
262 }
263 static address get_resolve_virtual_call_stub() {
264 assert(_resolve_virtual_call_blob != nullptr, "oops");
265 return _resolve_virtual_call_blob->entry_point();
266 }
267 static address get_resolve_static_call_stub() {
268 assert(_resolve_static_call_blob != nullptr, "oops");
269 return _resolve_static_call_blob->entry_point();
270 }
271
272 static SafepointBlob* polling_page_return_handler_blob() { return _polling_page_return_handler_blob; }
273 static SafepointBlob* polling_page_safepoint_handler_blob() { return _polling_page_safepoint_handler_blob; }
274 static SafepointBlob* polling_page_vectors_safepoint_handler_blob() { return _polling_page_vectors_safepoint_handler_blob; }
275
276 // Implicit exceptions
277 static address throw_AbstractMethodError_entry() { return _throw_AbstractMethodError_blob->entry_point(); }
278 static address throw_IncompatibleClassChangeError_entry() { return _throw_IncompatibleClassChangeError_blob->entry_point(); }
279 static address throw_NullPointerException_at_call_entry() { return _throw_NullPointerException_at_call_blob->entry_point(); }
280 static address throw_StackOverflowError_entry() { return _throw_StackOverflowError_blob->entry_point(); }
281 static address throw_delayed_StackOverflowError_entry() { return _throw_delayed_StackOverflowError_blob->entry_point(); }
282
283 #if INCLUDE_JFR
284 static address jfr_write_checkpoint() { return _jfr_write_checkpoint_blob->entry_point(); }
285 static address jfr_return_lease() { return _jfr_return_lease_blob->entry_point(); }
286 #endif
287
288 // Counters
289 #ifndef PRODUCT
290 static address nof_megamorphic_calls_addr() { return (address)&_nof_megamorphic_calls; }
291 #endif // PRODUCT
292
293 // Helper routine for full-speed JVMTI exception throwing support
294 static void throw_and_post_jvmti_exception(JavaThread* current, Handle h_exception);
295 static void throw_and_post_jvmti_exception(JavaThread* current, Symbol* name, const char *message = nullptr);
|