9
9
#define RUST_NEW_STACK2 _rust_new_stack2
10
10
#define RUST_DEL_STACK _rust_del_stack
11
11
#define RUST_DEL_STACK _rust_del_stack
12
- #define RUST_GET_PREV_STACK _rust_get_prev_stack
13
12
#define UPCALL_CALL_C _upcall_call_shim_on_c_stack
14
13
#define MORESTACK ___morestack
15
14
#else
16
15
#define RUST_NEW_STACK2 rust_new_stack2
17
16
#define RUST_DEL_STACK rust_del_stack
18
17
#define RUST_DEL_STACK rust_del_stack
19
- #define RUST_GET_PREV_STACK rust_get_prev_stack
20
18
#define UPCALL_CALL_C upcall_call_shim_on_c_stack
21
19
#define MORESTACK __morestack
22
20
#endif
@@ -63,9 +61,6 @@ MORESTACK:
63
61
movq %rsp , %rbp
64
62
.cfi_def_cfa_register %rbp
65
63
66
- // Alignment
67
- pushq $0
68
-
69
64
// FIXME: libgcc also saves rax. not sure if we need to
70
65
71
66
// Save argument registers
@@ -82,7 +77,6 @@ MORESTACK:
82
77
movq %rbp , %rcx
83
78
addq $24 , %rcx // Base pointer, return address x2
84
79
85
- pushq %rbp // Save the Rust stack pointer
86
80
pushq %r11 // Size of stack arguments
87
81
pushq %rcx // Address of stack arguments
88
82
pushq %r10 // The amount of stack needed
@@ -92,7 +86,7 @@ MORESTACK:
92
86
call UPCALL_CALL_C@PLT
93
87
94
88
// Pop the new_stack_args struct
95
- addq $32 , %rsp
89
+ addq $24 , %rsp
96
90
97
91
// Pop the saved arguments
98
92
popq %r9
@@ -108,13 +102,8 @@ MORESTACK:
108
102
109
103
call *%r10 // Reenter the caller function
110
104
111
- leaq RUST_GET_PREV_STACK@PLT(%rip ), %rsi
112
- movq $0 , %rdi
113
- call UPCALL_CALL_C@PLT
114
-
115
- // Switch back to the rust stack, positioned
116
- // where we pushed %ebp
117
- movq %rax , %rsp
105
+ // Switch back to the rust stack
106
+ movq %rbp , %rsp
118
107
119
108
// Align the stack again
120
109
pushq $0
0 commit comments