@@ -60,65 +60,52 @@ mergeInto(LibraryManager.library, {
60
60
// WASM_BIGINT so the pointer is just a single argument, just like in
61
61
// wasm32).
62
62
_wasmfs_jsimpl_async_alloc_file__deps : [ '$runtimeKeepalivePush' , '$runtimeKeepalivePop' ] ,
63
- _wasmfs_jsimpl_async_alloc_file : async function ( backend , file , fptr , arg ) {
63
+ _wasmfs_jsimpl_async_alloc_file : async function ( ctx , backend , file ) {
64
64
#if ASSERTIONS
65
65
assert ( wasmFS$backends [ backend ] ) ;
66
66
#endif
67
- { { { runtimeKeepalivePush ( ) } } }
68
67
await wasmFS$backends [ backend ] . allocFile ( file ) ;
69
- { { { runtimeKeepalivePop ( ) } } }
70
- { { { makeDynCall ( 'vi' , 'fptr' ) } } } ( arg ) ;
68
+ _emscripten_proxy_finish ( ctx ) ;
71
69
} ,
72
70
73
71
_wasmfs_jsimpl_async_free_file__deps : [ '$runtimeKeepalivePush' , '$runtimeKeepalivePop' ] ,
74
- _wasmfs_jsimpl_async_free_file : async function ( backend , file , fptr , arg ) {
72
+ _wasmfs_jsimpl_async_free_file : async function ( ctx , backend , file ) {
75
73
#if ASSERTIONS
76
74
assert ( wasmFS$backends [ backend ] ) ;
77
75
#endif
78
- { { { runtimeKeepalivePush ( ) } } }
79
76
await wasmFS$backends [ backend ] . freeFile ( file ) ;
80
- { { { runtimeKeepalivePop ( ) } } }
81
- { { { makeDynCall ( 'vi' , 'fptr' ) } } } ( arg ) ;
77
+ _emscripten_proxy_finish ( ctx ) ;
82
78
} ,
83
79
84
80
_wasmfs_jsimpl_async_write__deps : [ '$runtimeKeepalivePush' , '$runtimeKeepalivePop' ] ,
85
- _wasmfs_jsimpl_async_write : async function ( backend , file , buffer , length , { { { defineI64Param ( 'offset' ) } } } , fptr , arg ) {
81
+ _wasmfs_jsimpl_async_write : async function ( ctx , backend , file , buffer , length , { { { defineI64Param ( 'offset' ) } } } , result_p ) {
86
82
{ { { receiveI64ParamAsDouble ( 'offset' ) } } }
87
83
#if ASSERTIONS
88
84
assert ( wasmFS$backends [ backend ] ) ;
89
85
#endif
90
- { { { runtimeKeepalivePush ( ) } } }
91
- var size = await wasmFS$backends [ backend ] . write ( file , buffer , length , offset ) ;
92
- { { { runtimeKeepalivePop ( ) } } }
93
- { { { makeSetValue ( 'arg' , C_STRUCTS . CallbackState . result , '0' , 'i32' ) } } } ;
94
- { { { makeSetValue ( 'arg' , C_STRUCTS . CallbackState . offset , 'size' , 'i64' ) } } } ;
95
- { { { makeDynCall ( 'vi' , 'fptr' ) } } } ( arg ) ;
86
+ var result = await wasmFS$backends [ backend ] . write ( file , buffer , length , offset ) ;
87
+ { { { makeSetValue ( 'result_p' , 0 , 'result' , 'i64' ) } } } ;
88
+ _emscripten_proxy_finish ( ctx ) ;
96
89
} ,
97
90
98
91
_wasmfs_jsimpl_async_read__deps : [ '$runtimeKeepalivePush' , '$runtimeKeepalivePop' ] ,
99
- _wasmfs_jsimpl_async_read : async function ( backend , file , buffer , length , { { { defineI64Param ( 'offset' ) } } } , fptr , arg ) {
92
+ _wasmfs_jsimpl_async_read : async function ( ctx , backend , file , buffer , length , { { { defineI64Param ( 'offset' ) } } } , result_p ) {
100
93
{ { { receiveI64ParamAsDouble ( 'offset' ) } } }
101
94
#if ASSERTIONS
102
95
assert ( wasmFS$backends [ backend ] ) ;
103
96
#endif
104
- { { { runtimeKeepalivePush ( ) } } }
105
- var size = await wasmFS$backends [ backend ] . read ( file , buffer , length , offset ) ;
106
- { { { runtimeKeepalivePop ( ) } } }
107
- { { { makeSetValue ( 'arg' , C_STRUCTS . CallbackState . result , '0' , 'i32' ) } } } ;
108
- { { { makeSetValue ( 'arg' , C_STRUCTS . CallbackState . offset , 'size' , 'i64' ) } } } ;
109
- { { { makeDynCall ( 'vi' , 'fptr' ) } } } ( arg ) ;
97
+ var result = await wasmFS$backends [ backend ] . read ( file , buffer , length , offset ) ;
98
+ { { { makeSetValue ( 'result_p' , 0 , 'result' , 'i32' ) } } } ;
99
+ _emscripten_proxy_finish ( ctx ) ;
110
100
} ,
111
101
112
102
_wasmfs_jsimpl_async_get_size__deps : [ '$runtimeKeepalivePush' , '$runtimeKeepalivePop' ] ,
113
- _wasmfs_jsimpl_async_get_size : async function ( backend , file , fptr , arg ) {
103
+ _wasmfs_jsimpl_async_get_size : async function ( ctx , backend , file , size_p ) {
114
104
#if ASSERTIONS
115
105
assert ( wasmFS$backends [ backend ] ) ;
116
106
#endif
117
- { { { runtimeKeepalivePush ( ) } } }
118
107
var size = await wasmFS$backends [ backend ] . getSize ( file ) ;
119
- { { { runtimeKeepalivePop ( ) } } }
120
- { { { makeSetValue ( 'arg' , C_STRUCTS . CallbackState . result , '0' , 'i32' ) } } } ;
121
- { { { makeSetValue ( 'arg' , C_STRUCTS . CallbackState . offset , 'size' , 'i64' ) } } } ;
122
- { { { makeDynCall ( 'vi' , 'fptr' ) } } } ( arg ) ;
108
+ { { { makeSetValue ( 'size_p' , 0 , 'size' , 'i64' ) } } } ;
109
+ _emscripten_proxy_finish ( ctx ) ;
123
110
} ,
124
111
} ) ;
0 commit comments