mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 597831 Update TrampolineSUNW*.s r=dvander
This commit is contained in:
parent
656da172a8
commit
1adbef9029
@ -52,35 +52,46 @@ JaegerTrampoline:
|
||||
pushq %r15
|
||||
pushq %rbx
|
||||
|
||||
/* Load mask registers. */
|
||||
movq $0xFFFF800000000000, %r13
|
||||
movq $0x00007FFFFFFFFFFF, %r14
|
||||
|
||||
/* Build the JIT frame.
|
||||
* rdi = cx
|
||||
* rsi = fp
|
||||
* rcx = inlineCallCount
|
||||
* fp must go into rbx
|
||||
*/
|
||||
pushq %rcx
|
||||
pushq %rdi
|
||||
pushq %rsi
|
||||
pushq %rsi /* entryFp */
|
||||
pushq %rcx /* inlineCallCount */
|
||||
pushq %rdi /* cx */
|
||||
pushq %rsi /* fp */
|
||||
movq %rsi, %rbx
|
||||
|
||||
/* Space for the rest of the VMFrame. */
|
||||
subq $0x28, %rsp
|
||||
|
||||
/* Set cx->regs (requires saving rdx). */
|
||||
/*
|
||||
* This is actually part of the VMFrame, but we need to save |r8| for
|
||||
* SafePointTrampoline.
|
||||
*/
|
||||
pushq %r8
|
||||
|
||||
/* Set cx->regs and set the active frame. Save rdx and align frame in one. */
|
||||
pushq %rdx
|
||||
movq %rsp, %rdi
|
||||
call SetVMFrameRegs
|
||||
popq %rdx
|
||||
movq %rsp, %rdi
|
||||
call PushActiveVMFrame
|
||||
|
||||
/*
|
||||
* Jump into into the JIT'd code. The call implicitly fills in
|
||||
* the precious f.scriptedReturn member of VMFrame.
|
||||
* Jump into into the JIT'd code.
|
||||
*/
|
||||
call *%rdx
|
||||
leaq -8(%rsp), %rdi
|
||||
call UnsetVMFrameRegs
|
||||
call *0(%rsp)
|
||||
movq %rsp, %rdi
|
||||
call PopActiveVMFrame
|
||||
|
||||
addq $0x40, %rsp
|
||||
addq $0x58, %rsp
|
||||
popq %rbx
|
||||
popq %r15
|
||||
popq %r14
|
||||
@ -102,20 +113,38 @@ JaegerThrowpoline:
|
||||
je throwpoline_exit
|
||||
jmp *%rax
|
||||
throwpoline_exit:
|
||||
addq $0x48, %rsp
|
||||
movq %rsp, %rdi
|
||||
call PopActiveVMFrame
|
||||
addq $0x58, %rsp
|
||||
popq %rbx
|
||||
popq %r15
|
||||
popq %r14
|
||||
popq %r13
|
||||
popq %r12
|
||||
popq %rbp
|
||||
xorq %rax,%rax
|
||||
ret
|
||||
.size JaegerThrowpoline, . - JaegerThrowpoline
|
||||
|
||||
.global JaegerFromTracer
|
||||
.type JaegerFromTracer, @function
|
||||
JaegerFromTracer:
|
||||
/* Restore fp reg. */
|
||||
movq 0x30(%rsp), %rbx
|
||||
jmp *%rax
|
||||
.size JaegerFromTracer, . - JaegerFromTracer
|
||||
.global SafePointTrampoline
|
||||
.type SafePointTrampoline, @function
|
||||
SafePointTrampoline:
|
||||
popq %rax
|
||||
movq %rax, 0x50(%rbx)
|
||||
jmp *8(%rsp)
|
||||
.size SafePointTrampoline, . - SafePointTrampoline
|
||||
|
||||
.global InjectJaegerReturn
|
||||
.type InjectJaegerReturn, @function
|
||||
InjectJaegerReturn:
|
||||
movq 0x30(%rbx), %rcx /* load fp->rval_ into typeReg */
|
||||
movq 0x50(%rbx), %rax /* fp->ncode_ */
|
||||
|
||||
/* Reimplementation of PunboxAssembler::loadValueAsComponents() */
|
||||
movq %r14, %rdx /* payloadReg = payloadMaskReg */
|
||||
andq %rcx, %rdx
|
||||
xorq %rdx, %rcx
|
||||
|
||||
movq 0x38(%rsp), %rbx /* f.fp */
|
||||
jmp *%rax /* return. */
|
||||
.size InjectJaegerReturn, . - InjectJaegerReturn
|
||||
|
@ -63,19 +63,13 @@ JaegerTrampoline:
|
||||
/* No fastcall for sunstudio. */
|
||||
pushl %esp
|
||||
call SetVMFrameRegs
|
||||
popl %edx
|
||||
pushl %esp
|
||||
call PushActiveVMFrame
|
||||
popl %edx
|
||||
call *16(%ebp)
|
||||
pushl %esp
|
||||
call PopActiveVMFrame
|
||||
popl %ecx
|
||||
pushl %esp
|
||||
call UnsetVMFrameRegs
|
||||
popl %ecx
|
||||
|
||||
addl $0x2C, %esp
|
||||
addl $0x30, %esp
|
||||
popl %ebx
|
||||
popl %edi
|
||||
popl %esi
|
||||
@ -109,7 +103,7 @@ throwpoline_exit:
|
||||
pushl %esp
|
||||
call PopActiveVMFrame
|
||||
popl %ebx
|
||||
addl $0x2c, %esp
|
||||
addl $0x2C, %esp
|
||||
popl %ebx
|
||||
popl %edi
|
||||
popl %esi
|
||||
@ -123,7 +117,7 @@ throwpoline_exit:
|
||||
InjectJaegerReturn:
|
||||
movl 0x18(%ebx), %edx /* fp->rval_ data */
|
||||
movl 0x1C(%ebx), %ecx /* fp->rval_ type */
|
||||
movl 0x2c(%ebx), %eax /* fp->ncode_ */
|
||||
movl 0x2C(%ebx), %eax /* fp->ncode_ */
|
||||
/* For Sun Studio there is no fast call. */
|
||||
/* We add the stack by 8 before. */
|
||||
addl $0x8, %esp
|
||||
@ -141,6 +135,6 @@ InjectJaegerReturn:
|
||||
.type SafePointTrampoline, @function
|
||||
SafePointTrampoline:
|
||||
popl %eax
|
||||
movl %eax, 0x2c(%ebx)
|
||||
movl %eax, 0x2C(%ebx)
|
||||
jmp *24(%ebp)
|
||||
.size SafePointTrampoline, . - SafePointTrampoline
|
||||
|
Loading…
Reference in New Issue
Block a user