@@ -91,14 +91,14 @@ addToLibrary({
91
91
#endif
92
92
] ,
93
93
$_wasmWorkerInitializeRuntime : ( ) => {
94
- let m = Module ;
95
94
#if ASSERTIONS
96
- assert ( m && m [ '$ww' ] ) ;
97
- assert ( m [ 'sb' ] % 16 == 0 ) ;
98
- assert ( m [ 'sz' ] % 16 == 0 ) ;
95
+ assert ( wwParams ) ;
96
+ assert ( wwParams . wwID ) ;
97
+ assert ( wwParams . stackLowestAddress % 16 == 0 ) ;
98
+ assert ( wwParams . stackSize % 16 == 0 ) ;
99
99
#endif
100
100
#if RUNTIME_DEBUG
101
- dbg ( "wasmWorkerInitializeRuntime $ww :" , m [ '$ww' ] ) ;
101
+ dbg ( "wasmWorkerInitializeRuntime wwID :" , wwParams . wwID ) ;
102
102
#endif
103
103
104
104
#if ! MINIMAL_RUNTIME && isSymbolNeeded ( '$noExitRuntime' )
@@ -113,11 +113,12 @@ addToLibrary({
113
113
// already exists". So for now, invoke this function from JS side. TODO:
114
114
// remove this in the future. Note that this call is not exactly correct,
115
115
// since this limit will include the TLS slot, that will be part of the
116
- // region between m['sb'] and m['sz'], so we need to fix up the call below.
117
- ___set_stack_limits ( m [ 'sb' ] + m [ 'sz' ] , m [ 'sb' ] ) ;
116
+ // region between wwParams.stackLowestAddress and wwParams.stackSize, so we
117
+ // need to fix up the call below.
118
+ ___set_stack_limits ( wwParams . stackLowestAddress + wwParams . stackSize , wwParams . stackLowestAddress ) ;
118
119
#endif
119
120
// Run the C side Worker initialization for stack and TLS.
120
- __emscripten_wasm_worker_initialize ( m [ 'sb' ] , m [ 'sz' ] ) ;
121
+ __emscripten_wasm_worker_initialize ( wwParams . stackLowestAddress , wwParams . stackSize ) ;
121
122
#if PTHREADS
122
123
// Record the pthread configuration, and whether this Wasm Worker supports synchronous blocking in emscripten_futex_wait().
123
124
// (regular Wasm Workers do, AudioWorklets don't)
@@ -198,15 +199,15 @@ if (ENVIRONMENT_IS_WASM_WORKER
198
199
worker . postMessage ( {
199
200
// Signal with a non-zero value that this Worker will be a Wasm Worker,
200
201
// and not the main browser thread.
201
- '$ww' : _wasmWorkersID ,
202
+ wwID : _wasmWorkersID ,
202
203
#if MINIMAL_RUNTIME
203
- ' wasm' : Module [ 'wasm' ] ,
204
+ wasm : Module [ 'wasm' ] ,
204
205
#else
205
- ' wasm' : wasmModule ,
206
+ wasm : wasmModule ,
206
207
#endif
207
- 'mem' : wasmMemory ,
208
- 'sb' : stackLowestAddress , // sb = stack bottom (lowest stack address, SP points at this when stack is full)
209
- 'sz' : stackSize , // sz = stack size
208
+ wasmMemory,
209
+ stackLowestAddress, // sb = stack bottom (lowest stack address, SP points at this when stack is full)
210
+ stackSize, // sz = stack size
210
211
} ) ;
211
212
worker . onmessage = _wasmWorkerRunPostMessage ;
212
213
#if ENVIRONMENT_MAY_BE_NODE
@@ -244,7 +245,7 @@ if (ENVIRONMENT_IS_WASM_WORKER
244
245
#endif
245
246
} ,
246
247
247
- emscripten_wasm_worker_self_id : ( ) => Module [ '$ww' ] ,
248
+ emscripten_wasm_worker_self_id : ( ) => wwParams ?. wwID ,
248
249
249
250
emscripten_wasm_worker_post_function_v : ( id , funcPtr ) => {
250
251
_wasmWorkers [ id ] . postMessage ( { '_wsc' : funcPtr , 'x' : [ ] } ) ; // "WaSm Call"
0 commit comments