зеркало из https://github.com/github/ruby.git
Avoid memory dependency between instructions. (#8284)
This commit is contained in:
Родитель
97a97d6d6c
Коммит
40d774bec6
|
@ -13,29 +13,35 @@
|
||||||
.globl PREFIXED_SYMBOL(SYMBOL_PREFIX,coroutine_transfer)
|
.globl PREFIXED_SYMBOL(SYMBOL_PREFIX,coroutine_transfer)
|
||||||
PREFIXED_SYMBOL(SYMBOL_PREFIX,coroutine_transfer):
|
PREFIXED_SYMBOL(SYMBOL_PREFIX,coroutine_transfer):
|
||||||
|
|
||||||
# Save caller state
|
# Make space on the stack for 6 registers:
|
||||||
pushq %rbp
|
subq $48, %rsp
|
||||||
pushq %rbx
|
|
||||||
pushq %r12
|
|
||||||
pushq %r13
|
|
||||||
pushq %r14
|
|
||||||
pushq %r15
|
|
||||||
|
|
||||||
# Save caller stack pointer
|
# Save caller state:
|
||||||
|
movq %rbp, 40(%rsp)
|
||||||
|
movq %rbx, 32(%rsp)
|
||||||
|
movq %r12, 24(%rsp)
|
||||||
|
movq %r13, 16(%rsp)
|
||||||
|
movq %r14, 8(%rsp)
|
||||||
|
movq %r15, (%rsp)
|
||||||
|
|
||||||
|
# Save caller stack pointer:
|
||||||
movq %rsp, (%rdi)
|
movq %rsp, (%rdi)
|
||||||
|
|
||||||
# Restore callee stack pointer
|
# Restore callee stack pointer:
|
||||||
movq (%rsi), %rsp
|
movq (%rsi), %rsp
|
||||||
|
|
||||||
# Restore callee state
|
# Restore callee state
|
||||||
popq %r15
|
movq 40(%rsp), %rbp
|
||||||
popq %r14
|
movq 32(%rsp), %rbx
|
||||||
popq %r13
|
movq 24(%rsp), %r12
|
||||||
popq %r12
|
movq 16(%rsp), %r13
|
||||||
popq %rbx
|
movq 8(%rsp), %r14
|
||||||
popq %rbp
|
movq (%rsp), %r15
|
||||||
|
|
||||||
# Put the first argument into the return value
|
# Adjust stack pointer back:
|
||||||
|
addq $48, %rsp
|
||||||
|
|
||||||
|
# Put the first argument into the return value:
|
||||||
movq %rdi, %rax
|
movq %rdi, %rax
|
||||||
|
|
||||||
# We pop the return address and jump to it
|
# We pop the return address and jump to it
|
||||||
|
|
Загрузка…
Ссылка в новой задаче