virtual-machine 0.0.2 → 0.0.4

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.
Binary file
package/Cargo.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "riscv-vm"
3
- version = "0.0.2"
3
+ version = "0.0.4"
4
4
  edition = "2024"
5
5
 
6
6
  [lib]
@@ -186,12 +186,6 @@ function passArray8ToWasm0(arg, malloc) {
186
186
  WASM_VECTOR_LEN = arg.length;
187
187
  return ptr;
188
188
  }
189
- function wasm_bindgen__convert__closures_____invoke__h74b0833075704714(arg0, arg1, arg2) {
190
- wasm.wasm_bindgen__convert__closures_____invoke__h74b0833075704714(arg0, arg1, arg2);
191
- }
192
- function wasm_bindgen__convert__closures_____invoke__hb59cd9fe41fe42e5(arg0, arg1) {
193
- wasm.wasm_bindgen__convert__closures_____invoke__hb59cd9fe41fe42e5(arg0, arg1);
194
- }
195
189
  function wasm_bindgen__convert__closures_____invoke__h6fd3101b14d9814b(arg0, arg1, arg2) {
196
190
  wasm.wasm_bindgen__convert__closures_____invoke__h6fd3101b14d9814b(arg0, arg1, arg2);
197
191
  }
@@ -205,7 +199,6 @@ var NetworkStatus = Object.freeze({
205
199
  Error: 3,
206
200
  "3": "Error"
207
201
  });
208
- var __wbindgen_enum_BinaryType = ["blob", "arraybuffer"];
209
202
  var WasmVmFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
210
203
  }, unregister: () => {
211
204
  } } : new FinalizationRegistry((ptr) => wasm.__wbg_wasmvm_free(ptr >>> 0, 1));
@@ -236,19 +229,6 @@ var WasmVm = class {
236
229
  const ret = wasm.wasmvm_network_status(this.__wbg_ptr);
237
230
  return ret;
238
231
  }
239
- /**
240
- * Connect to a WebSocket relay server for networking.
241
- * The URL should be like "ws://localhost:8765".
242
- * @param {string} ws_url
243
- */
244
- connect_network(ws_url) {
245
- const ptr0 = passStringToWasm0(ws_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
246
- const len0 = WASM_VECTOR_LEN;
247
- const ret = wasm.wasmvm_connect_network(this.__wbg_ptr, ptr0, len0);
248
- if (ret[1]) {
249
- throw takeFromExternrefTable0(ret[0]);
250
- }
251
- }
252
232
  /**
253
233
  * Get current memory usage (DRAM size) in bytes.
254
234
  * @returns {bigint}
@@ -373,24 +353,12 @@ function __wbg_get_imports() {
373
353
  imports.wbg.__wbg__wbg_cb_unref_2454a539ea5790d9 = function(arg0) {
374
354
  arg0._wbg_cb_unref();
375
355
  };
376
- imports.wbg.__wbg_buffer_ccc4520b36d3ccf4 = function(arg0) {
377
- const ret = arg0.buffer;
378
- return ret;
379
- };
380
356
  imports.wbg.__wbg_call_e762c39fa8ea36bf = function() {
381
357
  return handleError(function(arg0, arg1) {
382
358
  const ret = arg0.call(arg1);
383
359
  return ret;
384
360
  }, arguments);
385
361
  };
386
- imports.wbg.__wbg_code_20d453b11b200026 = function(arg0) {
387
- const ret = arg0.code;
388
- return ret;
389
- };
390
- imports.wbg.__wbg_data_ee4306d069f24f2d = function(arg0) {
391
- const ret = arg0.data;
392
- return ret;
393
- };
394
362
  imports.wbg.__wbg_datagrams_d3815636dcdca421 = function(arg0) {
395
363
  const ret = arg0.datagrams;
396
364
  return ret;
@@ -422,27 +390,10 @@ function __wbg_get_imports() {
422
390
  return ret;
423
391
  }, arguments);
424
392
  };
425
- imports.wbg.__wbg_instanceof_ArrayBuffer_70beb1189ca63b38 = function(arg0) {
426
- let result;
427
- try {
428
- result = arg0 instanceof ArrayBuffer;
429
- } catch (_) {
430
- result = false;
431
- }
432
- const ret = result;
433
- return ret;
434
- };
435
393
  imports.wbg.__wbg_length_69bca3cb64fc8748 = function(arg0) {
436
394
  const ret = arg0.length;
437
395
  return ret;
438
396
  };
439
- imports.wbg.__wbg_message_3abccea43568e0bd = function(arg0, arg1) {
440
- const ret = arg1.message;
441
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
442
- const len1 = WASM_VECTOR_LEN;
443
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
444
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
445
- };
446
397
  imports.wbg.__wbg_new_1acc0b6eea89d040 = function() {
447
398
  const ret = new Object();
448
399
  return ret;
@@ -451,12 +402,6 @@ function __wbg_get_imports() {
451
402
  const ret = new Uint8Array(arg0);
452
403
  return ret;
453
404
  };
454
- imports.wbg.__wbg_new_881c4fe631eee9ad = function() {
455
- return handleError(function(arg0, arg1) {
456
- const ret = new WebSocket(getStringFromWasm0(arg0, arg1));
457
- return ret;
458
- }, arguments);
459
- };
460
405
  imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {
461
406
  const ret = new Error();
462
407
  return ret;
@@ -505,40 +450,13 @@ function __wbg_get_imports() {
505
450
  const ret = arg0.ready;
506
451
  return ret;
507
452
  };
508
- imports.wbg.__wbg_reason_1cced37e3a93763e = function(arg0, arg1) {
509
- const ret = arg1.reason;
510
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
511
- const len1 = WASM_VECTOR_LEN;
512
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
513
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
514
- };
515
453
  imports.wbg.__wbg_resolve_caf97c30b83f7053 = function(arg0) {
516
454
  const ret = Promise.resolve(arg0);
517
455
  return ret;
518
456
  };
519
- imports.wbg.__wbg_send_25caa2dbdb78318d = function() {
520
- return handleError(function(arg0, arg1) {
521
- arg0.send(arg1);
522
- }, arguments);
523
- };
524
457
  imports.wbg.__wbg_set_algorithm_8f54a80aa7f1ccb1 = function(arg0, arg1, arg2) {
525
458
  arg0.algorithm = getStringFromWasm0(arg1, arg2);
526
459
  };
527
- imports.wbg.__wbg_set_binaryType_9d839cea8fcdc5c3 = function(arg0, arg1) {
528
- arg0.binaryType = __wbindgen_enum_BinaryType[arg1];
529
- };
530
- imports.wbg.__wbg_set_onclose_c09e4f7422de8dae = function(arg0, arg1) {
531
- arg0.onclose = arg1;
532
- };
533
- imports.wbg.__wbg_set_onerror_337a3a2db9517378 = function(arg0, arg1) {
534
- arg0.onerror = arg1;
535
- };
536
- imports.wbg.__wbg_set_onmessage_8661558551a89792 = function(arg0, arg1) {
537
- arg0.onmessage = arg1;
538
- };
539
- imports.wbg.__wbg_set_onopen_efccb9305427b907 = function(arg0, arg1) {
540
- arg0.onopen = arg1;
541
- };
542
460
  imports.wbg.__wbg_set_server_certificate_hashes_0936192963851de7 = function(arg0, arg1) {
543
461
  arg0.serverCertificateHashes = arg1;
544
462
  };
@@ -584,28 +502,12 @@ function __wbg_get_imports() {
584
502
  const ret = arg0.write(arg1);
585
503
  return ret;
586
504
  };
587
- imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
588
- const ret = getStringFromWasm0(arg0, arg1);
589
- return ret;
590
- };
591
- imports.wbg.__wbindgen_cast_3aa963a08b1e1d3f = function(arg0, arg1) {
592
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h0c7e8767edb7b811, wasm_bindgen__convert__closures_____invoke__h74b0833075704714);
593
- return ret;
594
- };
595
- imports.wbg.__wbindgen_cast_3fd26d226c2b9642 = function(arg0, arg1) {
596
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h0c7e8767edb7b811, wasm_bindgen__convert__closures_____invoke__h74b0833075704714);
597
- return ret;
598
- };
599
- imports.wbg.__wbindgen_cast_5b09fbeec74be75e = function(arg0, arg1) {
505
+ imports.wbg.__wbindgen_cast_19eead9c9e92d417 = function(arg0, arg1) {
600
506
  const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__hb2f3fe1158f30bc9, wasm_bindgen__convert__closures_____invoke__h6fd3101b14d9814b);
601
507
  return ret;
602
508
  };
603
- imports.wbg.__wbindgen_cast_77a91827c917be15 = function(arg0, arg1) {
604
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h0c7e8767edb7b811, wasm_bindgen__convert__closures_____invoke__hb59cd9fe41fe42e5);
605
- return ret;
606
- };
607
- imports.wbg.__wbindgen_cast_e6666d41823ad376 = function(arg0, arg1) {
608
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h0c7e8767edb7b811, wasm_bindgen__convert__closures_____invoke__h74b0833075704714);
509
+ imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
510
+ const ret = getStringFromWasm0(arg0, arg1);
609
511
  return ret;
610
512
  };
611
513
  imports.wbg.__wbindgen_init_externref_table = function() {