222 static double (*_intrinsic_pow)(double, double); |
222 static double (*_intrinsic_pow)(double, double); |
223 static double (*_intrinsic_sin)(double); |
223 static double (*_intrinsic_sin)(double); |
224 static double (*_intrinsic_cos)(double); |
224 static double (*_intrinsic_cos)(double); |
225 static double (*_intrinsic_tan)(double); |
225 static double (*_intrinsic_tan)(double); |
226 |
226 |
|
227 // Safefetch stubs. |
|
228 static address _safefetch32_entry; |
|
229 static address _safefetch32_fault_pc; |
|
230 static address _safefetch32_continuation_pc; |
|
231 static address _safefetchN_entry; |
|
232 static address _safefetchN_fault_pc; |
|
233 static address _safefetchN_continuation_pc; |
|
234 |
227 public: |
235 public: |
228 // Initialization/Testing |
236 // Initialization/Testing |
229 static void initialize1(); // must happen before universe::genesis |
237 static void initialize1(); // must happen before universe::genesis |
230 static void initialize2(); // must happen after universe::genesis |
238 static void initialize2(); // must happen after universe::genesis |
231 |
239 |
383 assert(_intrinsic_tan != NULL, "must be defined"); |
391 assert(_intrinsic_tan != NULL, "must be defined"); |
384 return _intrinsic_tan(d); |
392 return _intrinsic_tan(d); |
385 } |
393 } |
386 |
394 |
387 // |
395 // |
|
396 // Safefetch stub support |
|
397 // |
|
398 |
|
399 typedef int (*SafeFetch32Stub)(int* adr, int errValue); |
|
400 typedef intptr_t (*SafeFetchNStub) (intptr_t* adr, intptr_t errValue); |
|
401 |
|
402 static SafeFetch32Stub SafeFetch32_stub() { return CAST_TO_FN_PTR(SafeFetch32Stub, _safefetch32_entry); } |
|
403 static SafeFetchNStub SafeFetchN_stub() { return CAST_TO_FN_PTR(SafeFetchNStub, _safefetchN_entry); } |
|
404 |
|
405 static bool is_safefetch_fault(address pc) { |
|
406 return pc != NULL && |
|
407 (pc == _safefetch32_fault_pc || |
|
408 pc == _safefetchN_fault_pc); |
|
409 } |
|
410 |
|
411 static address continuation_for_safefetch_fault(address pc) { |
|
412 assert(_safefetch32_continuation_pc != NULL && |
|
413 _safefetchN_continuation_pc != NULL, |
|
414 "not initialized"); |
|
415 |
|
416 if (pc == _safefetch32_fault_pc) return _safefetch32_continuation_pc; |
|
417 if (pc == _safefetchN_fault_pc) return _safefetchN_continuation_pc; |
|
418 |
|
419 ShouldNotReachHere(); |
|
420 return NULL; |
|
421 } |
|
422 |
|
423 // |
388 // Default versions of the above arraycopy functions for platforms which do |
424 // Default versions of the above arraycopy functions for platforms which do |
389 // not have specialized versions |
425 // not have specialized versions |
390 // |
426 // |
391 static void jbyte_copy (jbyte* src, jbyte* dest, size_t count); |
427 static void jbyte_copy (jbyte* src, jbyte* dest, size_t count); |
392 static void jshort_copy (jshort* src, jshort* dest, size_t count); |
428 static void jshort_copy (jshort* src, jshort* dest, size_t count); |
401 static void arrayof_jlong_copy (HeapWord* src, HeapWord* dest, size_t count); |
437 static void arrayof_jlong_copy (HeapWord* src, HeapWord* dest, size_t count); |
402 static void arrayof_oop_copy (HeapWord* src, HeapWord* dest, size_t count); |
438 static void arrayof_oop_copy (HeapWord* src, HeapWord* dest, size_t count); |
403 static void arrayof_oop_copy_uninit(HeapWord* src, HeapWord* dest, size_t count); |
439 static void arrayof_oop_copy_uninit(HeapWord* src, HeapWord* dest, size_t count); |
404 }; |
440 }; |
405 |
441 |
|
442 // Safefetch allows to load a value from a location that's not known |
|
443 // to be valid. If the load causes a fault, the error value is returned. |
|
444 inline int SafeFetch32(int* adr, int errValue) { |
|
445 assert(StubRoutines::SafeFetch32_stub(), "stub not yet generated"); |
|
446 return StubRoutines::SafeFetch32_stub()(adr, errValue); |
|
447 } |
|
448 inline intptr_t SafeFetchN(intptr_t* adr, intptr_t errValue) { |
|
449 assert(StubRoutines::SafeFetchN_stub(), "stub not yet generated"); |
|
450 return StubRoutines::SafeFetchN_stub()(adr, errValue); |
|
451 } |
|
452 |
406 #endif // SHARE_VM_RUNTIME_STUBROUTINES_HPP |
453 #endif // SHARE_VM_RUNTIME_STUBROUTINES_HPP |