< prev index next >

src/share/vm/runtime/stubRoutines.hpp

Print this page
rev 7905 : 8074552:  SafeFetch32 and SafeFetchN do not work in error handling
Summary: handle SafeFetch faults in secondary signal handlers
Contributed-by: Thomas Stuefe


 438 
 439   static void arrayof_jbyte_copy     (HeapWord* src, HeapWord* dest, size_t count);
 440   static void arrayof_jshort_copy    (HeapWord* src, HeapWord* dest, size_t count);
 441   static void arrayof_jint_copy      (HeapWord* src, HeapWord* dest, size_t count);
 442   static void arrayof_jlong_copy     (HeapWord* src, HeapWord* dest, size_t count);
 443   static void arrayof_oop_copy       (HeapWord* src, HeapWord* dest, size_t count);
 444   static void arrayof_oop_copy_uninit(HeapWord* src, HeapWord* dest, size_t count);
 445 };
 446 
 447 // Safefetch allows to load a value from a location that's not known
 448 // to be valid. If the load causes a fault, the error value is returned.
 449 inline int SafeFetch32(int* adr, int errValue) {
 450   assert(StubRoutines::SafeFetch32_stub(), "stub not yet generated");
 451   return StubRoutines::SafeFetch32_stub()(adr, errValue);
 452 }
 453 inline intptr_t SafeFetchN(intptr_t* adr, intptr_t errValue) {
 454   assert(StubRoutines::SafeFetchN_stub(), "stub not yet generated");
 455   return StubRoutines::SafeFetchN_stub()(adr, errValue);
 456 }
 457 





 458 #endif // SHARE_VM_RUNTIME_STUBROUTINES_HPP


 438 
 439   static void arrayof_jbyte_copy     (HeapWord* src, HeapWord* dest, size_t count);
 440   static void arrayof_jshort_copy    (HeapWord* src, HeapWord* dest, size_t count);
 441   static void arrayof_jint_copy      (HeapWord* src, HeapWord* dest, size_t count);
 442   static void arrayof_jlong_copy     (HeapWord* src, HeapWord* dest, size_t count);
 443   static void arrayof_oop_copy       (HeapWord* src, HeapWord* dest, size_t count);
 444   static void arrayof_oop_copy_uninit(HeapWord* src, HeapWord* dest, size_t count);
 445 };
 446 
 447 // Safefetch allows to load a value from a location that's not known
 448 // to be valid. If the load causes a fault, the error value is returned.
 449 inline int SafeFetch32(int* adr, int errValue) {
 450   assert(StubRoutines::SafeFetch32_stub(), "stub not yet generated");
 451   return StubRoutines::SafeFetch32_stub()(adr, errValue);
 452 }
 453 inline intptr_t SafeFetchN(intptr_t* adr, intptr_t errValue) {
 454   assert(StubRoutines::SafeFetchN_stub(), "stub not yet generated");
 455   return StubRoutines::SafeFetchN_stub()(adr, errValue);
 456 }
 457 
 458 
 459 // returns true if SafeFetch32 and SafeFetchN can be used safely (stubroutines are already generated)
 460 inline bool CanUseSafeFetch32() { return StubRoutines::SafeFetch32_stub() ? true : false; }
 461 inline bool CanUseSafeFetchN()  { return StubRoutines::SafeFetchN_stub() ? true : false; }
 462 
 463 #endif // SHARE_VM_RUNTIME_STUBROUTINES_HPP
< prev index next >