< prev index next >

src/hotspot/share/runtime/stubRoutines.hpp

Print this page
rev 50904 : Move Shenandoah stubs generation into ShenandoahBarrierSetAssembler


 209   // These are versions of the java.lang.Math methods which perform
 210   // the same operations as the intrinsic version.  They are used for
 211   // constant folding in the compiler to ensure equivalence.  If the
 212   // intrinsic version returns the same result as the strict version
 213   // then they can be set to the appropriate function from
 214   // SharedRuntime.
 215   static double (*_intrinsic_log10)(double);
 216   static double (*_intrinsic_pow)(double, double);
 217   static double (*_intrinsic_sin)(double);
 218   static double (*_intrinsic_cos)(double);
 219   static double (*_intrinsic_tan)(double);
 220 
 221   // Safefetch stubs.
 222   static address _safefetch32_entry;
 223   static address _safefetch32_fault_pc;
 224   static address _safefetch32_continuation_pc;
 225   static address _safefetchN_entry;
 226   static address _safefetchN_fault_pc;
 227   static address _safefetchN_continuation_pc;
 228 
 229   static address _shenandoah_wb_C;
 230 
 231  public:
 232   // Initialization/Testing
 233   static void    initialize1();                            // must happen before universe::genesis
 234   static void    initialize2();                            // must happen after  universe::genesis
 235 
 236   static bool is_stub_code(address addr)                   { return contains(addr); }
 237 
 238   static bool contains(address addr) {
 239     return
 240       (_code1 != NULL && _code1->blob_contains(addr)) ||
 241       (_code2 != NULL && _code2->blob_contains(addr)) ;
 242   }
 243 
 244   static RuntimeBlob* code1() { return _code1; }
 245   static RuntimeBlob* code2() { return _code2; }
 246 
 247   // Debugging
 248   static jint    verify_oop_count()                        { return _verify_oop_count; }
 249   static jint*   verify_oop_count_addr()                   { return &_verify_oop_count; }
 250   // a subroutine for debugging the GC


 436     return NULL;
 437   }
 438 
 439   //
 440   // Default versions of the above arraycopy functions for platforms which do
 441   // not have specialized versions
 442   //
 443   static void jbyte_copy     (jbyte*  src, jbyte*  dest, size_t count);
 444   static void jshort_copy    (jshort* src, jshort* dest, size_t count);
 445   static void jint_copy      (jint*   src, jint*   dest, size_t count);
 446   static void jlong_copy     (jlong*  src, jlong*  dest, size_t count);
 447   static void oop_copy       (oop*    src, oop*    dest, size_t count);
 448   static void oop_copy_uninit(oop*    src, oop*    dest, size_t count);
 449 
 450   static void arrayof_jbyte_copy     (HeapWord* src, HeapWord* dest, size_t count);
 451   static void arrayof_jshort_copy    (HeapWord* src, HeapWord* dest, size_t count);
 452   static void arrayof_jint_copy      (HeapWord* src, HeapWord* dest, size_t count);
 453   static void arrayof_jlong_copy     (HeapWord* src, HeapWord* dest, size_t count);
 454   static void arrayof_oop_copy       (HeapWord* src, HeapWord* dest, size_t count);
 455   static void arrayof_oop_copy_uninit(HeapWord* src, HeapWord* dest, size_t count);
 456 
 457   static address shenandoah_wb_C()
 458   {
 459     return _shenandoah_wb_C;
 460   }
 461 };
 462 
 463 // Safefetch allows to load a value from a location that's not known
 464 // to be valid. If the load causes a fault, the error value is returned.
 465 inline int SafeFetch32(int* adr, int errValue) {
 466   assert(StubRoutines::SafeFetch32_stub(), "stub not yet generated");
 467   return StubRoutines::SafeFetch32_stub()(adr, errValue);
 468 }
 469 inline intptr_t SafeFetchN(intptr_t* adr, intptr_t errValue) {
 470   assert(StubRoutines::SafeFetchN_stub(), "stub not yet generated");
 471   return StubRoutines::SafeFetchN_stub()(adr, errValue);
 472 }
 473 
 474 
 475 // returns true if SafeFetch32 and SafeFetchN can be used safely (stubroutines are already generated)
 476 inline bool CanUseSafeFetch32() {
 477   return StubRoutines::SafeFetch32_stub() ? true : false;
 478 }
 479 
 480 inline bool CanUseSafeFetchN() {


 209   // These are versions of the java.lang.Math methods which perform
 210   // the same operations as the intrinsic version.  They are used for
 211   // constant folding in the compiler to ensure equivalence.  If the
 212   // intrinsic version returns the same result as the strict version
 213   // then they can be set to the appropriate function from
 214   // SharedRuntime.
 215   static double (*_intrinsic_log10)(double);
 216   static double (*_intrinsic_pow)(double, double);
 217   static double (*_intrinsic_sin)(double);
 218   static double (*_intrinsic_cos)(double);
 219   static double (*_intrinsic_tan)(double);
 220 
 221   // Safefetch stubs.
 222   static address _safefetch32_entry;
 223   static address _safefetch32_fault_pc;
 224   static address _safefetch32_continuation_pc;
 225   static address _safefetchN_entry;
 226   static address _safefetchN_fault_pc;
 227   static address _safefetchN_continuation_pc;
 228 


 229  public:
 230   // Initialization/Testing
 231   static void    initialize1();                            // must happen before universe::genesis
 232   static void    initialize2();                            // must happen after  universe::genesis
 233 
 234   static bool is_stub_code(address addr)                   { return contains(addr); }
 235 
 236   static bool contains(address addr) {
 237     return
 238       (_code1 != NULL && _code1->blob_contains(addr)) ||
 239       (_code2 != NULL && _code2->blob_contains(addr)) ;
 240   }
 241 
 242   static RuntimeBlob* code1() { return _code1; }
 243   static RuntimeBlob* code2() { return _code2; }
 244 
 245   // Debugging
 246   static jint    verify_oop_count()                        { return _verify_oop_count; }
 247   static jint*   verify_oop_count_addr()                   { return &_verify_oop_count; }
 248   // a subroutine for debugging the GC


 434     return NULL;
 435   }
 436 
 437   //
 438   // Default versions of the above arraycopy functions for platforms which do
 439   // not have specialized versions
 440   //
 441   static void jbyte_copy     (jbyte*  src, jbyte*  dest, size_t count);
 442   static void jshort_copy    (jshort* src, jshort* dest, size_t count);
 443   static void jint_copy      (jint*   src, jint*   dest, size_t count);
 444   static void jlong_copy     (jlong*  src, jlong*  dest, size_t count);
 445   static void oop_copy       (oop*    src, oop*    dest, size_t count);
 446   static void oop_copy_uninit(oop*    src, oop*    dest, size_t count);
 447 
 448   static void arrayof_jbyte_copy     (HeapWord* src, HeapWord* dest, size_t count);
 449   static void arrayof_jshort_copy    (HeapWord* src, HeapWord* dest, size_t count);
 450   static void arrayof_jint_copy      (HeapWord* src, HeapWord* dest, size_t count);
 451   static void arrayof_jlong_copy     (HeapWord* src, HeapWord* dest, size_t count);
 452   static void arrayof_oop_copy       (HeapWord* src, HeapWord* dest, size_t count);
 453   static void arrayof_oop_copy_uninit(HeapWord* src, HeapWord* dest, size_t count);





 454 };
 455 
 456 // Safefetch allows to load a value from a location that's not known
 457 // to be valid. If the load causes a fault, the error value is returned.
 458 inline int SafeFetch32(int* adr, int errValue) {
 459   assert(StubRoutines::SafeFetch32_stub(), "stub not yet generated");
 460   return StubRoutines::SafeFetch32_stub()(adr, errValue);
 461 }
 462 inline intptr_t SafeFetchN(intptr_t* adr, intptr_t errValue) {
 463   assert(StubRoutines::SafeFetchN_stub(), "stub not yet generated");
 464   return StubRoutines::SafeFetchN_stub()(adr, errValue);
 465 }
 466 
 467 
 468 // returns true if SafeFetch32 and SafeFetchN can be used safely (stubroutines are already generated)
 469 inline bool CanUseSafeFetch32() {
 470   return StubRoutines::SafeFetch32_stub() ? true : false;
 471 }
 472 
 473 inline bool CanUseSafeFetchN() {
< prev index next >