v86 0.5.276 → 0.5.277

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.
@@ -6139,10 +6139,10 @@ if ("undefined" !== typeof process) {
6139
6139
  }, $v86$$module$src$main$$.prototype.unregister_yield = function() {
6140
6140
  };
6141
6141
  } else {
6142
- if (window.scheduler && "function" === typeof window.scheduler.postTask && location.href.includes("use-scheduling-api")) {
6142
+ if (globalThis.scheduler && "function" === typeof globalThis.scheduler.postTask && location.href.includes("use-scheduling-api")) {
6143
6143
  $v86$$module$src$main$$.prototype.yield = function($t$jscomp$8$$, $tick$jscomp$5$$) {
6144
6144
  $t$jscomp$8$$ = Math.max(0, $t$jscomp$8$$);
6145
- window.scheduler.postTask(() => this.yield_callback($tick$jscomp$5$$), {delay:$t$jscomp$8$$});
6145
+ globalThis.scheduler.postTask(() => this.yield_callback($tick$jscomp$5$$), {delay:$t$jscomp$8$$});
6146
6146
  }, $v86$$module$src$main$$.prototype.register_yield = function() {
6147
6147
  }, $v86$$module$src$main$$.prototype.unregister_yield = function() {
6148
6148
  };
@@ -335,8 +335,8 @@ d=0;const e={};for(let g=0;g<c.length;g++){const k=c[g];var f=void 0;if(k.includ
335
335
  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=[jb(a,!1,!1,!1,!1),jb(a,!0,!1,!1,!1),jb(a,!1,!0,!1,!1),jb(a,!1,
336
336
  !1,!0,!1),jb(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 H(a,b){this.stopping=this.running=!1;this.idle=!0;this.tick_counter=0;this.worker=null;this.cpu=new P(a,b,()=>{this.idle&&this.next_tick(0)});this.bus=a;this.register_yield()}H.prototype.run=
337
337
  function(){this.stopping=!1;this.running||(this.running=!0,this.bus.send("emulator-started"));this.next_tick(0)};H.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)}};H.prototype.next_tick=function(a){const b=++this.tick_counter;this.idle=!0;this.yield(a,b)};H.prototype.yield_callback=function(a){a===this.tick_counter&&this.do_tick()};H.prototype.stop=function(){this.running&&
338
- (this.stopping=!0)};H.prototype.destroy=function(){this.unregister_yield()};H.prototype.restart=function(){this.cpu.reset_cpu();this.cpu.load_bios()};H.prototype.init=function(a){this.cpu.init(a,this.bus);this.bus.send("emulator-ready")};if("undefined"!==typeof process)H.prototype.yield=function(a,b){1>a?global.setImmediate(c=>this.yield_callback(c),b):setTimeout(c=>this.yield_callback(c),a,b)},H.prototype.register_yield=function(){},H.prototype.unregister_yield=function(){};else if(window.scheduler&&
339
- "function"===typeof window.scheduler.postTask&&location.href.includes("use-scheduling-api"))H.prototype.yield=function(a,b){a=Math.max(0,a);window.scheduler.postTask(()=>this.yield_callback(b),{delay:a})},H.prototype.register_yield=function(){},H.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)}}H.prototype.register_yield=
338
+ (this.stopping=!0)};H.prototype.destroy=function(){this.unregister_yield()};H.prototype.restart=function(){this.cpu.reset_cpu();this.cpu.load_bios()};H.prototype.init=function(a){this.cpu.init(a,this.bus);this.bus.send("emulator-ready")};if("undefined"!==typeof process)H.prototype.yield=function(a,b){1>a?global.setImmediate(c=>this.yield_callback(c),b):setTimeout(c=>this.yield_callback(c),a,b)},H.prototype.register_yield=function(){},H.prototype.unregister_yield=function(){};else if(globalThis.scheduler&&
339
+ "function"===typeof globalThis.scheduler.postTask&&location.href.includes("use-scheduling-api"))H.prototype.yield=function(a,b){a=Math.max(0,a);globalThis.scheduler.postTask(()=>this.yield_callback(b),{delay:a})},H.prototype.register_yield=function(){},H.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)}}H.prototype.register_yield=
340
340
  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)};H.prototype.yield=function(b,c){this.worker.postMessage({t:b,tick:c})};H.prototype.unregister_yield=function(){this.worker&&this.worker.terminate();this.worker=null}}else H.prototype.yield=function(a){setTimeout(()=>{this.do_tick()},a)},H.prototype.register_yield=function(){},H.prototype.unregister_yield=
341
341
  function(){};H.prototype.save_state=function(){for(var a=[],b=gb(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}b=JSON.stringify({buffer_infos:c,state:b});b=(new TextEncoder).encode(b);e=16+b.length;e=e+3&-4;var g=e+d;d=new ArrayBuffer(g);var k=new Int32Array(d,0,4);(new Uint8Array(d,16,b.length)).set(b);f=new Uint8Array(d,e);k[0]=-2039052682;k[1]=6;k[2]=g;k[3]=b.length;for(e=0;e<a.length;e++)g=a[e],l(g.constructor===Uint8Array),f.set(g,c[e].offset);
342
342
  B("State: json size "+(b.byteLength>>10)+"k");B("State: Total buffers size "+(f.byteLength>>10)+"k");return d};H.prototype.restore_state=function(a){return ib(this.cpu,a)};if("object"===typeof performance&&performance.now)H.microtick=performance.now.bind(performance);else if("function"===typeof require){const {performance:a}=require("perf_hooks");H.microtick=a.now.bind(a)}else H.microtick="object"===typeof process&&process.hrtime?function(){var a=process.hrtime();return 1E3*a[0]+a[1]/1E6}:Date.now;
package/build/libv86.js CHANGED
@@ -340,9 +340,9 @@ M.prototype.get_instruction_stats=function(){var a=this.v86.cpu;var b="";var c="
340
340
  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,
341
341
  !1,!0,!1),fb(a,!1,!1,!1,!0)].join("\n\n");return b+a};function sc(a){this.message=a||"File not found"}sc.prototype=Error.prototype;"undefined"!==typeof module&&"undefined"!==typeof module.exports?module.exports.V86=M:"undefined"!==typeof window?window.V86=M:"function"===typeof importScripts&&(self.V86=M);function E(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()}E.prototype.run=function(){this.stopping=!1;this.running||(this.running=!0,this.bus.send("emulator-started"));this.next_tick(0)};E.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)}};
342
342
  E.prototype.next_tick=function(a){const b=++this.tick_counter;this.idle=!0;this.yield(a,b)};E.prototype.yield_callback=function(a){a===this.tick_counter&&this.do_tick()};E.prototype.stop=function(){this.running&&(this.stopping=!0)};E.prototype.destroy=function(){this.unregister_yield()};E.prototype.restart=function(){this.cpu.reset_cpu();this.cpu.load_bios()};E.prototype.init=function(a){this.cpu.init(a,this.bus);this.bus.send("emulator-ready")};
343
- if("undefined"!==typeof process)E.prototype.yield=function(a,b){1>a?global.setImmediate(c=>this.yield_callback(c),b):setTimeout(c=>this.yield_callback(c),a,b)},E.prototype.register_yield=function(){},E.prototype.unregister_yield=function(){};else if(window.scheduler&&"function"===typeof window.scheduler.postTask&&location.href.includes("use-scheduling-api"))E.prototype.yield=function(a,b){a=Math.max(0,a);window.scheduler.postTask(()=>this.yield_callback(b),{delay:a})},E.prototype.register_yield=function(){},
344
- E.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)}}E.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)};E.prototype.yield=function(b,
345
- c){this.worker.postMessage({t:b,tick:c})};E.prototype.unregister_yield=function(){this.worker&&this.worker.terminate();this.worker=null}}else E.prototype.yield=function(a){setTimeout(()=>{this.do_tick()},a)},E.prototype.register_yield=function(){},E.prototype.unregister_yield=function(){};
343
+ if("undefined"!==typeof process)E.prototype.yield=function(a,b){1>a?global.setImmediate(c=>this.yield_callback(c),b):setTimeout(c=>this.yield_callback(c),a,b)},E.prototype.register_yield=function(){},E.prototype.unregister_yield=function(){};else if(globalThis.scheduler&&"function"===typeof globalThis.scheduler.postTask&&location.href.includes("use-scheduling-api"))E.prototype.yield=function(a,b){a=Math.max(0,a);globalThis.scheduler.postTask(()=>this.yield_callback(b),{delay:a})},E.prototype.register_yield=
344
+ function(){},E.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)}}E.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)};E.prototype.yield=
345
+ function(b,c){this.worker.postMessage({t:b,tick:c})};E.prototype.unregister_yield=function(){this.worker&&this.worker.terminate();this.worker=null}}else E.prototype.yield=function(a){setTimeout(()=>{this.do_tick()},a)},E.prototype.register_yield=function(){},E.prototype.unregister_yield=function(){};
346
346
  E.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};
347
347
  E.prototype.restore_state=function(a){return eb(this.cpu,a)};if("object"===typeof performance&&performance.now)E.microtick=performance.now.bind(performance);else if("function"===typeof require){const {performance:a}=require("perf_hooks");E.microtick=a.now.bind(a)}else E.microtick="object"===typeof process&&process.hrtime?function(){var a=process.hrtime();return 1E3*a[0]+a[1]/1E6}:Date.now;function tc(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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,1,0,0],pci_bars:[],name:"acpi"});this.timer_imprecision_offset=this.timer_last_value=0;this.status=1;this.pm1_enable=this.pm1_status=0;this.last_timer=this.get_timer(E.microtick());this.gpe=new Uint8Array(4);b.register_read(45056,this,void 0,function(){return this.pm1_status});
348
348
  b.register_write(45056,this,void 0,function(c){z(c,4);this.pm1_status&=~c});b.register_read(45058,this,void 0,function(){return this.pm1_enable});b.register_write(45058,this,void 0,function(c){z(c);this.pm1_enable=c});b.register_read(45060,this,function(){return this.status&255},function(){return this.status});b.register_write(45060,this,void 0,function(c){z(c);this.status=c});b.register_read(45064,this,void 0,void 0,function(){return this.get_timer(E.microtick())&16777215});b.register_read(45024,
package/build/libv86.mjs CHANGED
@@ -302,8 +302,8 @@ d=0;const e={};for(let g=0;g<c.length;g++){const h=c[g];var f=void 0;if(h.includ
302
302
  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,
303
303
  !1,!0,!1),fb(a,!1,!1,!1,!0)].join("\n\n");return b+a};function sc(a){this.message=a||"File not found"}sc.prototype=Error.prototype;"undefined"!==typeof module&&"undefined"!==typeof module.exports?module.exports.V86=M:"undefined"!==typeof window?window.V86=M:"function"===typeof importScripts&&(self.V86=M);function E(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()}E.prototype.run=
304
304
  function(){this.stopping=!1;this.running||(this.running=!0,this.bus.send("emulator-started"));this.next_tick(0)};E.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)}};E.prototype.next_tick=function(a){const b=++this.tick_counter;this.idle=!0;this.yield(a,b)};E.prototype.yield_callback=function(a){a===this.tick_counter&&this.do_tick()};E.prototype.stop=function(){this.running&&
305
- (this.stopping=!0)};E.prototype.destroy=function(){this.unregister_yield()};E.prototype.restart=function(){this.cpu.reset_cpu();this.cpu.load_bios()};E.prototype.init=function(a){this.cpu.init(a,this.bus);this.bus.send("emulator-ready")};if("undefined"!==typeof process)E.prototype.yield=function(a,b){1>a?global.setImmediate(c=>this.yield_callback(c),b):setTimeout(c=>this.yield_callback(c),a,b)},E.prototype.register_yield=function(){},E.prototype.unregister_yield=function(){};else if(window.scheduler&&
306
- "function"===typeof window.scheduler.postTask&&location.href.includes("use-scheduling-api"))E.prototype.yield=function(a,b){a=Math.max(0,a);window.scheduler.postTask(()=>this.yield_callback(b),{delay:a})},E.prototype.register_yield=function(){},E.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)}}E.prototype.register_yield=
305
+ (this.stopping=!0)};E.prototype.destroy=function(){this.unregister_yield()};E.prototype.restart=function(){this.cpu.reset_cpu();this.cpu.load_bios()};E.prototype.init=function(a){this.cpu.init(a,this.bus);this.bus.send("emulator-ready")};if("undefined"!==typeof process)E.prototype.yield=function(a,b){1>a?global.setImmediate(c=>this.yield_callback(c),b):setTimeout(c=>this.yield_callback(c),a,b)},E.prototype.register_yield=function(){},E.prototype.unregister_yield=function(){};else if(globalThis.scheduler&&
306
+ "function"===typeof globalThis.scheduler.postTask&&location.href.includes("use-scheduling-api"))E.prototype.yield=function(a,b){a=Math.max(0,a);globalThis.scheduler.postTask(()=>this.yield_callback(b),{delay:a})},E.prototype.register_yield=function(){},E.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)}}E.prototype.register_yield=
307
307
  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)};E.prototype.yield=function(b,c){this.worker.postMessage({t:b,tick:c})};E.prototype.unregister_yield=function(){this.worker&&this.worker.terminate();this.worker=null}}else E.prototype.yield=function(a){setTimeout(()=>{this.do_tick()},a)},E.prototype.register_yield=function(){},E.prototype.unregister_yield=
308
308
  function(){};E.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};E.prototype.restore_state=
309
309
  function(a){return eb(this.cpu,a)};if("object"===typeof performance&&performance.now)E.microtick=performance.now.bind(performance);else if("function"===typeof require){const {performance:a}=require("perf_hooks");E.microtick=a.now.bind(a)}else E.microtick="object"===typeof process&&process.hrtime?function(){var a=process.hrtime();return 1E3*a[0]+a[1]/1E6}:Date.now;function tc(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,
Binary file
Binary file
package/build/v86.wasm CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "v86",
3
- "version": "0.5.276+gdb22e06",
3
+ "version": "0.5.277+gc004ebb",
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/",