78 #include "runtime/timerTrace.hpp"
79 #include "runtime/vframe.inline.hpp"
80 #include "runtime/vframeArray.hpp"
81 #include "runtime/vm_version.hpp"
82 #include "utilities/copy.hpp"
83 #include "utilities/dtrace.hpp"
84 #include "utilities/events.hpp"
85 #include "utilities/globalDefinitions.hpp"
86 #include "utilities/hashTable.hpp"
87 #include "utilities/macros.hpp"
88 #include "utilities/xmlstream.hpp"
89 #ifdef COMPILER1
90 #include "c1/c1_Runtime1.hpp"
91 #endif
92 #ifdef COMPILER2
93 #include "opto/runtime.hpp"
94 #endif
95 #if INCLUDE_JFR
96 #include "jfr/jfr.inline.hpp"
97 #endif
98
99 // Shared runtime stub routines reside in their own unique blob with a
100 // single entry point
101
102
103 #define SHARED_STUB_FIELD_DEFINE(name, type) \
104 type* SharedRuntime::BLOB_FIELD_NAME(name);
105 SHARED_STUBS_DO(SHARED_STUB_FIELD_DEFINE)
106 #undef SHARED_STUB_FIELD_DEFINE
107
108 nmethod* SharedRuntime::_cont_doYield_stub;
109
110 #if 0
111 // TODO tweak global stub name generation to match this
112 #define SHARED_STUB_NAME_DECLARE(name, type) "Shared Runtime " # name "_blob",
113 const char *SharedRuntime::_stub_names[] = {
114 SHARED_STUBS_DO(SHARED_STUB_NAME_DECLARE)
115 };
116 #endif
117
159 generate_throw_exception(StubId::shared_throw_NullPointerException_at_call_id,
160 CAST_FROM_FN_PTR(address, SharedRuntime::throw_NullPointerException_at_call));
161
162 #if COMPILER2_OR_JVMCI
163 // Vectors are generated only by C2 and JVMCI.
164 bool support_wide = is_wide_vector(MaxVectorSize);
165 if (support_wide) {
166 _polling_page_vectors_safepoint_handler_blob =
167 generate_handler_blob(StubId::shared_polling_page_vectors_safepoint_handler_id,
168 CAST_FROM_FN_PTR(address, SafepointSynchronize::handle_polling_page_exception));
169 }
170 #endif // COMPILER2_OR_JVMCI
171 _polling_page_safepoint_handler_blob =
172 generate_handler_blob(StubId::shared_polling_page_safepoint_handler_id,
173 CAST_FROM_FN_PTR(address, SafepointSynchronize::handle_polling_page_exception));
174 _polling_page_return_handler_blob =
175 generate_handler_blob(StubId::shared_polling_page_return_handler_id,
176 CAST_FROM_FN_PTR(address, SafepointSynchronize::handle_polling_page_exception));
177
178 generate_deopt_blob();
179 }
180
181 void SharedRuntime::init_adapter_library() {
182 AdapterHandlerLibrary::initialize();
183 }
184
185 #if INCLUDE_JFR
186 //------------------------------generate jfr runtime stubs ------
187 void SharedRuntime::generate_jfr_stubs() {
188 ResourceMark rm;
189 const char* timer_msg = "SharedRuntime generate_jfr_stubs";
190 TraceTime timer(timer_msg, TRACETIME_LOG(Info, startuptime));
191
192 _jfr_write_checkpoint_blob = generate_jfr_write_checkpoint();
193 _jfr_return_lease_blob = generate_jfr_return_lease();
194 }
195
196 #endif // INCLUDE_JFR
197
198 #include <math.h>
|
78 #include "runtime/timerTrace.hpp"
79 #include "runtime/vframe.inline.hpp"
80 #include "runtime/vframeArray.hpp"
81 #include "runtime/vm_version.hpp"
82 #include "utilities/copy.hpp"
83 #include "utilities/dtrace.hpp"
84 #include "utilities/events.hpp"
85 #include "utilities/globalDefinitions.hpp"
86 #include "utilities/hashTable.hpp"
87 #include "utilities/macros.hpp"
88 #include "utilities/xmlstream.hpp"
89 #ifdef COMPILER1
90 #include "c1/c1_Runtime1.hpp"
91 #endif
92 #ifdef COMPILER2
93 #include "opto/runtime.hpp"
94 #endif
95 #if INCLUDE_JFR
96 #include "jfr/jfr.inline.hpp"
97 #endif
98 #if INCLUDE_SHENANDOAHGC
99 #include "gc/shenandoah/shenandoahRuntime.hpp"
100 #endif
101
102 // Shared runtime stub routines reside in their own unique blob with a
103 // single entry point
104
105
106 #define SHARED_STUB_FIELD_DEFINE(name, type) \
107 type* SharedRuntime::BLOB_FIELD_NAME(name);
108 SHARED_STUBS_DO(SHARED_STUB_FIELD_DEFINE)
109 #undef SHARED_STUB_FIELD_DEFINE
110
111 nmethod* SharedRuntime::_cont_doYield_stub;
112
113 #if 0
114 // TODO tweak global stub name generation to match this
115 #define SHARED_STUB_NAME_DECLARE(name, type) "Shared Runtime " # name "_blob",
116 const char *SharedRuntime::_stub_names[] = {
117 SHARED_STUBS_DO(SHARED_STUB_NAME_DECLARE)
118 };
119 #endif
120
162 generate_throw_exception(StubId::shared_throw_NullPointerException_at_call_id,
163 CAST_FROM_FN_PTR(address, SharedRuntime::throw_NullPointerException_at_call));
164
165 #if COMPILER2_OR_JVMCI
166 // Vectors are generated only by C2 and JVMCI.
167 bool support_wide = is_wide_vector(MaxVectorSize);
168 if (support_wide) {
169 _polling_page_vectors_safepoint_handler_blob =
170 generate_handler_blob(StubId::shared_polling_page_vectors_safepoint_handler_id,
171 CAST_FROM_FN_PTR(address, SafepointSynchronize::handle_polling_page_exception));
172 }
173 #endif // COMPILER2_OR_JVMCI
174 _polling_page_safepoint_handler_blob =
175 generate_handler_blob(StubId::shared_polling_page_safepoint_handler_id,
176 CAST_FROM_FN_PTR(address, SafepointSynchronize::handle_polling_page_exception));
177 _polling_page_return_handler_blob =
178 generate_handler_blob(StubId::shared_polling_page_return_handler_id,
179 CAST_FROM_FN_PTR(address, SafepointSynchronize::handle_polling_page_exception));
180
181 generate_deopt_blob();
182
183 if (UseShenandoahGC) {
184 ResourceMark rm;
185 _shenandoah_keepalive_blob = generate_shenandoah_stub(StubId::shared_shenandoah_keepalive_id);
186 _shenandoah_lrb_strong_blob = generate_shenandoah_stub(StubId::shared_shenandoah_lrb_strong_id);
187 _shenandoah_lrb_weak_blob = generate_shenandoah_stub(StubId::shared_shenandoah_lrb_weak_id);
188 _shenandoah_lrb_phantom_blob = generate_shenandoah_stub(StubId::shared_shenandoah_lrb_phantom_id);
189 _shenandoah_lrb_strong_narrow_blob = generate_shenandoah_stub(StubId::shared_shenandoah_lrb_strong_narrow_id);
190 _shenandoah_lrb_weak_narrow_blob = generate_shenandoah_stub(StubId::shared_shenandoah_lrb_weak_narrow_id);
191 _shenandoah_lrb_phantom_narrow_blob = generate_shenandoah_stub(StubId::shared_shenandoah_lrb_phantom_narrow_id);
192 }
193 }
194
195 void SharedRuntime::init_adapter_library() {
196 AdapterHandlerLibrary::initialize();
197 }
198
199 #if INCLUDE_JFR
200 //------------------------------generate jfr runtime stubs ------
201 void SharedRuntime::generate_jfr_stubs() {
202 ResourceMark rm;
203 const char* timer_msg = "SharedRuntime generate_jfr_stubs";
204 TraceTime timer(timer_msg, TRACETIME_LOG(Info, startuptime));
205
206 _jfr_write_checkpoint_blob = generate_jfr_write_checkpoint();
207 _jfr_return_lease_blob = generate_jfr_return_lease();
208 }
209
210 #endif // INCLUDE_JFR
211
212 #include <math.h>
|