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)
66 call __go_get_closure@PLT
75 call reflect.MakeFuncStubGo@PLT
77 call reflect.MakeFuncStubGo
80 # The structure will be updated with any return values. Load
81 # all possible return registers before returning to the caller.
87 movdqa 0x40(%rsp), %xmm0
88 movdqa 0x50(%rsp), %xmm1
90 # long double values are returned on the floating point stack,
91 # but we don't worry about that since Go doesn't have a long
101 .size reflect.makeFuncStub, . - reflect.makeFuncStub
105 #ifdef HAVE_AS_X86_64_UNWIND_SECTION_TYPE
106 .section .eh_frame,"a",@unwind
108 .section .eh_frame,"a",@progbits
111 .long .LECIE1-.LSCIE1 /* Length of Common Information Entry */
113 .long 0x0 /* CIE Identifier Tag */
114 .byte 0x1 /* CIE Version */
115 .ascii "zR\0" /* CIE Augmentation */
116 .uleb128 1 /* CIE Code Alignment Factor */
117 .sleb128 -8 /* CIE Data Alignment Factor */
118 .byte 0x10 /* CIE RA Column */
119 .uleb128 1 /* Augmentation size */
120 .byte 0x1b /* FDE Encoding (pcrel sdata4) */
121 .byte 0xc /* DW_CFA_def_cfa, %rsp offset 8 */
124 .byte 0x80+16 /* DW_CFA_offset, %rip offset 1*-8 */
129 .long .LEFDE1-.LASFDE1 /* FDE Length */
131 .long .LASFDE1-.Lframe1 /* FDE CIE offset */
132 #if HAVE_AS_X86_PCREL
133 .long .LFB1-. /* FDE initial location */
137 .long .LFE1-.LFB1 /* FDE address range */
138 .uleb128 0x0 /* Augmentation size */
139 .byte 0x4 /* DW_CFA_advance_loc4 */
141 .byte 0xe /* DW_CFA_def_cfa_offset */
143 .byte 0x86 /* DW_CFA_offset, column 0x6 */
145 .byte 0x4 /* DW_CFA_advance_loc4 */
147 .byte 0xd /* DW_CFA_def_cfa_register */
149 .byte 0x2 /* DW_CFA_advance_loc1 */
151 .byte 0xc /* DW_CFA_def_cfa */
158 #if defined(__ELF__) && defined(__linux__)
159 .section .note.GNU-stack,"",@progbits
160 .section .note.GNU-split-stack,"",@progbits
161 .section .note.GNU-no-split-stack,"",@progbits