Commit graph

2054 commits

Author SHA1 Message Date
Fabian a39d58d4e5 ne2k: Fix transfer of empty packet and start page after wrap-around 2020-08-30 19:29:54 -05:00
Fabian 28a6f1a84a Add pit.dump 2020-08-30 19:29:54 -05:00
Fabian efea556a10 Implement NetworkAdapter.change_proxy 2020-08-30 19:29:54 -05:00
Ernest Wong 6fe226eec9 Filestorage: Reuse write-to-indexeddb logic 2020-08-30 19:29:54 -05:00
Ernest Wong 27a825dce3 Filestorage: Preserve key names when writing into indexeddb 2020-08-30 19:29:54 -05:00
Ernest Wong a0c984dc8d Filesystem: Introduce IndexedDBFileStorage
Uses MemoryFileStorage as a fallback when:
- v86 is used in a browserless environment, e.g. NodeJS
- browser doesn't support indexedDB
- opening indexedDB fails
- existing database is a newer version
- existing database is an old version and is under use - blocking
current v86 instance to connect to it.
2020-08-30 19:29:54 -05:00
Ernest Wong 0a67e3532f Filesystem: Introduce FileStorage class for server-loaded files 2020-08-30 19:29:54 -05:00
Ernest Wong 595d6dca55 Filesystem: Refactor inodedata accesses to async methods
The "// jshint ignore:line" comments are pretty messy, so squint your eyes.
They're systematically placed, so we can regex it out when jshint's
new version finally arrives.

Using async/await instead of callbacks due to callback hell, and it also
helps minimising the diff)
2020-08-30 19:29:54 -05:00
Amaan Cheval b6b55e5644 cpu: Refactor get_tss_stack_addr to simplify things 2020-08-30 19:29:54 -05:00
Amaan Cheval 0bf4e4faf6 cpu: Port get_tss_stack_addr to Rust 2020-08-30 19:29:54 -05:00
Amaan Cheval de8411f184 Minor: Inline has_error_code 2020-08-30 19:29:54 -05:00
Amaan Cheval 3b94c5f9d3 cpu: Refactor to use error_code: Option<i32> for call_interrupt_vector 2020-08-30 19:29:54 -05:00
Amaan Cheval ce090cfb4e cpu: Inline into InterruptDescriptor and clean call_interrupt_vector 2020-08-30 19:29:54 -05:00
Amaan Cheval f7f0f64f84 cpu: Use of_<T> functions to init descriptor and selector structs 2020-08-30 19:29:54 -05:00
Amaan Cheval ae70cb7e4f cpu: Minor refactor in call_interrupt_vector 2020-08-30 19:29:54 -05:00
Amaan Cheval 8ba3de34c1 cpu: Check for reserved zeros in interrupt descriptor
This lets us make our gate type validity check more readable
2020-08-30 19:29:54 -05:00
Amaan Cheval aa789d4129 cpu: Follow call_interrupt_vector's specification more closely 2020-08-30 19:29:54 -05:00
Amaan Cheval 4ef09445e1 cpu: Port call_interrupt_vector to Rust 2020-08-30 19:29:54 -05:00
Fabian 48e6843a87 Remove S_ prefix from profiler 2020-08-30 19:29:54 -05:00
Fabian 5b2aa69777 Use CachedStateFlags type in former C code 2020-08-30 19:29:54 -05:00
Fabian 18b2a0883a Remove same_page, use Page::page_of 2020-08-30 19:29:54 -05:00
Fabian 0798a0b40e Don't create unnecessary entry points
This commit prevents creation of entry points for jumps within the same
page. In interpreted mode, execution is continued on these kinds of
jumps.

Since this prevents the old hotness detection from working efficiently,
hotness detection has also been changed to work based on instruction
counters, and is such more precise (longer basic blocks are compiled
earlier).

This also breaks the old detection loop safety mechanism and causes
Linux to sometimes loop forever on "calibrating delay loop", so
JIT_ALWAYS_USE_LOOP_SAFETY has been set to 1.
2020-08-30 19:29:54 -05:00
Fabian afcce9b371 Record compiled instructions per opcode 2020-08-30 19:29:54 -05:00
Fabian 7e1d398e05 Track last executed jump instruction, check for missed entry points while looking for compiled code 2020-08-30 19:29:54 -05:00
Fabian 7e3f1ad401 gen_fn: Accept wasm builder, not jit context 2020-08-30 19:29:54 -05:00
Fabian 8447b6bb83 Fix prefixes in jitted code: Reset after exception 2020-08-30 19:29:54 -05:00
Fabian 5eaece7743 jit memory moves with immediate address (A0/A1/A2/A3) 2020-08-30 19:29:54 -05:00
Fabian 3f9b32cdd8 Improve stats for run_interpreted 2020-08-30 19:29:54 -05:00
Fabian 8de547455e jit memory access for imul 2020-08-30 19:29:54 -05:00
Fabian b0f3fd88c4 report_safe_{read,write}_jit_slow: not_user can happen (it just doesn't happen very often) 2020-08-30 19:29:54 -05:00
Fabian 6a2cd6419d jit memory access for 8-bit read-modify-write operations with immediate 2020-08-30 19:29:54 -05:00
Fabian 2635ed71b4 jit memory access for 8-bit read-modify-write operations 2020-08-30 19:29:54 -05:00
Fabian b98ff1612a Make profiler stat counters u64 2020-08-30 19:29:54 -05:00
Fabian 014e745810 Clean up dead code from old exceptions 2020-08-30 19:29:54 -05:00
Fabian 7d0521475a Store fxsave_store_fpu_mask in state 2020-08-30 19:29:54 -05:00
Fabian 32699a3a7e Clear unused wasm modules earlier 2020-08-30 19:29:54 -05:00
Fabian c08a99c591 c2rust cleanup: Fix boolean literals 2020-08-30 19:29:54 -05:00
Fabian cb1348fdc7 c2rust cleanup: Restore hex constants 2020-08-30 19:29:54 -05:00
Fabian 435608d9f0 c2rust cleanup: Remove unused mut 2020-08-30 19:29:54 -05:00
Fabian 05ca01c7de c2rust cleanup: Remove casts on numeric literals 2020-08-30 19:29:54 -05:00
Fabian d895985e83 c2rust cleanup: Turn while loops into for loops 2020-08-30 19:29:54 -05:00
Fabian 13f4a33231 task_switch_test_mmx: Fix order of checks 2020-08-30 19:29:54 -05:00
Fabian 7620a7cb84 fpu: Refactor (de-)serialisation of f32/f64/f80, add tests for denormals and nans 2020-08-30 19:29:54 -05:00
Fabian 96b703f87c Keep track of whether fpu or mmx register has been written recently, store proper register in fx?save 2020-08-30 19:29:54 -05:00
Fabian 818cece40d Transition from fpu mode on mmx operations 2020-08-30 19:29:54 -05:00
Fabian e70e9dc4b2 Factor the conversion out of fpu_{load,store}_m80, add tests, fix the denormal number case 2020-08-30 19:29:54 -05:00
Fabian aa9d5deefc Warn on task_switch_test with cr4.osfxsr=0 2020-08-30 19:29:54 -05:00
Fabian 1de206da49 Minor: Print cr4 as hex 2020-08-30 19:29:54 -05:00
Fabian 35cd746940 Delete dead code 2020-08-30 19:29:54 -05:00
Fabian 585f720567 Fix sse shifts (shift operand is 64 bit) 2020-08-30 19:29:54 -05:00