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