virtual-machine 0.0.31 → 0.0.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -74,3 +74,4 @@ cargo build --release
74
74
  wasm-pack build --target web
75
75
  ```
76
76
 
77
+
@@ -206,18 +206,25 @@ if (!("encodeInto" in cachedTextEncoder)) {
206
206
  };
207
207
  }
208
208
  var WASM_VECTOR_LEN = 0;
209
- function wasm_bindgen__convert__closures_____invoke__h5a9b831ab69bf07a(arg0, arg1) {
210
- wasm.wasm_bindgen__convert__closures_____invoke__h5a9b831ab69bf07a(arg0, arg1);
211
- }
212
- function wasm_bindgen__convert__closures_____invoke__hc493fd296d4613a9(arg0, arg1) {
213
- wasm.wasm_bindgen__convert__closures_____invoke__hc493fd296d4613a9(arg0, arg1);
209
+ function wasm_bindgen__convert__closures_____invoke__hbde9876d0cea708c(arg0, arg1, arg2) {
210
+ wasm.wasm_bindgen__convert__closures_____invoke__hbde9876d0cea708c(arg0, arg1, arg2);
214
211
  }
215
212
  function wasm_bindgen__convert__closures_____invoke__h39d3e89751b07765(arg0, arg1, arg2) {
216
213
  wasm.wasm_bindgen__convert__closures_____invoke__h39d3e89751b07765(arg0, arg1, arg2);
217
214
  }
215
+ function wasm_bindgen__convert__closures_____invoke__he7a35327fb096d07(arg0, arg1) {
216
+ wasm.wasm_bindgen__convert__closures_____invoke__he7a35327fb096d07(arg0, arg1);
217
+ }
218
+ function wasm_bindgen__convert__closures_____invoke__h749506e285e0c000(arg0, arg1) {
219
+ wasm.wasm_bindgen__convert__closures_____invoke__h749506e285e0c000(arg0, arg1);
220
+ }
221
+ var __wbindgen_enum_WorkerType = ["classic", "module"];
218
222
  var WasmVmFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
219
223
  }, unregister: () => {
220
224
  } } : new FinalizationRegistry((ptr) => wasm.__wbg_wasmvm_free(ptr >>> 0, 1));
225
+ var WorkerStateFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
226
+ }, unregister: () => {
227
+ } } : new FinalizationRegistry((ptr) => wasm.__wbg_workerstate_free(ptr >>> 0, 1));
221
228
  var NetworkStatus = Object.freeze({
222
229
  Disconnected: 0,
223
230
  "0": "Disconnected",
@@ -228,7 +235,14 @@ var NetworkStatus = Object.freeze({
228
235
  Error: 3,
229
236
  "3": "Error"
230
237
  });
231
- var WasmVm = class {
238
+ var WasmVm = class _WasmVm {
239
+ static __wrap(ptr) {
240
+ ptr = ptr >>> 0;
241
+ const obj = Object.create(_WasmVm.prototype);
242
+ obj.__wbg_ptr = ptr;
243
+ WasmVmFinalization.register(obj, obj.__wbg_ptr, obj);
244
+ return obj;
245
+ }
232
246
  __destroy_into_raw() {
233
247
  const ptr = this.__wbg_ptr;
234
248
  this.__wbg_ptr = 0;
@@ -241,6 +255,9 @@ var WasmVm = class {
241
255
  }
242
256
  /**
243
257
  * Get a byte from the UART output buffer, if available.
258
+ *
259
+ * In SMP mode, this checks both the shared UART output buffer (for worker output)
260
+ * and the local UART buffer (for hart 0 output).
244
261
  * @returns {number | undefined}
245
262
  */
246
263
  get_output() {
@@ -263,6 +280,24 @@ var WasmVm = class {
263
280
  const len0 = WASM_VECTOR_LEN;
264
281
  wasm.wasmvm_print_status(this.__wbg_ptr, ptr0, len0);
265
282
  }
283
+ /**
284
+ * Start worker threads for secondary harts (1..num_harts).
285
+ *
286
+ * Workers run in parallel with the main thread, sharing DRAM and CLINT
287
+ * via SharedArrayBuffer.
288
+ *
289
+ * # Arguments
290
+ * * `worker_url` - URL to the worker script (e.g., "/worker.js")
291
+ * @param {string} worker_url
292
+ */
293
+ start_workers(worker_url) {
294
+ const ptr0 = passStringToWasm0(worker_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
295
+ const len0 = WASM_VECTOR_LEN;
296
+ const ret = wasm.wasmvm_start_workers(this.__wbg_ptr, ptr0, len0);
297
+ if (ret[1]) {
298
+ throw takeFromExternrefTable0(ret[0]);
299
+ }
300
+ }
266
301
  /**
267
302
  * Get the current network connection status.
268
303
  * This checks the actual connection state by seeing if an IP was assigned.
@@ -272,6 +307,25 @@ var WasmVm = class {
272
307
  const ret = wasm.wasmvm_network_status(this.__wbg_ptr);
273
308
  return ret;
274
309
  }
310
+ /**
311
+ * Create a new VM instance with a specified number of harts.
312
+ *
313
+ * # Arguments
314
+ * * `kernel` - ELF kernel binary
315
+ * * `num_harts` - Number of harts (0 = auto-detect)
316
+ * @param {Uint8Array} kernel
317
+ * @param {number} num_harts
318
+ * @returns {WasmVm}
319
+ */
320
+ static new_with_harts(kernel, num_harts) {
321
+ const ptr0 = passArray8ToWasm0(kernel, wasm.__wbindgen_malloc);
322
+ const len0 = WASM_VECTOR_LEN;
323
+ const ret = wasm.wasmvm_new_with_harts(ptr0, len0, num_harts);
324
+ if (ret[2]) {
325
+ throw takeFromExternrefTable0(ret[1]);
326
+ }
327
+ return _WasmVm.__wrap(ret[0]);
328
+ }
275
329
  /**
276
330
  * Get current memory usage (DRAM size) in bytes.
277
331
  * @returns {bigint}
@@ -280,6 +334,21 @@ var WasmVm = class {
280
334
  const ret = wasm.wasmvm_get_memory_usage(this.__wbg_ptr);
281
335
  return BigInt.asUintN(64, ret);
282
336
  }
337
+ /**
338
+ * Get the SharedArrayBuffer for external worker management.
339
+ * Returns None if not in SMP mode.
340
+ * @returns {SharedArrayBuffer | undefined}
341
+ */
342
+ get_shared_buffer() {
343
+ const ret = wasm.wasmvm_get_shared_buffer(this.__wbg_ptr);
344
+ return ret;
345
+ }
346
+ /**
347
+ * Terminate all workers.
348
+ */
349
+ terminate_workers() {
350
+ wasm.wasmvm_terminate_workers(this.__wbg_ptr);
351
+ }
283
352
  /**
284
353
  * Disconnect from the network.
285
354
  */
@@ -311,8 +380,90 @@ var WasmVm = class {
311
380
  throw takeFromExternrefTable0(ret[0]);
312
381
  }
313
382
  }
383
+ /**
384
+ * Inject a network packet to be received by the guest.
385
+ * Called from JavaScript when the native WebTransport addon receives a packet.
386
+ * @param {Uint8Array} packet
387
+ * @returns {boolean}
388
+ */
389
+ inject_network_packet(packet) {
390
+ const ret = wasm.wasmvm_inject_network_packet(this.__wbg_ptr, packet);
391
+ return ret !== 0;
392
+ }
393
+ /**
394
+ * Extract a network packet sent by the guest.
395
+ * Returns the packet data or null if no packet is pending.
396
+ * @returns {Uint8Array | undefined}
397
+ */
398
+ extract_network_packet() {
399
+ const ret = wasm.wasmvm_extract_network_packet(this.__wbg_ptr);
400
+ return ret;
401
+ }
402
+ /**
403
+ * Set up an external network backend for packet bridging.
404
+ * This is used by the Node.js CLI to bridge packets between the native
405
+ * WebTransport addon and the WASM VM.
406
+ *
407
+ * @param mac_bytes - MAC address as 6 bytes [0x52, 0x54, 0x00, 0x12, 0x34, 0x56]
408
+ * @param {Uint8Array} mac_bytes
409
+ */
410
+ setup_external_network(mac_bytes) {
411
+ const ret = wasm.wasmvm_setup_external_network(this.__wbg_ptr, mac_bytes);
412
+ if (ret[1]) {
413
+ throw takeFromExternrefTable0(ret[0]);
414
+ }
415
+ }
416
+ /**
417
+ * Set the assigned IP address for the external network.
418
+ * Called when the native WebTransport addon receives an IP assignment.
419
+ * @param {Uint8Array} ip_bytes
420
+ * @returns {boolean}
421
+ */
422
+ set_external_network_ip(ip_bytes) {
423
+ const ret = wasm.wasmvm_set_external_network_ip(this.__wbg_ptr, ip_bytes);
424
+ return ret !== 0;
425
+ }
426
+ /**
427
+ * Get the number of pending RX packets.
428
+ * @returns {number}
429
+ */
430
+ external_network_rx_pending() {
431
+ const ret = wasm.wasmvm_external_network_rx_pending(this.__wbg_ptr);
432
+ return ret >>> 0;
433
+ }
434
+ /**
435
+ * Get the number of pending TX packets.
436
+ * @returns {number}
437
+ */
438
+ external_network_tx_pending() {
439
+ const ret = wasm.wasmvm_external_network_tx_pending(this.__wbg_ptr);
440
+ return ret >>> 0;
441
+ }
442
+ /**
443
+ * Extract all pending network packets sent by the guest.
444
+ * Returns an array of packet data.
445
+ * @returns {Array<any>}
446
+ */
447
+ extract_all_network_packets() {
448
+ const ret = wasm.wasmvm_extract_all_network_packets(this.__wbg_ptr);
449
+ return ret;
450
+ }
451
+ /**
452
+ * Check if external network is connected (has IP assigned).
453
+ * @returns {boolean}
454
+ */
455
+ is_external_network_connected() {
456
+ const ret = wasm.wasmvm_is_external_network_connected(this.__wbg_ptr);
457
+ return ret !== 0;
458
+ }
314
459
  /**
315
460
  * Create a new VM instance and load a kernel (ELF or raw binary).
461
+ *
462
+ * If SharedArrayBuffer is available, the VM will use true parallel
463
+ * execution with Web Workers. Otherwise, falls back to single-threaded mode.
464
+ *
465
+ * Hart count is auto-detected as half of hardware_concurrency.
466
+ * Use `new_with_harts()` to specify a custom hart count.
316
467
  * @param {Uint8Array} kernel
317
468
  */
318
469
  constructor(kernel) {
@@ -327,7 +478,11 @@ var WasmVm = class {
327
478
  return this;
328
479
  }
329
480
  /**
330
- * Execute one instruction on each CPU (round-robin).
481
+ * Execute one instruction on hart 0 (primary hart).
482
+ *
483
+ * In SMP mode, secondary harts run in Web Workers and execute in parallel.
484
+ * This method only steps hart 0, which handles I/O coordination.
485
+ *
331
486
  * Returns true if the VM is still running, false if halted.
332
487
  * @returns {boolean}
333
488
  */
@@ -337,11 +492,20 @@ var WasmVm = class {
337
492
  }
338
493
  /**
339
494
  * Push an input byte to the UART.
495
+ * In SMP mode, this also writes to the shared input buffer so workers can receive it.
340
496
  * @param {number} byte
341
497
  */
342
498
  input(byte) {
343
499
  wasm.wasmvm_input(this.__wbg_ptr, byte);
344
500
  }
501
+ /**
502
+ * Check if running in SMP mode (with workers).
503
+ * @returns {boolean}
504
+ */
505
+ is_smp() {
506
+ const ret = wasm.wasmvm_is_smp(this.__wbg_ptr);
507
+ return ret !== 0;
508
+ }
345
509
  /**
346
510
  * Execute up to N instructions in a batch.
347
511
  * Returns the number of instructions actually executed.
@@ -381,8 +545,98 @@ var WasmVm = class {
381
545
  const len0 = WASM_VECTOR_LEN;
382
546
  wasm.wasmvm_load_disk(this.__wbg_ptr, ptr0, len0);
383
547
  }
548
+ /**
549
+ * Get the number of harts configured.
550
+ * @returns {number}
551
+ */
552
+ num_harts() {
553
+ const ret = wasm.wasmvm_num_harts(this.__wbg_ptr);
554
+ return ret >>> 0;
555
+ }
384
556
  };
385
557
  if (Symbol.dispose) WasmVm.prototype[Symbol.dispose] = WasmVm.prototype.free;
558
+ var WorkerState = class {
559
+ __destroy_into_raw() {
560
+ const ptr = this.__wbg_ptr;
561
+ this.__wbg_ptr = 0;
562
+ WorkerStateFinalization.unregister(this);
563
+ return ptr;
564
+ }
565
+ free() {
566
+ const ptr = this.__destroy_into_raw();
567
+ wasm.__wbg_workerstate_free(ptr, 0);
568
+ }
569
+ /**
570
+ * Execute a batch of instructions and return.
571
+ *
572
+ * This is designed to be called repeatedly from JavaScript, allowing
573
+ * the event loop to yield between batches. This prevents the worker
574
+ * from blocking indefinitely and allows it to respond to messages.
575
+ *
576
+ * Returns a WorkerStepResult indicating whether to continue, halt, etc.
577
+ * @param {number} batch_size
578
+ * @returns {WorkerStepResult}
579
+ */
580
+ step_batch(batch_size) {
581
+ const ret = wasm.workerstate_step_batch(this.__wbg_ptr, batch_size);
582
+ return ret;
583
+ }
584
+ /**
585
+ * Get the total step count.
586
+ * @returns {bigint}
587
+ */
588
+ step_count() {
589
+ const ret = wasm.workerstate_step_count(this.__wbg_ptr);
590
+ return BigInt.asUintN(64, ret);
591
+ }
592
+ /**
593
+ * Create a new worker state for a secondary hart.
594
+ * @param {number} hart_id
595
+ * @param {any} shared_mem
596
+ * @param {bigint} entry_pc
597
+ */
598
+ constructor(hart_id, shared_mem, entry_pc) {
599
+ const ret = wasm.workerstate_new(hart_id, shared_mem, entry_pc);
600
+ this.__wbg_ptr = ret >>> 0;
601
+ WorkerStateFinalization.register(this, this.__wbg_ptr, this);
602
+ return this;
603
+ }
604
+ /**
605
+ * Get the hart ID.
606
+ * @returns {number}
607
+ */
608
+ hart_id() {
609
+ const ret = wasm.workerstate_hart_id(this.__wbg_ptr);
610
+ return ret >>> 0;
611
+ }
612
+ };
613
+ if (Symbol.dispose) WorkerState.prototype[Symbol.dispose] = WorkerState.prototype.free;
614
+ var WorkerStepResult = Object.freeze({
615
+ /**
616
+ * Continue executing - call step_batch again
617
+ */
618
+ Continue: 0,
619
+ "0": "Continue",
620
+ /**
621
+ * Halt requested via control region
622
+ */
623
+ Halted: 1,
624
+ "1": "Halted",
625
+ /**
626
+ * Shutdown requested by guest (RequestedTrap)
627
+ */
628
+ Shutdown: 2,
629
+ "2": "Shutdown",
630
+ /**
631
+ * Fatal error occurred
632
+ */
633
+ Error: 3,
634
+ "3": "Error"
635
+ });
636
+ function worker_check_interrupts(hart_id, shared_mem) {
637
+ const ret = wasm.worker_check_interrupts(hart_id, shared_mem);
638
+ return BigInt.asUintN(64, ret);
639
+ }
386
640
  function worker_entry(hart_id, shared_mem, entry_pc) {
387
641
  wasm.worker_entry(hart_id, shared_mem, entry_pc);
388
642
  }
@@ -441,12 +695,32 @@ function __wbg_get_imports() {
441
695
  getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
442
696
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
443
697
  };
698
+ imports.wbg.__wbg___wbindgen_string_get_a2a31e16edf96e42 = function(arg0, arg1) {
699
+ const obj = arg1;
700
+ const ret = typeof obj === "string" ? obj : void 0;
701
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
702
+ var len1 = WASM_VECTOR_LEN;
703
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
704
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
705
+ };
444
706
  imports.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e = function(arg0, arg1) {
445
707
  throw new Error(getStringFromWasm0(arg0, arg1));
446
708
  };
447
709
  imports.wbg.__wbg__wbg_cb_unref_87dfb5aaa0cbcea7 = function(arg0) {
448
710
  arg0._wbg_cb_unref();
449
711
  };
712
+ imports.wbg.__wbg_add_e0e7f4f1ce6560fb = function() {
713
+ return handleError(function(arg0, arg1, arg2) {
714
+ const ret = Atomics.add(arg0, arg1 >>> 0, arg2);
715
+ return ret;
716
+ }, arguments);
717
+ };
718
+ imports.wbg.__wbg_and_fa6c2f8f864f1aed = function() {
719
+ return handleError(function(arg0, arg1, arg2) {
720
+ const ret = Atomics.and(arg0, arg1 >>> 0, arg2);
721
+ return ret;
722
+ }, arguments);
723
+ };
450
724
  imports.wbg.__wbg_byteLength_05cd8538d8f5f592 = function(arg0) {
451
725
  const ret = arg0.byteLength;
452
726
  return ret;
@@ -469,6 +743,16 @@ function __wbg_get_imports() {
469
743
  return ret;
470
744
  }, arguments);
471
745
  };
746
+ imports.wbg.__wbg_compareExchange_a2a167681b69cf6f = function() {
747
+ return handleError(function(arg0, arg1, arg2, arg3) {
748
+ const ret = Atomics.compareExchange(arg0, arg1 >>> 0, arg2, arg3);
749
+ return ret;
750
+ }, arguments);
751
+ };
752
+ imports.wbg.__wbg_data_8bf4ae669a78a688 = function(arg0) {
753
+ const ret = arg0.data;
754
+ return ret;
755
+ };
472
756
  imports.wbg.__wbg_datagrams_05d12f8029dbc662 = function(arg0) {
473
757
  const ret = arg0.datagrams;
474
758
  return ret;
@@ -487,6 +771,12 @@ function __wbg_get_imports() {
487
771
  imports.wbg.__wbg_error_7bc7d576a6aaf855 = function(arg0) {
488
772
  console.error(arg0);
489
773
  };
774
+ imports.wbg.__wbg_exchange_898093407427f4fd = function() {
775
+ return handleError(function(arg0, arg1, arg2) {
776
+ const ret = Atomics.exchange(arg0, arg1 >>> 0, arg2);
777
+ return ret;
778
+ }, arguments);
779
+ };
490
780
  imports.wbg.__wbg_fill_508dd108a821ee20 = function(arg0, arg1, arg2, arg3) {
491
781
  const ret = arg0.fill(arg1, arg2 >>> 0, arg3 >>> 0);
492
782
  return ret;
@@ -499,10 +789,6 @@ function __wbg_get_imports() {
499
789
  const ret = arg0.getUint16(arg1 >>> 0, arg2 !== 0);
500
790
  return ret;
501
791
  };
502
- imports.wbg.__wbg_getUint32_d3b8478c9340d38b = function(arg0, arg1, arg2) {
503
- const ret = arg0.getUint32(arg1 >>> 0, arg2 !== 0);
504
- return ret;
505
- };
506
792
  imports.wbg.__wbg_getUint8_f42915a9262518eb = function(arg0, arg1) {
507
793
  const ret = arg0.getUint8(arg1 >>> 0);
508
794
  return ret;
@@ -519,6 +805,10 @@ function __wbg_get_imports() {
519
805
  return ret;
520
806
  }, arguments);
521
807
  };
808
+ imports.wbg.__wbg_get_index_4e7b3f629a0ab9cd = function(arg0, arg1) {
809
+ const ret = arg0[arg1 >>> 0];
810
+ return ret;
811
+ };
522
812
  imports.wbg.__wbg_hardwareConcurrency_11023a850a093b20 = function(arg0) {
523
813
  const ret = arg0.hardwareConcurrency;
524
814
  return ret;
@@ -582,6 +872,20 @@ function __wbg_get_imports() {
582
872
  const ret = new Function(getStringFromWasm0(arg0, arg1));
583
873
  return ret;
584
874
  };
875
+ imports.wbg.__wbg_new_with_byte_offset_and_length_d85c3da1fd8df149 = function(arg0, arg1, arg2) {
876
+ const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
877
+ return ret;
878
+ };
879
+ imports.wbg.__wbg_new_with_length_aa5eaf41d35235e5 = function(arg0) {
880
+ const ret = new Uint8Array(arg0 >>> 0);
881
+ return ret;
882
+ };
883
+ imports.wbg.__wbg_new_with_options_2978557c2c268ef3 = function() {
884
+ return handleError(function(arg0, arg1, arg2) {
885
+ const ret = new Worker(getStringFromWasm0(arg0, arg1), arg2);
886
+ return ret;
887
+ }, arguments);
888
+ };
585
889
  imports.wbg.__wbg_new_with_options_661ae023a99756d4 = function() {
586
890
  return handleError(function(arg0, arg1, arg2) {
587
891
  const ret = new WebTransport(getStringFromWasm0(arg0, arg1), arg2);
@@ -598,6 +902,17 @@ function __wbg_get_imports() {
598
902
  return ret;
599
903
  }, arguments);
600
904
  };
905
+ imports.wbg.__wbg_or_eb11de0669782b52 = function() {
906
+ return handleError(function(arg0, arg1, arg2) {
907
+ const ret = Atomics.or(arg0, arg1 >>> 0, arg2);
908
+ return ret;
909
+ }, arguments);
910
+ };
911
+ imports.wbg.__wbg_postMessage_07504dbe15265d5c = function() {
912
+ return handleError(function(arg0, arg1) {
913
+ arg0.postMessage(arg1);
914
+ }, arguments);
915
+ };
601
916
  imports.wbg.__wbg_prototypesetcall_dfe9b766cdc1f1fd = function(arg0, arg1, arg2) {
602
917
  Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
603
918
  };
@@ -635,21 +950,36 @@ function __wbg_get_imports() {
635
950
  imports.wbg.__wbg_setUint16_ff3205ca61800a91 = function(arg0, arg1, arg2, arg3) {
636
951
  arg0.setUint16(arg1 >>> 0, arg2, arg3 !== 0);
637
952
  };
638
- imports.wbg.__wbg_setUint32_3590d6adecfd0c9a = function(arg0, arg1, arg2, arg3) {
639
- arg0.setUint32(arg1 >>> 0, arg2 >>> 0, arg3 !== 0);
640
- };
641
953
  imports.wbg.__wbg_setUint8_71dd48d3e18e4e40 = function(arg0, arg1, arg2) {
642
954
  arg0.setUint8(arg1 >>> 0, arg2);
643
955
  };
956
+ imports.wbg.__wbg_set_169e13b608078b7b = function(arg0, arg1, arg2) {
957
+ arg0.set(getArrayU8FromWasm0(arg1, arg2));
958
+ };
959
+ imports.wbg.__wbg_set_781438a03c0c3c81 = function() {
960
+ return handleError(function(arg0, arg1, arg2) {
961
+ const ret = Reflect.set(arg0, arg1, arg2);
962
+ return ret;
963
+ }, arguments);
964
+ };
644
965
  imports.wbg.__wbg_set_algorithm_f5b9d6dae15e63e3 = function(arg0, arg1, arg2) {
645
966
  arg0.algorithm = getStringFromWasm0(arg1, arg2);
646
967
  };
647
968
  imports.wbg.__wbg_set_bc3a432bdcd60886 = function(arg0, arg1, arg2) {
648
969
  arg0.set(arg1, arg2 >>> 0);
649
970
  };
971
+ imports.wbg.__wbg_set_index_04c4b93e64d08a52 = function(arg0, arg1, arg2) {
972
+ arg0[arg1 >>> 0] = arg2;
973
+ };
974
+ imports.wbg.__wbg_set_onmessage_deb94985de696ac7 = function(arg0, arg1) {
975
+ arg0.onmessage = arg1;
976
+ };
650
977
  imports.wbg.__wbg_set_server_certificate_hashes_d12c95e03a45bcd5 = function(arg0, arg1) {
651
978
  arg0.serverCertificateHashes = arg1;
652
979
  };
980
+ imports.wbg.__wbg_set_type_c2eb2929316959f4 = function(arg0, arg1) {
981
+ arg0.type = __wbindgen_enum_WorkerType[arg1];
982
+ };
653
983
  imports.wbg.__wbg_set_value_3371f9dc48a34104 = function(arg0, arg1) {
654
984
  arg0.value = arg1;
655
985
  };
@@ -682,6 +1012,9 @@ function __wbg_get_imports() {
682
1012
  return ret;
683
1013
  }, arguments);
684
1014
  };
1015
+ imports.wbg.__wbg_terminate_08a1236dd2e69da0 = function(arg0) {
1016
+ arg0.terminate();
1017
+ };
685
1018
  imports.wbg.__wbg_then_429f7caf1026411d = function(arg0, arg1, arg2) {
686
1019
  const ret = arg0.then(arg1, arg2);
687
1020
  return ret;
@@ -701,12 +1034,14 @@ function __wbg_get_imports() {
701
1034
  const ret = arg0.write(arg1);
702
1035
  return ret;
703
1036
  };
704
- imports.wbg.__wbindgen_cast_0268c24e8eb79d38 = function(arg0, arg1) {
705
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h101a38767d457860, wasm_bindgen__convert__closures_____invoke__h5a9b831ab69bf07a);
706
- return ret;
1037
+ imports.wbg.__wbg_xor_5e9be92d2e01a692 = function() {
1038
+ return handleError(function(arg0, arg1, arg2) {
1039
+ const ret = Atomics.xor(arg0, arg1 >>> 0, arg2);
1040
+ return ret;
1041
+ }, arguments);
707
1042
  };
708
- imports.wbg.__wbindgen_cast_0de0c044529fd48a = function(arg0, arg1) {
709
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__hf225e18fc5ab9bc1, wasm_bindgen__convert__closures_____invoke__h39d3e89751b07765);
1043
+ imports.wbg.__wbindgen_cast_0268c24e8eb79d38 = function(arg0, arg1) {
1044
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h1a8abd1a91785820, wasm_bindgen__convert__closures_____invoke__he7a35327fb096d07);
710
1045
  return ret;
711
1046
  };
712
1047
  imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
@@ -714,13 +1049,21 @@ function __wbg_get_imports() {
714
1049
  return ret;
715
1050
  };
716
1051
  imports.wbg.__wbindgen_cast_4ee4ae87c307a33c = function(arg0, arg1) {
717
- const ret = makeClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h101a38767d457860, wasm_bindgen__convert__closures_____invoke__hc493fd296d4613a9);
1052
+ const ret = makeClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h1a8abd1a91785820, wasm_bindgen__convert__closures_____invoke__h749506e285e0c000);
1053
+ return ret;
1054
+ };
1055
+ imports.wbg.__wbindgen_cast_705cb87c37628e08 = function(arg0, arg1) {
1056
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h1a8abd1a91785820, wasm_bindgen__convert__closures_____invoke__hbde9876d0cea708c);
718
1057
  return ret;
719
1058
  };
720
1059
  imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
721
1060
  const ret = arg0;
722
1061
  return ret;
723
1062
  };
1063
+ imports.wbg.__wbindgen_cast_f1c9170db27db6a8 = function(arg0, arg1) {
1064
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__hf225e18fc5ab9bc1, wasm_bindgen__convert__closures_____invoke__h39d3e89751b07765);
1065
+ return ret;
1066
+ };
724
1067
  imports.wbg.__wbindgen_init_externref_table = function() {
725
1068
  const table = wasm.__wbindgen_externrefs;
726
1069
  const offset = table.grow(4);
@@ -777,6 +1120,9 @@ var riscv_vm_default = __wbg_init;
777
1120
  export {
778
1121
  NetworkStatus,
779
1122
  WasmVm,
1123
+ WorkerState,
1124
+ WorkerStepResult,
1125
+ worker_check_interrupts,
780
1126
  worker_entry,
781
1127
  initSync,
782
1128
  riscv_vm_default