@@ -2,7 +2,7 @@ use core::mem;
2
2
3
3
use crate :: convert:: slices:: WasmSlice ;
4
4
use crate :: convert:: RefFromWasmAbi ;
5
- use crate :: convert:: { FromWasmAbi , GlobalStack , IntoWasmAbi , ReturnWasmAbi , Stack } ;
5
+ use crate :: convert:: { FromWasmAbi , IntoWasmAbi , ReturnWasmAbi } ;
6
6
use crate :: describe:: { inform, WasmDescribe , FUNCTION } ;
7
7
use crate :: throw_str;
8
8
@@ -14,7 +14,7 @@ macro_rules! stack_closures {
14
14
{
15
15
type Abi = WasmSlice ;
16
16
17
- fn into_abi( self , _extra : & mut dyn Stack ) -> WasmSlice {
17
+ fn into_abi( self ) -> WasmSlice {
18
18
unsafe {
19
19
let ( a, b) : ( usize , usize ) = mem:: transmute( self ) ;
20
20
WasmSlice { ptr: a as u32 , len: b as u32 }
@@ -35,13 +35,12 @@ macro_rules! stack_closures {
35
35
// ensure they're all destroyed as `return_abi` may throw
36
36
let ret = {
37
37
let f: & dyn Fn ( $( $var) ,* ) -> R = mem:: transmute( ( a, b) ) ;
38
- let mut _stack = GlobalStack :: new( ) ;
39
38
$(
40
- let $var = <$var as FromWasmAbi >:: from_abi( $var, & mut _stack ) ;
39
+ let $var = <$var as FromWasmAbi >:: from_abi( $var) ;
41
40
) *
42
41
f( $( $var) ,* )
43
42
} ;
44
- ret. return_abi( & mut GlobalStack :: new ( ) )
43
+ ret. return_abi( )
45
44
}
46
45
47
46
impl <' a, $( $var, ) * R > WasmDescribe for dyn Fn ( $( $var) ,* ) -> R + ' a
@@ -63,7 +62,7 @@ macro_rules! stack_closures {
63
62
{
64
63
type Abi = WasmSlice ;
65
64
66
- fn into_abi( self , _extra : & mut dyn Stack ) -> WasmSlice {
65
+ fn into_abi( self ) -> WasmSlice {
67
66
unsafe {
68
67
let ( a, b) : ( usize , usize ) = mem:: transmute( self ) ;
69
68
WasmSlice { ptr: a as u32 , len: b as u32 }
@@ -84,13 +83,12 @@ macro_rules! stack_closures {
84
83
// ensure they're all destroyed as `return_abi` may throw
85
84
let ret = {
86
85
let f: & mut dyn FnMut ( $( $var) ,* ) -> R = mem:: transmute( ( a, b) ) ;
87
- let mut _stack = GlobalStack :: new( ) ;
88
86
$(
89
- let $var = <$var as FromWasmAbi >:: from_abi( $var, & mut _stack ) ;
87
+ let $var = <$var as FromWasmAbi >:: from_abi( $var) ;
90
88
) *
91
89
f( $( $var) ,* )
92
90
} ;
93
- ret. return_abi( & mut GlobalStack :: new ( ) )
91
+ ret. return_abi( )
94
92
}
95
93
96
94
impl <' a, $( $var, ) * R > WasmDescribe for dyn FnMut ( $( $var) ,* ) -> R + ' a
@@ -127,7 +125,7 @@ where
127
125
{
128
126
type Abi = WasmSlice ;
129
127
130
- fn into_abi ( self , _extra : & mut dyn Stack ) -> WasmSlice {
128
+ fn into_abi ( self ) -> WasmSlice {
131
129
unsafe {
132
130
let ( a, b) : ( usize , usize ) = mem:: transmute ( self ) ;
133
131
WasmSlice {
@@ -151,11 +149,10 @@ unsafe extern "C" fn invoke1_ref<A: RefFromWasmAbi, R: ReturnWasmAbi>(
151
149
// ensure they're all destroyed as `return_abi` may throw
152
150
let ret = {
153
151
let f: & dyn Fn ( & A ) -> R = mem:: transmute ( ( a, b) ) ;
154
- let mut _stack = GlobalStack :: new ( ) ;
155
- let arg = <A as RefFromWasmAbi >:: ref_from_abi ( arg, & mut _stack) ;
152
+ let arg = <A as RefFromWasmAbi >:: ref_from_abi ( arg) ;
156
153
f ( & * arg)
157
154
} ;
158
- ret. return_abi ( & mut GlobalStack :: new ( ) )
155
+ ret. return_abi ( )
159
156
}
160
157
161
158
impl < ' a , A , R > WasmDescribe for dyn Fn ( & A ) -> R + ' a
@@ -179,7 +176,7 @@ where
179
176
{
180
177
type Abi = WasmSlice ;
181
178
182
- fn into_abi ( self , _extra : & mut dyn Stack ) -> WasmSlice {
179
+ fn into_abi ( self ) -> WasmSlice {
183
180
unsafe {
184
181
let ( a, b) : ( usize , usize ) = mem:: transmute ( self ) ;
185
182
WasmSlice {
@@ -203,11 +200,10 @@ unsafe extern "C" fn invoke1_mut_ref<A: RefFromWasmAbi, R: ReturnWasmAbi>(
203
200
// ensure they're all destroyed as `return_abi` may throw
204
201
let ret = {
205
202
let f: & mut dyn FnMut ( & A ) -> R = mem:: transmute ( ( a, b) ) ;
206
- let mut _stack = GlobalStack :: new ( ) ;
207
- let arg = <A as RefFromWasmAbi >:: ref_from_abi ( arg, & mut _stack) ;
203
+ let arg = <A as RefFromWasmAbi >:: ref_from_abi ( arg) ;
208
204
f ( & * arg)
209
205
} ;
210
- ret. return_abi ( & mut GlobalStack :: new ( ) )
206
+ ret. return_abi ( )
211
207
}
212
208
213
209
impl < ' a , A , R > WasmDescribe for dyn FnMut ( & A ) -> R + ' a
0 commit comments