register_preservation_trampoline

This commit is contained in:
losfair 2019-08-15 19:08:11 -07:00
parent 7028df23ef
commit 0a54213d4f
2 changed files with 68 additions and 0 deletions

View File

@ -67,3 +67,37 @@ popq %r13
popq %r14
popq %r15
retq
# For switching into a backend without information about where registers are preserved.
.globl register_preservation_trampoline
register_preservation_trampoline:
subq $8, %rsp
pushq %rax
pushq %rcx
pushq %rdx
pushq %rdi
pushq %rsi
pushq %r8
pushq %r9
pushq %r10
callq get_boundary_register_preservation
# Keep this consistent with BoundaryRegisterPreservation
movq %r15, 0(%rax)
movq %r14, 8(%rax)
movq %r13, 16(%rax)
movq %r12, 24(%rax)
movq %rbx, 32(%rax)
popq %r10
popq %r9
popq %r8
popq %rsi
popq %rdi
popq %rdx
popq %rcx
popq %rax
addq $8, %rsp
jmpq *%rax

View File

@ -67,3 +67,37 @@ popq %r13
popq %r14
popq %r15
retq
# For switching into a backend without information about where registers are preserved.
.globl _register_preservation_trampoline
_register_preservation_trampoline:
subq $8, %rsp
pushq %rax
pushq %rcx
pushq %rdx
pushq %rdi
pushq %rsi
pushq %r8
pushq %r9
pushq %r10
callq _get_boundary_register_preservation
# Keep this consistent with BoundaryRegisterPreservation
movq %r15, 0(%rax)
movq %r14, 8(%rax)
movq %r13, 16(%rax)
movq %r12, 24(%rax)
movq %rbx, 32(%rax)
popq %r10
popq %r9
popq %r8
popq %rsi
popq %rdi
popq %rdx
popq %rcx
popq %rax
addq $8, %rsp
jmpq *%rax