185
186 // declare global stub id enum
187
188 #define STUB_ENUM_DECLARE(blob_name, stub_name) \
189 STUB_ID_NAME(stub_name) ,
190
191 enum StubGenStubId : int {
192 NO_STUBID = -1,
193 STUBGEN_STUBS_DO(STUB_ENUM_DECLARE)
194 NUM_STUBIDS
195 };
196
197 #undef STUB_ENUM_DECLARE
198
199 class StubRoutines: AllStatic {
200
201 public:
202 // Dependencies
203 friend class StubGenerator;
204 friend class VMStructs;
205 #if INCLUDE_JVMCI
206 friend class JVMCIVMStructs;
207 #endif
208
209 #include CPU_HEADER(stubRoutines)
210
211 // declare blob and stub name storage and associated lookup methods
212
213 private:
214 static bool _inited_names;
215 static const char* _blob_names[StubGenBlobId::NUM_BLOBIDS];
216 static const char* _stub_names[StubGenStubId::NUM_STUBIDS];
217
218 public:
219 static bool init_names();
220 static const char* get_blob_name(StubGenBlobId id);
221 static const char* get_stub_name(StubGenStubId id);
222
223 // declare blob fields
224
322 // define getters for stub code blobs
323
324 #define DEFINE_BLOB_GETTER(blob_name) \
325 static RuntimeBlob* blob_name ## _stubs_code() { return _ ## blob_name ## _stubs_code; }
326
327 STUBGEN_BLOBS_DO(DEFINE_BLOB_GETTER);
328
329 #undef DEFINE_BLOB_GETTER
330
331 #ifdef ASSERT
332 // provide a translation from stub id to its associated blob id
333 static StubGenBlobId stub_to_blob(StubGenStubId stubId);
334 #endif
335
336 // Debugging
337 static jint verify_oop_count() { return _verify_oop_count; }
338 static jint* verify_oop_count_addr() { return &_verify_oop_count; }
339 // a subroutine for debugging the GC
340 static address verify_oop_subroutine_entry_address() { return (address)&_verify_oop_subroutine_entry; }
341
342 static CallStub call_stub() { return CAST_TO_FN_PTR(CallStub, _call_stub_entry); }
343
344 static address select_arraycopy_function(BasicType t, bool aligned, bool disjoint, const char* &name, bool dest_uninitialized);
345
346 static address oop_arraycopy(bool dest_uninitialized = false) {
347 return dest_uninitialized ? _oop_arraycopy_uninit : _oop_arraycopy;
348 }
349
350 static address oop_disjoint_arraycopy(bool dest_uninitialized = false) {
351 return dest_uninitialized ? _oop_disjoint_arraycopy_uninit : _oop_disjoint_arraycopy;
352 }
353
354 static address arrayof_oop_arraycopy(bool dest_uninitialized = false) {
355 return dest_uninitialized ? _arrayof_oop_arraycopy_uninit : _arrayof_oop_arraycopy;
356 }
357
358 static address arrayof_oop_disjoint_arraycopy(bool dest_uninitialized = false) {
359 return dest_uninitialized ? _arrayof_oop_disjoint_arraycopy_uninit : _arrayof_oop_disjoint_arraycopy;
360 }
361
362 typedef void (*DataCacheWritebackStub)(void *);
|
185
186 // declare global stub id enum
187
188 #define STUB_ENUM_DECLARE(blob_name, stub_name) \
189 STUB_ID_NAME(stub_name) ,
190
191 enum StubGenStubId : int {
192 NO_STUBID = -1,
193 STUBGEN_STUBS_DO(STUB_ENUM_DECLARE)
194 NUM_STUBIDS
195 };
196
197 #undef STUB_ENUM_DECLARE
198
199 class StubRoutines: AllStatic {
200
201 public:
202 // Dependencies
203 friend class StubGenerator;
204 friend class VMStructs;
205 friend class AOTCodeAddressTable;
206 #if INCLUDE_JVMCI
207 friend class JVMCIVMStructs;
208 #endif
209
210 #include CPU_HEADER(stubRoutines)
211
212 // declare blob and stub name storage and associated lookup methods
213
214 private:
215 static bool _inited_names;
216 static const char* _blob_names[StubGenBlobId::NUM_BLOBIDS];
217 static const char* _stub_names[StubGenStubId::NUM_STUBIDS];
218
219 public:
220 static bool init_names();
221 static const char* get_blob_name(StubGenBlobId id);
222 static const char* get_stub_name(StubGenStubId id);
223
224 // declare blob fields
225
323 // define getters for stub code blobs
324
325 #define DEFINE_BLOB_GETTER(blob_name) \
326 static RuntimeBlob* blob_name ## _stubs_code() { return _ ## blob_name ## _stubs_code; }
327
328 STUBGEN_BLOBS_DO(DEFINE_BLOB_GETTER);
329
330 #undef DEFINE_BLOB_GETTER
331
332 #ifdef ASSERT
333 // provide a translation from stub id to its associated blob id
334 static StubGenBlobId stub_to_blob(StubGenStubId stubId);
335 #endif
336
337 // Debugging
338 static jint verify_oop_count() { return _verify_oop_count; }
339 static jint* verify_oop_count_addr() { return &_verify_oop_count; }
340 // a subroutine for debugging the GC
341 static address verify_oop_subroutine_entry_address() { return (address)&_verify_oop_subroutine_entry; }
342
343 static CallStub call_stub() { assert(_call_stub_entry != nullptr, ""); return CAST_TO_FN_PTR(CallStub, _call_stub_entry); }
344
345 static address select_arraycopy_function(BasicType t, bool aligned, bool disjoint, const char* &name, bool dest_uninitialized);
346
347 static address oop_arraycopy(bool dest_uninitialized = false) {
348 return dest_uninitialized ? _oop_arraycopy_uninit : _oop_arraycopy;
349 }
350
351 static address oop_disjoint_arraycopy(bool dest_uninitialized = false) {
352 return dest_uninitialized ? _oop_disjoint_arraycopy_uninit : _oop_disjoint_arraycopy;
353 }
354
355 static address arrayof_oop_arraycopy(bool dest_uninitialized = false) {
356 return dest_uninitialized ? _arrayof_oop_arraycopy_uninit : _arrayof_oop_arraycopy;
357 }
358
359 static address arrayof_oop_disjoint_arraycopy(bool dest_uninitialized = false) {
360 return dest_uninitialized ? _arrayof_oop_disjoint_arraycopy_uninit : _arrayof_oop_disjoint_arraycopy;
361 }
362
363 typedef void (*DataCacheWritebackStub)(void *);
|