< prev index next >

src/hotspot/share/runtime/stubRoutines.hpp

Print this page

136   static address _call_stub_entry;
137   static address _forward_exception_entry;
138   static address _catch_exception_entry;
139   static address _throw_AbstractMethodError_entry;
140   static address _throw_IncompatibleClassChangeError_entry;
141   static address _throw_NullPointerException_at_call_entry;
142   static address _throw_StackOverflowError_entry;
143   static address _throw_delayed_StackOverflowError_entry;
144 
145   static address _atomic_xchg_entry;
146   static address _atomic_xchg_long_entry;
147   static address _atomic_store_entry;
148   static address _atomic_cmpxchg_entry;
149   static address _atomic_cmpxchg_byte_entry;
150   static address _atomic_cmpxchg_long_entry;
151   static address _atomic_add_entry;
152   static address _atomic_add_long_entry;
153   static address _fence_entry;
154 
155   static BufferBlob* _code1;                               // code buffer for initial routines
156   static BufferBlob* _code2;                               // code buffer for all other routines

157 
158   // Leaf routines which implement arraycopy and their addresses
159   // arraycopy operands aligned on element type boundary
160   static address _jbyte_arraycopy;
161   static address _jshort_arraycopy;
162   static address _jint_arraycopy;
163   static address _jlong_arraycopy;
164   static address _oop_arraycopy, _oop_arraycopy_uninit;
165   static address _jbyte_disjoint_arraycopy;
166   static address _jshort_disjoint_arraycopy;
167   static address _jint_disjoint_arraycopy;
168   static address _jlong_disjoint_arraycopy;
169   static address _oop_disjoint_arraycopy, _oop_disjoint_arraycopy_uninit;
170 






171   // arraycopy operands aligned on zero'th element boundary
172   // These are identical to the ones aligned aligned on an
173   // element type boundary, except that they assume that both
174   // source and destination are HeapWord aligned.
175   static address _arrayof_jbyte_arraycopy;
176   static address _arrayof_jshort_arraycopy;
177   static address _arrayof_jint_arraycopy;
178   static address _arrayof_jlong_arraycopy;
179   static address _arrayof_oop_arraycopy, _arrayof_oop_arraycopy_uninit;
180   static address _arrayof_jbyte_disjoint_arraycopy;
181   static address _arrayof_jshort_disjoint_arraycopy;
182   static address _arrayof_jint_disjoint_arraycopy;
183   static address _arrayof_jlong_disjoint_arraycopy;
184   static address _arrayof_oop_disjoint_arraycopy, _arrayof_oop_disjoint_arraycopy_uninit;
185 
186   // cache line writeback
187   static address _data_cache_writeback;
188   static address _data_cache_writeback_sync;
189 
190   // these are recommended but optional:

233   static address _squareToLen;
234   static address _mulAdd;
235   static address _montgomeryMultiply;
236   static address _montgomerySquare;
237   static address _bigIntegerRightShiftWorker;
238   static address _bigIntegerLeftShiftWorker;
239 
240   static address _vectorizedMismatch;
241 
242   static address _dexp;
243   static address _dlog;
244   static address _dlog10;
245   static address _dpow;
246   static address _dsin;
247   static address _dcos;
248   static address _dlibm_sin_cos_huge;
249   static address _dlibm_reduce_pi04l;
250   static address _dlibm_tan_cot_huge;
251   static address _dtan;
252 











253   // Safefetch stubs.
254   static address _safefetch32_entry;
255   static address _safefetch32_fault_pc;
256   static address _safefetch32_continuation_pc;
257   static address _safefetchN_entry;
258   static address _safefetchN_fault_pc;
259   static address _safefetchN_continuation_pc;
260 
261   // Vector Math Routines
262   static address _vector_f_math[VectorSupport::NUM_VEC_SIZES][VectorSupport::NUM_SVML_OP];
263   static address _vector_d_math[VectorSupport::NUM_VEC_SIZES][VectorSupport::NUM_SVML_OP];
264 
265  public:
266   // Initialization/Testing
267   static void    initialize1();                            // must happen before universe::genesis
268   static void    initialize2();                            // must happen after  universe::genesis

269 
270   static bool is_stub_code(address addr)                   { return contains(addr); }
271 
272   static bool contains(address addr) {
273     return
274       (_code1 != NULL && _code1->blob_contains(addr)) ||
275       (_code2 != NULL && _code2->blob_contains(addr)) ;
276   }
277 
278   static RuntimeBlob* code1() { return _code1; }
279   static RuntimeBlob* code2() { return _code2; }

280 
281   // Debugging
282   static jint    verify_oop_count()                        { return _verify_oop_count; }
283   static jint*   verify_oop_count_addr()                   { return &_verify_oop_count; }
284   // a subroutine for debugging the GC
285   static address verify_oop_subroutine_entry_address()     { return (address)&_verify_oop_subroutine_entry; }
286 
287   static address catch_exception_entry()                   { return _catch_exception_entry; }
288 
289   // Calls to Java
290   typedef void (*CallStub)(
291     address   link,
292     intptr_t* result,
293     BasicType result_type,
294     Method* method,
295     address   entry_point,
296     intptr_t* parameters,
297     int       size_of_parameters,
298     TRAPS
299   );

308   static address throw_NullPointerException_at_call_entry(){ return _throw_NullPointerException_at_call_entry; }
309   static address throw_StackOverflowError_entry()          { return _throw_StackOverflowError_entry; }
310   static address throw_delayed_StackOverflowError_entry()  { return _throw_delayed_StackOverflowError_entry; }
311 
312   static address atomic_xchg_entry()                       { return _atomic_xchg_entry; }
313   static address atomic_xchg_long_entry()                  { return _atomic_xchg_long_entry; }
314   static address atomic_store_entry()                      { return _atomic_store_entry; }
315   static address atomic_cmpxchg_entry()                    { return _atomic_cmpxchg_entry; }
316   static address atomic_cmpxchg_byte_entry()               { return _atomic_cmpxchg_byte_entry; }
317   static address atomic_cmpxchg_long_entry()               { return _atomic_cmpxchg_long_entry; }
318   static address atomic_add_entry()                        { return _atomic_add_entry; }
319   static address atomic_add_long_entry()                   { return _atomic_add_long_entry; }
320   static address fence_entry()                             { return _fence_entry; }
321 
322   static address select_arraycopy_function(BasicType t, bool aligned, bool disjoint, const char* &name, bool dest_uninitialized);
323 
324   static address jbyte_arraycopy()  { return _jbyte_arraycopy; }
325   static address jshort_arraycopy() { return _jshort_arraycopy; }
326   static address jint_arraycopy()   { return _jint_arraycopy; }
327   static address jlong_arraycopy()  { return _jlong_arraycopy; }







328   static address oop_arraycopy(bool dest_uninitialized = false) {
329     return dest_uninitialized ? _oop_arraycopy_uninit : _oop_arraycopy;
330   }
331   static address jbyte_disjoint_arraycopy()  { return _jbyte_disjoint_arraycopy; }
332   static address jshort_disjoint_arraycopy() { return _jshort_disjoint_arraycopy; }
333   static address jint_disjoint_arraycopy()   { return _jint_disjoint_arraycopy; }
334   static address jlong_disjoint_arraycopy()  { return _jlong_disjoint_arraycopy; }
335   static address oop_disjoint_arraycopy(bool dest_uninitialized = false) {
336     return dest_uninitialized ?  _oop_disjoint_arraycopy_uninit : _oop_disjoint_arraycopy;
337   }
338 
339   static address arrayof_jbyte_arraycopy()  { return _arrayof_jbyte_arraycopy; }
340   static address arrayof_jshort_arraycopy() { return _arrayof_jshort_arraycopy; }
341   static address arrayof_jint_arraycopy()   { return _arrayof_jint_arraycopy; }
342   static address arrayof_jlong_arraycopy()  { return _arrayof_jlong_arraycopy; }
343   static address arrayof_oop_arraycopy(bool dest_uninitialized = false) {
344     return dest_uninitialized ? _arrayof_oop_arraycopy_uninit : _arrayof_oop_arraycopy;
345   }
346 
347   static address arrayof_jbyte_disjoint_arraycopy()  { return _arrayof_jbyte_disjoint_arraycopy; }

409   static address mulAdd()              { return _mulAdd; }
410   static address montgomeryMultiply()  { return _montgomeryMultiply; }
411   static address montgomerySquare()    { return _montgomerySquare; }
412   static address bigIntegerRightShift() { return _bigIntegerRightShiftWorker; }
413   static address bigIntegerLeftShift()  { return _bigIntegerLeftShiftWorker; }
414   static address galoisCounterMode_AESCrypt()   { return _galoisCounterMode_AESCrypt; }
415 
416   static address vectorizedMismatch()  { return _vectorizedMismatch; }
417 
418   static address dexp()                { return _dexp; }
419   static address dlog()                { return _dlog; }
420   static address dlog10()              { return _dlog10; }
421   static address dpow()                { return _dpow; }
422   static address dsin()                { return _dsin; }
423   static address dcos()                { return _dcos; }
424   static address dlibm_reduce_pi04l()  { return _dlibm_reduce_pi04l; }
425   static address dlibm_sin_cos_huge()  { return _dlibm_sin_cos_huge; }
426   static address dlibm_tan_cot_huge()  { return _dlibm_tan_cot_huge; }
427   static address dtan()                { return _dtan; }
428 












429   static address select_fill_function(BasicType t, bool aligned, const char* &name);
430 
431   //
432   // Safefetch stub support
433   //
434 
435   typedef int      (*SafeFetch32Stub)(int*      adr, int      errValue);
436   typedef intptr_t (*SafeFetchNStub) (intptr_t* adr, intptr_t errValue);
437 
438   static SafeFetch32Stub SafeFetch32_stub() { return CAST_TO_FN_PTR(SafeFetch32Stub, _safefetch32_entry); }
439   static SafeFetchNStub  SafeFetchN_stub()  { return CAST_TO_FN_PTR(SafeFetchNStub,  _safefetchN_entry); }
440 
441   static bool is_safefetch_fault(address pc) {
442     return pc != NULL &&
443           (pc == _safefetch32_fault_pc ||
444            pc == _safefetchN_fault_pc);
445   }
446 
447   static address continuation_for_safefetch_fault(address pc) {
448     assert(_safefetch32_continuation_pc != NULL &&

136   static address _call_stub_entry;
137   static address _forward_exception_entry;
138   static address _catch_exception_entry;
139   static address _throw_AbstractMethodError_entry;
140   static address _throw_IncompatibleClassChangeError_entry;
141   static address _throw_NullPointerException_at_call_entry;
142   static address _throw_StackOverflowError_entry;
143   static address _throw_delayed_StackOverflowError_entry;
144 
145   static address _atomic_xchg_entry;
146   static address _atomic_xchg_long_entry;
147   static address _atomic_store_entry;
148   static address _atomic_cmpxchg_entry;
149   static address _atomic_cmpxchg_byte_entry;
150   static address _atomic_cmpxchg_long_entry;
151   static address _atomic_add_entry;
152   static address _atomic_add_long_entry;
153   static address _fence_entry;
154 
155   static BufferBlob* _code1;                               // code buffer for initial routines
156   static BufferBlob* _code2;
157   static BufferBlob* _code3;                               // code buffer for all other routines
158 
159   // Leaf routines which implement arraycopy and their addresses
160   // arraycopy operands aligned on element type boundary
161   static address _jbyte_arraycopy;
162   static address _jshort_arraycopy;
163   static address _jint_arraycopy;
164   static address _jlong_arraycopy;
165   static address _oop_arraycopy, _oop_arraycopy_uninit;
166   static address _jbyte_disjoint_arraycopy;
167   static address _jshort_disjoint_arraycopy;
168   static address _jint_disjoint_arraycopy;
169   static address _jlong_disjoint_arraycopy;
170   static address _oop_disjoint_arraycopy, _oop_disjoint_arraycopy_uninit;
171 
172   static bool _has_word_memcpy;
173   static address _word_memcpy_up;
174   static address _word_memcpy_down;
175   static address _word_memcpy_up_nt;
176   static address _word_memcpy_down_nt;
177 
178   // arraycopy operands aligned on zero'th element boundary
179   // These are identical to the ones aligned aligned on an
180   // element type boundary, except that they assume that both
181   // source and destination are HeapWord aligned.
182   static address _arrayof_jbyte_arraycopy;
183   static address _arrayof_jshort_arraycopy;
184   static address _arrayof_jint_arraycopy;
185   static address _arrayof_jlong_arraycopy;
186   static address _arrayof_oop_arraycopy, _arrayof_oop_arraycopy_uninit;
187   static address _arrayof_jbyte_disjoint_arraycopy;
188   static address _arrayof_jshort_disjoint_arraycopy;
189   static address _arrayof_jint_disjoint_arraycopy;
190   static address _arrayof_jlong_disjoint_arraycopy;
191   static address _arrayof_oop_disjoint_arraycopy, _arrayof_oop_disjoint_arraycopy_uninit;
192 
193   // cache line writeback
194   static address _data_cache_writeback;
195   static address _data_cache_writeback_sync;
196 
197   // these are recommended but optional:

240   static address _squareToLen;
241   static address _mulAdd;
242   static address _montgomeryMultiply;
243   static address _montgomerySquare;
244   static address _bigIntegerRightShiftWorker;
245   static address _bigIntegerLeftShiftWorker;
246 
247   static address _vectorizedMismatch;
248 
249   static address _dexp;
250   static address _dlog;
251   static address _dlog10;
252   static address _dpow;
253   static address _dsin;
254   static address _dcos;
255   static address _dlibm_sin_cos_huge;
256   static address _dlibm_reduce_pi04l;
257   static address _dlibm_tan_cot_huge;
258   static address _dtan;
259 
260   static RuntimeStub* _cont_doYield_stub;
261   static address _cont_doYield;
262   static address _cont_jump_from_sp;
263   static address _cont_thaw;
264   static address _cont_returnBarrier;
265   static address _cont_returnBarrierExc;
266   static address _cont_interpreter_forced_preempt_return;
267 
268   JFR_ONLY(static address _jfr_write_checkpoint;)
269   JFR_ONLY(static address _jfr_get_event_writer;)
270 
271   // Safefetch stubs.
272   static address _safefetch32_entry;
273   static address _safefetch32_fault_pc;
274   static address _safefetch32_continuation_pc;
275   static address _safefetchN_entry;
276   static address _safefetchN_fault_pc;
277   static address _safefetchN_continuation_pc;
278 
279   // Vector Math Routines
280   static address _vector_f_math[VectorSupport::NUM_VEC_SIZES][VectorSupport::NUM_SVML_OP];
281   static address _vector_d_math[VectorSupport::NUM_VEC_SIZES][VectorSupport::NUM_SVML_OP];
282 
283  public:
284   // Initialization/Testing
285   static void    initialize1();                            // must happen before universe::genesis
286   static void    initialize2();                            // must happen after  universe::genesis
287   static void    initializeContinuationStubs();            // must happen after  universe::genesis
288 
289   static bool is_stub_code(address addr)                   { return contains(addr); }
290 
291   static bool contains(address addr) {
292     return
293       (_code1 != NULL && _code1->blob_contains(addr)) ||
294       (_code2 != NULL && _code2->blob_contains(addr)) ;
295   }
296 
297   static RuntimeBlob* code1() { return _code1; }
298   static RuntimeBlob* code2() { return _code2; }
299   static RuntimeBlob* code3() { return _code3; }
300 
301   // Debugging
302   static jint    verify_oop_count()                        { return _verify_oop_count; }
303   static jint*   verify_oop_count_addr()                   { return &_verify_oop_count; }
304   // a subroutine for debugging the GC
305   static address verify_oop_subroutine_entry_address()     { return (address)&_verify_oop_subroutine_entry; }
306 
307   static address catch_exception_entry()                   { return _catch_exception_entry; }
308 
309   // Calls to Java
310   typedef void (*CallStub)(
311     address   link,
312     intptr_t* result,
313     BasicType result_type,
314     Method* method,
315     address   entry_point,
316     intptr_t* parameters,
317     int       size_of_parameters,
318     TRAPS
319   );

328   static address throw_NullPointerException_at_call_entry(){ return _throw_NullPointerException_at_call_entry; }
329   static address throw_StackOverflowError_entry()          { return _throw_StackOverflowError_entry; }
330   static address throw_delayed_StackOverflowError_entry()  { return _throw_delayed_StackOverflowError_entry; }
331 
332   static address atomic_xchg_entry()                       { return _atomic_xchg_entry; }
333   static address atomic_xchg_long_entry()                  { return _atomic_xchg_long_entry; }
334   static address atomic_store_entry()                      { return _atomic_store_entry; }
335   static address atomic_cmpxchg_entry()                    { return _atomic_cmpxchg_entry; }
336   static address atomic_cmpxchg_byte_entry()               { return _atomic_cmpxchg_byte_entry; }
337   static address atomic_cmpxchg_long_entry()               { return _atomic_cmpxchg_long_entry; }
338   static address atomic_add_entry()                        { return _atomic_add_entry; }
339   static address atomic_add_long_entry()                   { return _atomic_add_long_entry; }
340   static address fence_entry()                             { return _fence_entry; }
341 
342   static address select_arraycopy_function(BasicType t, bool aligned, bool disjoint, const char* &name, bool dest_uninitialized);
343 
344   static address jbyte_arraycopy()  { return _jbyte_arraycopy; }
345   static address jshort_arraycopy() { return _jshort_arraycopy; }
346   static address jint_arraycopy()   { return _jint_arraycopy; }
347   static address jlong_arraycopy()  { return _jlong_arraycopy; }
348 
349   static bool has_word_memcpy()        { return _has_word_memcpy; }
350   static address word_memcpy_up()      { return _word_memcpy_up; }
351   static address word_memcpy_up_nt()   { return _word_memcpy_up_nt; }
352   static address word_memcpy_down()    { return _word_memcpy_down; }
353   static address word_memcpy_down_nt() { return _word_memcpy_down_nt; }
354 
355   static address oop_arraycopy(bool dest_uninitialized = false) {
356     return dest_uninitialized ? _oop_arraycopy_uninit : _oop_arraycopy;
357   }
358   static address jbyte_disjoint_arraycopy()  { return _jbyte_disjoint_arraycopy; }
359   static address jshort_disjoint_arraycopy() { return _jshort_disjoint_arraycopy; }
360   static address jint_disjoint_arraycopy()   { return _jint_disjoint_arraycopy; }
361   static address jlong_disjoint_arraycopy()  { return _jlong_disjoint_arraycopy; }
362   static address oop_disjoint_arraycopy(bool dest_uninitialized = false) {
363     return dest_uninitialized ?  _oop_disjoint_arraycopy_uninit : _oop_disjoint_arraycopy;
364   }
365 
366   static address arrayof_jbyte_arraycopy()  { return _arrayof_jbyte_arraycopy; }
367   static address arrayof_jshort_arraycopy() { return _arrayof_jshort_arraycopy; }
368   static address arrayof_jint_arraycopy()   { return _arrayof_jint_arraycopy; }
369   static address arrayof_jlong_arraycopy()  { return _arrayof_jlong_arraycopy; }
370   static address arrayof_oop_arraycopy(bool dest_uninitialized = false) {
371     return dest_uninitialized ? _arrayof_oop_arraycopy_uninit : _arrayof_oop_arraycopy;
372   }
373 
374   static address arrayof_jbyte_disjoint_arraycopy()  { return _arrayof_jbyte_disjoint_arraycopy; }

436   static address mulAdd()              { return _mulAdd; }
437   static address montgomeryMultiply()  { return _montgomeryMultiply; }
438   static address montgomerySquare()    { return _montgomerySquare; }
439   static address bigIntegerRightShift() { return _bigIntegerRightShiftWorker; }
440   static address bigIntegerLeftShift()  { return _bigIntegerLeftShiftWorker; }
441   static address galoisCounterMode_AESCrypt()   { return _galoisCounterMode_AESCrypt; }
442 
443   static address vectorizedMismatch()  { return _vectorizedMismatch; }
444 
445   static address dexp()                { return _dexp; }
446   static address dlog()                { return _dlog; }
447   static address dlog10()              { return _dlog10; }
448   static address dpow()                { return _dpow; }
449   static address dsin()                { return _dsin; }
450   static address dcos()                { return _dcos; }
451   static address dlibm_reduce_pi04l()  { return _dlibm_reduce_pi04l; }
452   static address dlibm_sin_cos_huge()  { return _dlibm_sin_cos_huge; }
453   static address dlibm_tan_cot_huge()  { return _dlibm_tan_cot_huge; }
454   static address dtan()                { return _dtan; }
455 
456   static RuntimeStub* cont_doYield_stub() { return _cont_doYield_stub; }
457   static address cont_doYield()        { return _cont_doYield; }
458   static address cont_jump_from_sp()   { return _cont_jump_from_sp; }
459   static address cont_thaw()           { return _cont_thaw; }
460   static address cont_returnBarrier()  { return _cont_returnBarrier; }
461   static address cont_returnBarrierExc(){return _cont_returnBarrierExc; }
462   static address cont_interpreter_forced_preempt_return() { return _cont_interpreter_forced_preempt_return; }
463 
464   JFR_ONLY(static address jfr_write_checkpoint() { return _jfr_write_checkpoint; })
465   JFR_ONLY(static address jfr_get_event_writer() { return _jfr_get_event_writer; })
466 
467 
468   static address select_fill_function(BasicType t, bool aligned, const char* &name);
469 
470   //
471   // Safefetch stub support
472   //
473 
474   typedef int      (*SafeFetch32Stub)(int*      adr, int      errValue);
475   typedef intptr_t (*SafeFetchNStub) (intptr_t* adr, intptr_t errValue);
476 
477   static SafeFetch32Stub SafeFetch32_stub() { return CAST_TO_FN_PTR(SafeFetch32Stub, _safefetch32_entry); }
478   static SafeFetchNStub  SafeFetchN_stub()  { return CAST_TO_FN_PTR(SafeFetchNStub,  _safefetchN_entry); }
479 
480   static bool is_safefetch_fault(address pc) {
481     return pc != NULL &&
482           (pc == _safefetch32_fault_pc ||
483            pc == _safefetchN_fault_pc);
484   }
485 
486   static address continuation_for_safefetch_fault(address pc) {
487     assert(_safefetch32_continuation_pc != NULL &&
< prev index next >