1 # Copyright 2013 The Go Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style
3 # license that can be found in the LICENSE file.
5 # MakeFunc amd64 assembly code.
9 .global reflect.makeFuncStub
12 .type reflect.makeFuncStub,@function
18 # Store all the parameter registers in a struct that looks
28 # rsp uint64 // 0x38 Pointer to arguments on stack.
29 # xmm0 [2]uint64 // 0x40
30 # xmm1 [2]uint64 // 0x50
31 # xmm2 [2]uint64 // 0x60
32 # xmm3 [2]uint64 // 0x70
33 # xmm4 [2]uint64 // 0x80
34 # xmm5 [2]uint64 // 0x90
35 # xmm6 [2]uint64 // 0xa0
36 # xmm7 [2]uint64 // 0xb0
44 subq $0xc0, %rsp # Space for struct on stack.
55 movdqa %xmm0, 0x40(%rsp)
56 movdqa %xmm1, 0x50(%rsp)
57 movdqa %xmm2, 0x60(%rsp)
58 movdqa %xmm3, 0x70(%rsp)
59 movdqa %xmm4, 0x80(%rsp)
60 movdqa %xmm5, 0x90(%rsp)
61 movdqa %xmm6, 0xa0(%rsp)
62 movdqa %xmm7, 0xb0(%rsp)
64 /* For MakeFunc functions that call recover. */
67 call __go_makefunc_can_recover@PLT
69 call __go_makefunc_can_recover
74 call __go_get_closure@PLT
83 call reflect.MakeFuncStubGo@PLT
85 call reflect.MakeFuncStubGo
88 /* MakeFunc functions can no longer call recover. */
90 call __go_makefunc_returning@PLT
92 call __go_makefunc_returning
95 # The structure will be updated with any return values. Load
96 # all possible return registers before returning to the caller.
101 movq 0x10(%rsp), %rsi
102 movdqa 0x40(%rsp), %xmm0
103 movdqa 0x50(%rsp), %xmm1
105 # long double values are returned on the floating point stack,
106 # but we don't worry about that since Go doesn't have a long
116 .size reflect.makeFuncStub, . - reflect.makeFuncStub
120 #ifdef HAVE_AS_X86_64_UNWIND_SECTION_TYPE
121 .section .eh_frame,"a",@unwind
123 .section .eh_frame,"a",@progbits
126 .long .LECIE1-.LSCIE1 /* Length of Common Information Entry */
128 .long 0x0 /* CIE Identifier Tag */
129 .byte 0x1 /* CIE Version */
130 .ascii "zR\0" /* CIE Augmentation */
131 .uleb128 1 /* CIE Code Alignment Factor */
132 .sleb128 -8 /* CIE Data Alignment Factor */
133 .byte 0x10 /* CIE RA Column */
134 .uleb128 1 /* Augmentation size */
135 .byte 0x1b /* FDE Encoding (pcrel sdata4) */
136 .byte 0xc /* DW_CFA_def_cfa, %rsp offset 8 */
139 .byte 0x80+16 /* DW_CFA_offset, %rip offset 1*-8 */
144 .long .LEFDE1-.LASFDE1 /* FDE Length */
146 .long .LASFDE1-.Lframe1 /* FDE CIE offset */
147 #if HAVE_AS_X86_PCREL
148 .long .LFB1-. /* FDE initial location */
152 .long .LFE1-.LFB1 /* FDE address range */
153 .uleb128 0x0 /* Augmentation size */
154 .byte 0x4 /* DW_CFA_advance_loc4 */
156 .byte 0xe /* DW_CFA_def_cfa_offset */
158 .byte 0x86 /* DW_CFA_offset, column 0x6 */
160 .byte 0x4 /* DW_CFA_advance_loc4 */
162 .byte 0xd /* DW_CFA_def_cfa_register */
164 .byte 0x2 /* DW_CFA_advance_loc1 */
166 .byte 0xc /* DW_CFA_def_cfa */
173 #if defined(__ELF__) && defined(__linux__)
174 .section .note.GNU-stack,"",@progbits
175 .section .note.GNU-split-stack,"",@progbits
176 .section .note.GNU-no-split-stack,"",@progbits