@@ -91,14 +91,14 @@ addToLibrary({
9191#endif
9292 ] ,
9393 $_wasmWorkerInitializeRuntime : ( ) => {
94- let m = Module ;
9594#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 ) ;
9999#endif
100100#if RUNTIME_DEBUG
101- dbg ( "wasmWorkerInitializeRuntime $ww :" , m [ '$ww' ] ) ;
101+ dbg ( "wasmWorkerInitializeRuntime wwID :" , wwParams . wwID ) ;
102102#endif
103103
104104#if ! MINIMAL_RUNTIME && isSymbolNeeded ( '$noExitRuntime' )
@@ -113,11 +113,12 @@ addToLibrary({
113113 // already exists". So for now, invoke this function from JS side. TODO:
114114 // remove this in the future. Note that this call is not exactly correct,
115115 // 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 ) ;
118119#endif
119120 // 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 ) ;
121122#if PTHREADS
122123 // Record the pthread configuration, and whether this Wasm Worker supports synchronous blocking in emscripten_futex_wait().
123124 // (regular Wasm Workers do, AudioWorklets don't)
@@ -198,15 +199,15 @@ if (ENVIRONMENT_IS_WASM_WORKER
198199 worker . postMessage ( {
199200 // Signal with a non-zero value that this Worker will be a Wasm Worker,
200201 // and not the main browser thread.
201- '$ww' : _wasmWorkersID ,
202+ wwID : _wasmWorkersID ,
202203#if MINIMAL_RUNTIME
203- ' wasm' : Module [ 'wasm' ] ,
204+ wasm : Module [ 'wasm' ] ,
204205#else
205- ' wasm' : wasmModule ,
206+ wasm : wasmModule ,
206207#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
210211 } ) ;
211212 worker . onmessage = _wasmWorkerRunPostMessage ;
212213#if ENVIRONMENT_MAY_BE_NODE
@@ -244,7 +245,7 @@ if (ENVIRONMENT_IS_WASM_WORKER
244245#endif
245246 } ,
246247
247- emscripten_wasm_worker_self_id : ( ) => Module [ '$ww' ] ,
248+ emscripten_wasm_worker_self_id : ( ) => wwParams ?. wwID ,
248249
249250 emscripten_wasm_worker_post_function_v : ( id , funcPtr ) => {
250251 _wasmWorkers [ id ] . postMessage ( { '_wsc' : funcPtr , 'x' : [ ] } ) ; // "WaSm Call"
0 commit comments