v86 0.5.329 → 0.5.330

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.
@@ -6257,8 +6257,7 @@ $v86$$module$src$main$$.prototype.destroy = function() {
6257
6257
  this.unregister_yield();
6258
6258
  };
6259
6259
  $v86$$module$src$main$$.prototype.restart = function() {
6260
- this.cpu.reset_cpu();
6261
- this.cpu.load_bios();
6260
+ this.cpu.reboot_internal();
6262
6261
  };
6263
6262
  $v86$$module$src$main$$.prototype.init = function($settings$jscomp$1$$) {
6264
6263
  this.cpu.init($settings$jscomp$1$$, this.bus);
@@ -6256,8 +6256,7 @@ $v86$$module$src$main$$.prototype.destroy = function() {
6256
6256
  this.unregister_yield();
6257
6257
  };
6258
6258
  $v86$$module$src$main$$.prototype.restart = function() {
6259
- this.cpu.reset_cpu();
6260
- this.cpu.load_bios();
6259
+ this.cpu.reboot_internal();
6261
6260
  };
6262
6261
  $v86$$module$src$main$$.prototype.init = function($settings$jscomp$1$$) {
6263
6262
  this.cpu.init($settings$jscomp$1$$, this.bus);
package/build/libv86.js CHANGED
@@ -347,7 +347,7 @@ N.prototype.get_instruction_stats=function(){var a=this.v86.cpu;var b="";var c="
347
347
  d=0;const e={};for(let g=0;g<c.length;g++){const h=c[g];var f=void 0;if(h.includes("/")){d++;const [l,m]=h.split("/");f=e[l]/e[m]}else f=e[h]=a.wm.exports.profiler_stat_get(g-d),f=1E8<=f?Math.round(f/1E6)+"m":1E5<=f?Math.round(f/1E3)+"k":f;b+=h+"="+f+"\n"}b+="\n";c=a.wm.exports.get_valid_tlb_entries_count();d=a.wm.exports.get_valid_global_tlb_entries_count();b=b+("TLB_ENTRIES="+c+" ("+d+" global, "+(c-d)+" non-global)\nWASM_TABLE_FREE=")+(a.wm.exports.jit_get_wasm_table_index_free_list_count()+"\n");
348
348
  b+="JIT_CACHE_SIZE="+a.wm.exports.jit_get_cache_size()+"\n";b+="FLAT_SEGMENTS="+a.wm.exports.has_flat_segmentation()+"\n";b+="wasm memory size: "+(a.wasm_memory.buffer.byteLength>>20)+"m\n";b=b+"Config:\nJIT_DISABLED="+(a.wm.exports.get_jit_config(0)+"\n");b+="MAX_PAGES="+a.wm.exports.get_jit_config(1)+"\n";b+="JIT_USE_LOOP_SAFETY="+!!a.wm.exports.get_jit_config(2)+"\n";b+="MAX_EXTRA_BASIC_BLOCKS="+a.wm.exports.get_jit_config(3)+"\n";a=[fb(a,!1,!1,!1,!1),fb(a,!0,!1,!1,!1),fb(a,!1,!0,!1,!1),fb(a,!1,
349
349
  !1,!0,!1),fb(a,!1,!1,!1,!0)].join("\n\n");return b+a};function xc(a){this.message=a||"File not found"}xc.prototype=Error.prototype;"undefined"!==typeof module&&"undefined"!==typeof module.exports?module.exports.V86=N:"undefined"!==typeof window?window.V86=N:"function"===typeof importScripts&&(self.V86=N);function F(a,b){this.stopping=this.running=!1;this.idle=!0;this.tick_counter=0;this.worker=null;this.cpu=new O(a,b,()=>{this.idle&&this.next_tick(0)});this.bus=a;this.register_yield()}F.prototype.run=function(){this.stopping=!1;this.running||(this.running=!0,this.bus.send("emulator-started"));this.next_tick(0)};F.prototype.do_tick=function(){if(this.stopping||!this.running)this.stopping=this.running=!1,this.bus.send("emulator-stopped");else{this.idle=!1;var a=this.cpu.main_loop();this.next_tick(a)}};
350
- F.prototype.next_tick=function(a){const b=++this.tick_counter;this.idle=!0;this.yield(a,b)};F.prototype.yield_callback=function(a){a===this.tick_counter&&this.do_tick()};F.prototype.stop=function(){this.running&&(this.stopping=!0)};F.prototype.destroy=function(){this.unregister_yield()};F.prototype.restart=function(){this.cpu.reset_cpu();this.cpu.load_bios()};F.prototype.init=function(a){this.cpu.init(a,this.bus);this.bus.send("emulator-ready")};
350
+ F.prototype.next_tick=function(a){const b=++this.tick_counter;this.idle=!0;this.yield(a,b)};F.prototype.yield_callback=function(a){a===this.tick_counter&&this.do_tick()};F.prototype.stop=function(){this.running&&(this.stopping=!0)};F.prototype.destroy=function(){this.unregister_yield()};F.prototype.restart=function(){this.cpu.reboot_internal()};F.prototype.init=function(a){this.cpu.init(a,this.bus);this.bus.send("emulator-ready")};
351
351
  if("undefined"!==typeof process)F.prototype.yield=function(a,b){1>a?global.setImmediate(c=>this.yield_callback(c),b):setTimeout(c=>this.yield_callback(c),a,b)},F.prototype.register_yield=function(){},F.prototype.unregister_yield=function(){};else if(globalThis.scheduler&&"function"===typeof globalThis.scheduler.postTask&&location.href.includes("use-scheduling-api"))F.prototype.yield=function(a,b){a=Math.max(0,a);globalThis.scheduler.postTask(()=>this.yield_callback(b),{delay:a})},F.prototype.register_yield=
352
352
  function(){},F.prototype.unregister_yield=function(){};else if("undefined"!==typeof Worker){function a(){let b;globalThis.onmessage=function(c){const d=c.data.t;b=b&&clearTimeout(b);1>d?postMessage(c.data.tick):b=setTimeout(()=>postMessage(c.data.tick),d)}}F.prototype.register_yield=function(){const b=URL.createObjectURL(new Blob(["("+a.toString()+")()"],{type:"text/javascript"}));this.worker=new Worker(b);this.worker.onmessage=c=>this.yield_callback(c.data);URL.revokeObjectURL(b)};F.prototype.yield=
353
353
  function(b,c){this.worker.postMessage({t:b,tick:c})};F.prototype.unregister_yield=function(){this.worker&&this.worker.terminate();this.worker=null}}else F.prototype.yield=function(a){setTimeout(()=>{this.do_tick()},a)},F.prototype.register_yield=function(){},F.prototype.unregister_yield=function(){};
package/build/libv86.mjs CHANGED
@@ -309,8 +309,8 @@ d=0;const e={};for(let g=0;g<c.length;g++){const h=c[g];var f=void 0;if(h.includ
309
309
  b+="JIT_CACHE_SIZE="+a.wm.exports.jit_get_cache_size()+"\n";b+="FLAT_SEGMENTS="+a.wm.exports.has_flat_segmentation()+"\n";b+="wasm memory size: "+(a.wasm_memory.buffer.byteLength>>20)+"m\n";b=b+"Config:\nJIT_DISABLED="+(a.wm.exports.get_jit_config(0)+"\n");b+="MAX_PAGES="+a.wm.exports.get_jit_config(1)+"\n";b+="JIT_USE_LOOP_SAFETY="+!!a.wm.exports.get_jit_config(2)+"\n";b+="MAX_EXTRA_BASIC_BLOCKS="+a.wm.exports.get_jit_config(3)+"\n";a=[fb(a,!1,!1,!1,!1),fb(a,!0,!1,!1,!1),fb(a,!1,!0,!1,!1),fb(a,!1,
310
310
  !1,!0,!1),fb(a,!1,!1,!1,!0)].join("\n\n");return b+a};function xc(a){this.message=a||"File not found"}xc.prototype=Error.prototype;"undefined"!==typeof module&&"undefined"!==typeof module.exports?module.exports.V86=N:"undefined"!==typeof window?window.V86=N:"function"===typeof importScripts&&(self.V86=N);function F(a,b){this.stopping=this.running=!1;this.idle=!0;this.tick_counter=0;this.worker=null;this.cpu=new O(a,b,()=>{this.idle&&this.next_tick(0)});this.bus=a;this.register_yield()}F.prototype.run=
311
311
  function(){this.stopping=!1;this.running||(this.running=!0,this.bus.send("emulator-started"));this.next_tick(0)};F.prototype.do_tick=function(){if(this.stopping||!this.running)this.stopping=this.running=!1,this.bus.send("emulator-stopped");else{this.idle=!1;var a=this.cpu.main_loop();this.next_tick(a)}};F.prototype.next_tick=function(a){const b=++this.tick_counter;this.idle=!0;this.yield(a,b)};F.prototype.yield_callback=function(a){a===this.tick_counter&&this.do_tick()};F.prototype.stop=function(){this.running&&
312
- (this.stopping=!0)};F.prototype.destroy=function(){this.unregister_yield()};F.prototype.restart=function(){this.cpu.reset_cpu();this.cpu.load_bios()};F.prototype.init=function(a){this.cpu.init(a,this.bus);this.bus.send("emulator-ready")};if("undefined"!==typeof process)F.prototype.yield=function(a,b){1>a?global.setImmediate(c=>this.yield_callback(c),b):setTimeout(c=>this.yield_callback(c),a,b)},F.prototype.register_yield=function(){},F.prototype.unregister_yield=function(){};else if(globalThis.scheduler&&
313
- "function"===typeof globalThis.scheduler.postTask&&location.href.includes("use-scheduling-api"))F.prototype.yield=function(a,b){a=Math.max(0,a);globalThis.scheduler.postTask(()=>this.yield_callback(b),{delay:a})},F.prototype.register_yield=function(){},F.prototype.unregister_yield=function(){};else if("undefined"!==typeof Worker){function a(){let b;globalThis.onmessage=function(c){const d=c.data.t;b=b&&clearTimeout(b);1>d?postMessage(c.data.tick):b=setTimeout(()=>postMessage(c.data.tick),d)}}F.prototype.register_yield=
312
+ (this.stopping=!0)};F.prototype.destroy=function(){this.unregister_yield()};F.prototype.restart=function(){this.cpu.reboot_internal()};F.prototype.init=function(a){this.cpu.init(a,this.bus);this.bus.send("emulator-ready")};if("undefined"!==typeof process)F.prototype.yield=function(a,b){1>a?global.setImmediate(c=>this.yield_callback(c),b):setTimeout(c=>this.yield_callback(c),a,b)},F.prototype.register_yield=function(){},F.prototype.unregister_yield=function(){};else if(globalThis.scheduler&&"function"===
313
+ typeof globalThis.scheduler.postTask&&location.href.includes("use-scheduling-api"))F.prototype.yield=function(a,b){a=Math.max(0,a);globalThis.scheduler.postTask(()=>this.yield_callback(b),{delay:a})},F.prototype.register_yield=function(){},F.prototype.unregister_yield=function(){};else if("undefined"!==typeof Worker){function a(){let b;globalThis.onmessage=function(c){const d=c.data.t;b=b&&clearTimeout(b);1>d?postMessage(c.data.tick):b=setTimeout(()=>postMessage(c.data.tick),d)}}F.prototype.register_yield=
314
314
  function(){const b=URL.createObjectURL(new Blob(["("+a.toString()+")()"],{type:"text/javascript"}));this.worker=new Worker(b);this.worker.onmessage=c=>this.yield_callback(c.data);URL.revokeObjectURL(b)};F.prototype.yield=function(b,c){this.worker.postMessage({t:b,tick:c})};F.prototype.unregister_yield=function(){this.worker&&this.worker.terminate();this.worker=null}}else F.prototype.yield=function(a){setTimeout(()=>{this.do_tick()},a)},F.prototype.register_yield=function(){},F.prototype.unregister_yield=
315
315
  function(){};F.prototype.save_state=function(){for(var a=[],b=cb(this.cpu,a),c=[],d=0,e=0;e<a.length;e++){var f=a[e].byteLength;c[e]={offset:d,length:f};d+=f;d=d+3&-4}e=JSON.stringify({buffer_infos:c,state:b});e=(new TextEncoder).encode(e);b=16+e.length;b=b+3&-4;f=b+d;d=new ArrayBuffer(f);var g=new Int32Array(d,0,4);(new Uint8Array(d,16,e.length)).set(e);b=new Uint8Array(d,b);g[0]=-2039052682;g[1]=6;g[2]=f;g[3]=e.length;for(e=0;e<a.length;e++)b.set(a[e],c[e].offset);return d};F.prototype.restore_state=
316
316
  function(a){return eb(this.cpu,a)};if("object"===typeof performance&&performance.now)F.microtick=performance.now.bind(performance);else if("function"===typeof require){const {performance:a}=require("perf_hooks");F.microtick=a.now.bind(a)}else F.microtick="object"===typeof process&&process.hrtime?function(){var a=process.hrtime();return 1E3*a[0]+a[1]/1E6}:Date.now;function yc(a){this.cpu=a;var b=a.io;a.devices.pci.register_device({pci_id:56,pci_space:[134,128,19,113,7,0,128,2,8,0,128,6,0,0,128,0,0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "v86",
3
- "version": "0.5.329+g3fdaaaa",
3
+ "version": "0.5.330+g88a92ae",
4
4
  "license": "BSD-2-Clause",
5
5
  "description": "x86 PC emulator and x86-to-wasm JIT, running in the browser",
6
6
  "homepage": "https://copy.sh/v86/",