virtual-machine 0.0.31 → 0.0.32
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 +1 -0
- package/build/{chunk-CP2XF74Q.mjs → chunk-PD2KO7C4.mjs} +285 -22
- package/build/cli.js +518 -102
- package/build/index.d.ts +226 -14
- package/build/index.js +396 -29
- package/build/index.mjs +110 -8
- package/build/{riscv_vm-FJMOWX7R.mjs → riscv_vm-LL6COL52.mjs} +7 -1
- package/build/worker.js +249 -236
- package/package.json +1 -1
- package/build/worker.d.ts +0 -35
- package/build/worker.mjs +0 -54
package/README.md
CHANGED
|
@@ -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);
|
|
214
|
-
}
|
|
215
209
|
function wasm_bindgen__convert__closures_____invoke__h39d3e89751b07765(arg0, arg1, arg2) {
|
|
216
210
|
wasm.wasm_bindgen__convert__closures_____invoke__h39d3e89751b07765(arg0, arg1, arg2);
|
|
217
211
|
}
|
|
212
|
+
function wasm_bindgen__convert__closures_____invoke__h67573e759d30b522(arg0, arg1) {
|
|
213
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h67573e759d30b522(arg0, arg1);
|
|
214
|
+
}
|
|
215
|
+
function wasm_bindgen__convert__closures_____invoke__hb59a63b35a5a8674(arg0, arg1, arg2) {
|
|
216
|
+
wasm.wasm_bindgen__convert__closures_____invoke__hb59a63b35a5a8674(arg0, arg1, arg2);
|
|
217
|
+
}
|
|
218
|
+
function wasm_bindgen__convert__closures_____invoke__hf580618779cd5844(arg0, arg1) {
|
|
219
|
+
wasm.wasm_bindgen__convert__closures_____invoke__hf580618779cd5844(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
|
*/
|
|
@@ -313,6 +382,12 @@ var WasmVm = class {
|
|
|
313
382
|
}
|
|
314
383
|
/**
|
|
315
384
|
* Create a new VM instance and load a kernel (ELF or raw binary).
|
|
385
|
+
*
|
|
386
|
+
* If SharedArrayBuffer is available, the VM will use true parallel
|
|
387
|
+
* execution with Web Workers. Otherwise, falls back to single-threaded mode.
|
|
388
|
+
*
|
|
389
|
+
* Hart count is auto-detected as half of hardware_concurrency.
|
|
390
|
+
* Use `new_with_harts()` to specify a custom hart count.
|
|
316
391
|
* @param {Uint8Array} kernel
|
|
317
392
|
*/
|
|
318
393
|
constructor(kernel) {
|
|
@@ -327,7 +402,11 @@ var WasmVm = class {
|
|
|
327
402
|
return this;
|
|
328
403
|
}
|
|
329
404
|
/**
|
|
330
|
-
* Execute one instruction on
|
|
405
|
+
* Execute one instruction on hart 0 (primary hart).
|
|
406
|
+
*
|
|
407
|
+
* In SMP mode, secondary harts run in Web Workers and execute in parallel.
|
|
408
|
+
* This method only steps hart 0, which handles I/O coordination.
|
|
409
|
+
*
|
|
331
410
|
* Returns true if the VM is still running, false if halted.
|
|
332
411
|
* @returns {boolean}
|
|
333
412
|
*/
|
|
@@ -337,11 +416,20 @@ var WasmVm = class {
|
|
|
337
416
|
}
|
|
338
417
|
/**
|
|
339
418
|
* Push an input byte to the UART.
|
|
419
|
+
* In SMP mode, this also writes to the shared input buffer so workers can receive it.
|
|
340
420
|
* @param {number} byte
|
|
341
421
|
*/
|
|
342
422
|
input(byte) {
|
|
343
423
|
wasm.wasmvm_input(this.__wbg_ptr, byte);
|
|
344
424
|
}
|
|
425
|
+
/**
|
|
426
|
+
* Check if running in SMP mode (with workers).
|
|
427
|
+
* @returns {boolean}
|
|
428
|
+
*/
|
|
429
|
+
is_smp() {
|
|
430
|
+
const ret = wasm.wasmvm_is_smp(this.__wbg_ptr);
|
|
431
|
+
return ret !== 0;
|
|
432
|
+
}
|
|
345
433
|
/**
|
|
346
434
|
* Execute up to N instructions in a batch.
|
|
347
435
|
* Returns the number of instructions actually executed.
|
|
@@ -381,8 +469,98 @@ var WasmVm = class {
|
|
|
381
469
|
const len0 = WASM_VECTOR_LEN;
|
|
382
470
|
wasm.wasmvm_load_disk(this.__wbg_ptr, ptr0, len0);
|
|
383
471
|
}
|
|
472
|
+
/**
|
|
473
|
+
* Get the number of harts configured.
|
|
474
|
+
* @returns {number}
|
|
475
|
+
*/
|
|
476
|
+
num_harts() {
|
|
477
|
+
const ret = wasm.wasmvm_num_harts(this.__wbg_ptr);
|
|
478
|
+
return ret >>> 0;
|
|
479
|
+
}
|
|
384
480
|
};
|
|
385
481
|
if (Symbol.dispose) WasmVm.prototype[Symbol.dispose] = WasmVm.prototype.free;
|
|
482
|
+
var WorkerState = class {
|
|
483
|
+
__destroy_into_raw() {
|
|
484
|
+
const ptr = this.__wbg_ptr;
|
|
485
|
+
this.__wbg_ptr = 0;
|
|
486
|
+
WorkerStateFinalization.unregister(this);
|
|
487
|
+
return ptr;
|
|
488
|
+
}
|
|
489
|
+
free() {
|
|
490
|
+
const ptr = this.__destroy_into_raw();
|
|
491
|
+
wasm.__wbg_workerstate_free(ptr, 0);
|
|
492
|
+
}
|
|
493
|
+
/**
|
|
494
|
+
* Execute a batch of instructions and return.
|
|
495
|
+
*
|
|
496
|
+
* This is designed to be called repeatedly from JavaScript, allowing
|
|
497
|
+
* the event loop to yield between batches. This prevents the worker
|
|
498
|
+
* from blocking indefinitely and allows it to respond to messages.
|
|
499
|
+
*
|
|
500
|
+
* Returns a WorkerStepResult indicating whether to continue, halt, etc.
|
|
501
|
+
* @param {number} batch_size
|
|
502
|
+
* @returns {WorkerStepResult}
|
|
503
|
+
*/
|
|
504
|
+
step_batch(batch_size) {
|
|
505
|
+
const ret = wasm.workerstate_step_batch(this.__wbg_ptr, batch_size);
|
|
506
|
+
return ret;
|
|
507
|
+
}
|
|
508
|
+
/**
|
|
509
|
+
* Get the total step count.
|
|
510
|
+
* @returns {bigint}
|
|
511
|
+
*/
|
|
512
|
+
step_count() {
|
|
513
|
+
const ret = wasm.workerstate_step_count(this.__wbg_ptr);
|
|
514
|
+
return BigInt.asUintN(64, ret);
|
|
515
|
+
}
|
|
516
|
+
/**
|
|
517
|
+
* Create a new worker state for a secondary hart.
|
|
518
|
+
* @param {number} hart_id
|
|
519
|
+
* @param {any} shared_mem
|
|
520
|
+
* @param {bigint} entry_pc
|
|
521
|
+
*/
|
|
522
|
+
constructor(hart_id, shared_mem, entry_pc) {
|
|
523
|
+
const ret = wasm.workerstate_new(hart_id, shared_mem, entry_pc);
|
|
524
|
+
this.__wbg_ptr = ret >>> 0;
|
|
525
|
+
WorkerStateFinalization.register(this, this.__wbg_ptr, this);
|
|
526
|
+
return this;
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
* Get the hart ID.
|
|
530
|
+
* @returns {number}
|
|
531
|
+
*/
|
|
532
|
+
hart_id() {
|
|
533
|
+
const ret = wasm.workerstate_hart_id(this.__wbg_ptr);
|
|
534
|
+
return ret >>> 0;
|
|
535
|
+
}
|
|
536
|
+
};
|
|
537
|
+
if (Symbol.dispose) WorkerState.prototype[Symbol.dispose] = WorkerState.prototype.free;
|
|
538
|
+
var WorkerStepResult = Object.freeze({
|
|
539
|
+
/**
|
|
540
|
+
* Continue executing - call step_batch again
|
|
541
|
+
*/
|
|
542
|
+
Continue: 0,
|
|
543
|
+
"0": "Continue",
|
|
544
|
+
/**
|
|
545
|
+
* Halt requested via control region
|
|
546
|
+
*/
|
|
547
|
+
Halted: 1,
|
|
548
|
+
"1": "Halted",
|
|
549
|
+
/**
|
|
550
|
+
* Shutdown requested by guest (RequestedTrap)
|
|
551
|
+
*/
|
|
552
|
+
Shutdown: 2,
|
|
553
|
+
"2": "Shutdown",
|
|
554
|
+
/**
|
|
555
|
+
* Fatal error occurred
|
|
556
|
+
*/
|
|
557
|
+
Error: 3,
|
|
558
|
+
"3": "Error"
|
|
559
|
+
});
|
|
560
|
+
function worker_check_interrupts(hart_id, shared_mem) {
|
|
561
|
+
const ret = wasm.worker_check_interrupts(hart_id, shared_mem);
|
|
562
|
+
return BigInt.asUintN(64, ret);
|
|
563
|
+
}
|
|
386
564
|
function worker_entry(hart_id, shared_mem, entry_pc) {
|
|
387
565
|
wasm.worker_entry(hart_id, shared_mem, entry_pc);
|
|
388
566
|
}
|
|
@@ -441,12 +619,32 @@ function __wbg_get_imports() {
|
|
|
441
619
|
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
442
620
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
443
621
|
};
|
|
622
|
+
imports.wbg.__wbg___wbindgen_string_get_a2a31e16edf96e42 = function(arg0, arg1) {
|
|
623
|
+
const obj = arg1;
|
|
624
|
+
const ret = typeof obj === "string" ? obj : void 0;
|
|
625
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
626
|
+
var len1 = WASM_VECTOR_LEN;
|
|
627
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
628
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
629
|
+
};
|
|
444
630
|
imports.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e = function(arg0, arg1) {
|
|
445
631
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
446
632
|
};
|
|
447
633
|
imports.wbg.__wbg__wbg_cb_unref_87dfb5aaa0cbcea7 = function(arg0) {
|
|
448
634
|
arg0._wbg_cb_unref();
|
|
449
635
|
};
|
|
636
|
+
imports.wbg.__wbg_add_e0e7f4f1ce6560fb = function() {
|
|
637
|
+
return handleError(function(arg0, arg1, arg2) {
|
|
638
|
+
const ret = Atomics.add(arg0, arg1 >>> 0, arg2);
|
|
639
|
+
return ret;
|
|
640
|
+
}, arguments);
|
|
641
|
+
};
|
|
642
|
+
imports.wbg.__wbg_and_fa6c2f8f864f1aed = function() {
|
|
643
|
+
return handleError(function(arg0, arg1, arg2) {
|
|
644
|
+
const ret = Atomics.and(arg0, arg1 >>> 0, arg2);
|
|
645
|
+
return ret;
|
|
646
|
+
}, arguments);
|
|
647
|
+
};
|
|
450
648
|
imports.wbg.__wbg_byteLength_05cd8538d8f5f592 = function(arg0) {
|
|
451
649
|
const ret = arg0.byteLength;
|
|
452
650
|
return ret;
|
|
@@ -469,6 +667,16 @@ function __wbg_get_imports() {
|
|
|
469
667
|
return ret;
|
|
470
668
|
}, arguments);
|
|
471
669
|
};
|
|
670
|
+
imports.wbg.__wbg_compareExchange_a2a167681b69cf6f = function() {
|
|
671
|
+
return handleError(function(arg0, arg1, arg2, arg3) {
|
|
672
|
+
const ret = Atomics.compareExchange(arg0, arg1 >>> 0, arg2, arg3);
|
|
673
|
+
return ret;
|
|
674
|
+
}, arguments);
|
|
675
|
+
};
|
|
676
|
+
imports.wbg.__wbg_data_8bf4ae669a78a688 = function(arg0) {
|
|
677
|
+
const ret = arg0.data;
|
|
678
|
+
return ret;
|
|
679
|
+
};
|
|
472
680
|
imports.wbg.__wbg_datagrams_05d12f8029dbc662 = function(arg0) {
|
|
473
681
|
const ret = arg0.datagrams;
|
|
474
682
|
return ret;
|
|
@@ -487,6 +695,12 @@ function __wbg_get_imports() {
|
|
|
487
695
|
imports.wbg.__wbg_error_7bc7d576a6aaf855 = function(arg0) {
|
|
488
696
|
console.error(arg0);
|
|
489
697
|
};
|
|
698
|
+
imports.wbg.__wbg_exchange_898093407427f4fd = function() {
|
|
699
|
+
return handleError(function(arg0, arg1, arg2) {
|
|
700
|
+
const ret = Atomics.exchange(arg0, arg1 >>> 0, arg2);
|
|
701
|
+
return ret;
|
|
702
|
+
}, arguments);
|
|
703
|
+
};
|
|
490
704
|
imports.wbg.__wbg_fill_508dd108a821ee20 = function(arg0, arg1, arg2, arg3) {
|
|
491
705
|
const ret = arg0.fill(arg1, arg2 >>> 0, arg3 >>> 0);
|
|
492
706
|
return ret;
|
|
@@ -499,10 +713,6 @@ function __wbg_get_imports() {
|
|
|
499
713
|
const ret = arg0.getUint16(arg1 >>> 0, arg2 !== 0);
|
|
500
714
|
return ret;
|
|
501
715
|
};
|
|
502
|
-
imports.wbg.__wbg_getUint32_d3b8478c9340d38b = function(arg0, arg1, arg2) {
|
|
503
|
-
const ret = arg0.getUint32(arg1 >>> 0, arg2 !== 0);
|
|
504
|
-
return ret;
|
|
505
|
-
};
|
|
506
716
|
imports.wbg.__wbg_getUint8_f42915a9262518eb = function(arg0, arg1) {
|
|
507
717
|
const ret = arg0.getUint8(arg1 >>> 0);
|
|
508
718
|
return ret;
|
|
@@ -519,6 +729,10 @@ function __wbg_get_imports() {
|
|
|
519
729
|
return ret;
|
|
520
730
|
}, arguments);
|
|
521
731
|
};
|
|
732
|
+
imports.wbg.__wbg_get_index_4e7b3f629a0ab9cd = function(arg0, arg1) {
|
|
733
|
+
const ret = arg0[arg1 >>> 0];
|
|
734
|
+
return ret;
|
|
735
|
+
};
|
|
522
736
|
imports.wbg.__wbg_hardwareConcurrency_11023a850a093b20 = function(arg0) {
|
|
523
737
|
const ret = arg0.hardwareConcurrency;
|
|
524
738
|
return ret;
|
|
@@ -582,6 +796,16 @@ function __wbg_get_imports() {
|
|
|
582
796
|
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
583
797
|
return ret;
|
|
584
798
|
};
|
|
799
|
+
imports.wbg.__wbg_new_with_byte_offset_and_length_d85c3da1fd8df149 = function(arg0, arg1, arg2) {
|
|
800
|
+
const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
|
|
801
|
+
return ret;
|
|
802
|
+
};
|
|
803
|
+
imports.wbg.__wbg_new_with_options_2978557c2c268ef3 = function() {
|
|
804
|
+
return handleError(function(arg0, arg1, arg2) {
|
|
805
|
+
const ret = new Worker(getStringFromWasm0(arg0, arg1), arg2);
|
|
806
|
+
return ret;
|
|
807
|
+
}, arguments);
|
|
808
|
+
};
|
|
585
809
|
imports.wbg.__wbg_new_with_options_661ae023a99756d4 = function() {
|
|
586
810
|
return handleError(function(arg0, arg1, arg2) {
|
|
587
811
|
const ret = new WebTransport(getStringFromWasm0(arg0, arg1), arg2);
|
|
@@ -598,6 +822,17 @@ function __wbg_get_imports() {
|
|
|
598
822
|
return ret;
|
|
599
823
|
}, arguments);
|
|
600
824
|
};
|
|
825
|
+
imports.wbg.__wbg_or_eb11de0669782b52 = function() {
|
|
826
|
+
return handleError(function(arg0, arg1, arg2) {
|
|
827
|
+
const ret = Atomics.or(arg0, arg1 >>> 0, arg2);
|
|
828
|
+
return ret;
|
|
829
|
+
}, arguments);
|
|
830
|
+
};
|
|
831
|
+
imports.wbg.__wbg_postMessage_07504dbe15265d5c = function() {
|
|
832
|
+
return handleError(function(arg0, arg1) {
|
|
833
|
+
arg0.postMessage(arg1);
|
|
834
|
+
}, arguments);
|
|
835
|
+
};
|
|
601
836
|
imports.wbg.__wbg_prototypesetcall_dfe9b766cdc1f1fd = function(arg0, arg1, arg2) {
|
|
602
837
|
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
603
838
|
};
|
|
@@ -635,21 +870,33 @@ function __wbg_get_imports() {
|
|
|
635
870
|
imports.wbg.__wbg_setUint16_ff3205ca61800a91 = function(arg0, arg1, arg2, arg3) {
|
|
636
871
|
arg0.setUint16(arg1 >>> 0, arg2, arg3 !== 0);
|
|
637
872
|
};
|
|
638
|
-
imports.wbg.__wbg_setUint32_3590d6adecfd0c9a = function(arg0, arg1, arg2, arg3) {
|
|
639
|
-
arg0.setUint32(arg1 >>> 0, arg2 >>> 0, arg3 !== 0);
|
|
640
|
-
};
|
|
641
873
|
imports.wbg.__wbg_setUint8_71dd48d3e18e4e40 = function(arg0, arg1, arg2) {
|
|
642
874
|
arg0.setUint8(arg1 >>> 0, arg2);
|
|
643
875
|
};
|
|
876
|
+
imports.wbg.__wbg_set_781438a03c0c3c81 = function() {
|
|
877
|
+
return handleError(function(arg0, arg1, arg2) {
|
|
878
|
+
const ret = Reflect.set(arg0, arg1, arg2);
|
|
879
|
+
return ret;
|
|
880
|
+
}, arguments);
|
|
881
|
+
};
|
|
644
882
|
imports.wbg.__wbg_set_algorithm_f5b9d6dae15e63e3 = function(arg0, arg1, arg2) {
|
|
645
883
|
arg0.algorithm = getStringFromWasm0(arg1, arg2);
|
|
646
884
|
};
|
|
647
885
|
imports.wbg.__wbg_set_bc3a432bdcd60886 = function(arg0, arg1, arg2) {
|
|
648
886
|
arg0.set(arg1, arg2 >>> 0);
|
|
649
887
|
};
|
|
888
|
+
imports.wbg.__wbg_set_index_04c4b93e64d08a52 = function(arg0, arg1, arg2) {
|
|
889
|
+
arg0[arg1 >>> 0] = arg2;
|
|
890
|
+
};
|
|
891
|
+
imports.wbg.__wbg_set_onmessage_deb94985de696ac7 = function(arg0, arg1) {
|
|
892
|
+
arg0.onmessage = arg1;
|
|
893
|
+
};
|
|
650
894
|
imports.wbg.__wbg_set_server_certificate_hashes_d12c95e03a45bcd5 = function(arg0, arg1) {
|
|
651
895
|
arg0.serverCertificateHashes = arg1;
|
|
652
896
|
};
|
|
897
|
+
imports.wbg.__wbg_set_type_c2eb2929316959f4 = function(arg0, arg1) {
|
|
898
|
+
arg0.type = __wbindgen_enum_WorkerType[arg1];
|
|
899
|
+
};
|
|
653
900
|
imports.wbg.__wbg_set_value_3371f9dc48a34104 = function(arg0, arg1) {
|
|
654
901
|
arg0.value = arg1;
|
|
655
902
|
};
|
|
@@ -682,6 +929,9 @@ function __wbg_get_imports() {
|
|
|
682
929
|
return ret;
|
|
683
930
|
}, arguments);
|
|
684
931
|
};
|
|
932
|
+
imports.wbg.__wbg_terminate_08a1236dd2e69da0 = function(arg0) {
|
|
933
|
+
arg0.terminate();
|
|
934
|
+
};
|
|
685
935
|
imports.wbg.__wbg_then_429f7caf1026411d = function(arg0, arg1, arg2) {
|
|
686
936
|
const ret = arg0.then(arg1, arg2);
|
|
687
937
|
return ret;
|
|
@@ -701,26 +951,36 @@ function __wbg_get_imports() {
|
|
|
701
951
|
const ret = arg0.write(arg1);
|
|
702
952
|
return ret;
|
|
703
953
|
};
|
|
704
|
-
imports.wbg.
|
|
705
|
-
|
|
706
|
-
|
|
954
|
+
imports.wbg.__wbg_xor_5e9be92d2e01a692 = function() {
|
|
955
|
+
return handleError(function(arg0, arg1, arg2) {
|
|
956
|
+
const ret = Atomics.xor(arg0, arg1 >>> 0, arg2);
|
|
957
|
+
return ret;
|
|
958
|
+
}, arguments);
|
|
707
959
|
};
|
|
708
|
-
imports.wbg.
|
|
709
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
960
|
+
imports.wbg.__wbindgen_cast_0268c24e8eb79d38 = function(arg0, arg1) {
|
|
961
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h1c929db64e64ab27, wasm_bindgen__convert__closures_____invoke__h67573e759d30b522);
|
|
710
962
|
return ret;
|
|
711
963
|
};
|
|
712
964
|
imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
|
|
713
965
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
714
966
|
return ret;
|
|
715
967
|
};
|
|
716
|
-
imports.wbg.
|
|
717
|
-
const ret =
|
|
968
|
+
imports.wbg.__wbindgen_cast_5b09fbeec74be75e = function(arg0, arg1) {
|
|
969
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__hf225e18fc5ab9bc1, wasm_bindgen__convert__closures_____invoke__h39d3e89751b07765);
|
|
970
|
+
return ret;
|
|
971
|
+
};
|
|
972
|
+
imports.wbg.__wbindgen_cast_ce28d8b099adee02 = function(arg0, arg1) {
|
|
973
|
+
const ret = makeClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h1c929db64e64ab27, wasm_bindgen__convert__closures_____invoke__hf580618779cd5844);
|
|
718
974
|
return ret;
|
|
719
975
|
};
|
|
720
976
|
imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
|
|
721
977
|
const ret = arg0;
|
|
722
978
|
return ret;
|
|
723
979
|
};
|
|
980
|
+
imports.wbg.__wbindgen_cast_eb80e707f2cdece7 = function(arg0, arg1) {
|
|
981
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h1c929db64e64ab27, wasm_bindgen__convert__closures_____invoke__hb59a63b35a5a8674);
|
|
982
|
+
return ret;
|
|
983
|
+
};
|
|
724
984
|
imports.wbg.__wbindgen_init_externref_table = function() {
|
|
725
985
|
const table = wasm.__wbindgen_externrefs;
|
|
726
986
|
const offset = table.grow(4);
|
|
@@ -777,6 +1037,9 @@ var riscv_vm_default = __wbg_init;
|
|
|
777
1037
|
export {
|
|
778
1038
|
NetworkStatus,
|
|
779
1039
|
WasmVm,
|
|
1040
|
+
WorkerState,
|
|
1041
|
+
WorkerStepResult,
|
|
1042
|
+
worker_check_interrupts,
|
|
780
1043
|
worker_entry,
|
|
781
1044
|
initSync,
|
|
782
1045
|
riscv_vm_default
|