mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-23 12:34:32 +02:00
8016697: Use stubs to implement safefetch
Implement Safefetch as stub routines. This reduces compiler and os dependencies. Reviewed-by: twisti, kvn
This commit is contained in:
parent
b5efe058f7
commit
ef69ce852c
21 changed files with 231 additions and 304 deletions
|
@ -21,42 +21,6 @@
|
|||
# questions.
|
||||
#
|
||||
|
||||
# Prototype: int SafeFetch32 (int * adr, int ErrValue)
|
||||
# The "ld" at Fetch32 is potentially faulting instruction.
|
||||
# If the instruction traps the trap handler will arrange
|
||||
# for control to resume at Fetch32Resume.
|
||||
# By convention with the trap handler we ensure there is a non-CTI
|
||||
# instruction in the trap shadow.
|
||||
|
||||
|
||||
.globl SafeFetch32, Fetch32PFI, Fetch32Resume
|
||||
.globl SafeFetchN
|
||||
.align 32
|
||||
.type SafeFetch32,@function
|
||||
SafeFetch32:
|
||||
mov %o0, %g1
|
||||
mov %o1, %o0
|
||||
Fetch32PFI:
|
||||
# <-- Potentially faulting instruction
|
||||
ld [%g1], %o0
|
||||
Fetch32Resume:
|
||||
nop
|
||||
retl
|
||||
nop
|
||||
|
||||
.globl SafeFetchN, FetchNPFI, FetchNResume
|
||||
.type SafeFetchN,@function
|
||||
.align 32
|
||||
SafeFetchN:
|
||||
mov %o0, %g1
|
||||
mov %o1, %o0
|
||||
FetchNPFI:
|
||||
ldn [%g1], %o0
|
||||
FetchNResume:
|
||||
nop
|
||||
retl
|
||||
nop
|
||||
|
||||
# Possibilities:
|
||||
# -- membar
|
||||
# -- CAS (SP + BIAS, G0, G0)
|
||||
|
|
|
@ -366,18 +366,9 @@ intptr_t* os::Linux::ucontext_get_fp(ucontext_t *uc) {
|
|||
|
||||
// Utility functions
|
||||
|
||||
extern "C" void Fetch32PFI();
|
||||
extern "C" void Fetch32Resume();
|
||||
extern "C" void FetchNPFI();
|
||||
extern "C" void FetchNResume();
|
||||
|
||||
inline static bool checkPrefetch(sigcontext* uc, address pc) {
|
||||
if (pc == (address) Fetch32PFI) {
|
||||
set_cont_address(uc, address(Fetch32Resume));
|
||||
return true;
|
||||
}
|
||||
if (pc == (address) FetchNPFI) {
|
||||
set_cont_address(uc, address(FetchNResume));
|
||||
if (StubRoutines::is_safefetch_fault(pc)) {
|
||||
set_cont_address(uc, address(StubRoutines::continuation_for_safefetch_fault(pc)));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue