Commit graph

165 commits

Author SHA1 Message Date
Fabian d31e0edb5a Improved code generation for jitted memory reads and writes 2020-12-31 19:14:30 -06:00
Fabian c406d65317 Add kvm-unit-test target with release mode (for benchmarks) 2020-12-31 19:14:30 -06:00
Fabian 4e68de9c4d Test reset/restart 2020-12-31 19:14:30 -06:00
Fabian ea50e29e5f Remove dead & improve 2020-12-31 19:14:29 -06:00
Fabian d0fb1a78d9 Experimental xterm.js support (#172, #227) 2020-12-31 19:14:29 -06:00
Fabian 04d9a6102c Fix file being created in PWD when compiling kvm-unit-test 2020-12-31 19:14:29 -06:00
Fabian 48a9847d16 s/oxide// 2020-12-31 19:14:29 -06:00
Fabian c97301842e Put jit_cache_array and jit_page_first_entry into global state, reduces the size of the .wasm files by 8MB because for some reason the rust compiler decides to put them into the data section 2020-12-31 19:14:29 -06:00
Fabian 941208c948 Remove defunct test coverage 2020-12-31 19:14:29 -06:00
Fabian c994dbc08c Fix spurious </a> in index.html 2020-12-31 19:14:29 -06:00
Fabian 9efade88ee Fix compilation with latest closure compiler 2020-12-31 19:14:29 -06:00
Fabian b3a3d930e3 make default makefile target the debug build 2020-12-31 19:14:29 -06:00
Fabian 753f67bfab Makefile: Clean up and add all-tests target 2020-12-31 19:14:29 -06:00
Fabian af5d01fff6 Makefile: Add tests-release target 2020-12-31 19:14:28 -06:00
Fabian fc954cecea Update libwabt (fix failing decoding of large generated modules) 2020-08-30 19:37:15 -05:00
Amaan Cheval 11831d1b60 Upcase strip_debug for consistency in Makefile 2020-08-30 19:37:15 -05:00
Ernest Wong c273741405 Add tests for file storage chunking 2020-08-30 19:37:15 -05:00
Fabian 7a31922078 Add test for bzimage_initrd_from_filesystem 2020-08-30 19:37:15 -05:00
Fabian 92346f51ed Add test for clean shutdown 2020-08-30 19:37:15 -05:00
Fabian e1c6116a0f Implement Linux kernel boot protocol, accept bzimage/initrd as boot configuration 2020-08-30 19:37:14 -05:00
Fabian 2ee68c960a Make --strip-debug configurable (for release builds) 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 1a6f3cfef3 Compile from and to ECMASCRIPT_2017
- Want to use async/await features.
- We need modern web browsers to run Web Assembly anyway.
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 27a374e4fd Make warnings fatal in Rust test 2020-08-30 19:29:54 -05:00
Fabian f1b50734c9 c2rust cleanup: Remove build system 2020-08-30 19:29:54 -05:00
Fabian 1faf8ccc86 Allocate memory via Rust instead of ahead-of-time 2020-08-30 19:29:53 -05:00
Fabian 01061dc4b6 The final Rust porting
This commit contains the final changes requires for porting all C code
to Rust and from emscripten to llvm:

- tools/wasm-patch-indirect-function-table.js: A script that rewrites
  the wasm generated by llvm to remove the table limit
- tools/rust-lld-wrapper: A wrapper around rust-lld that removes
  arguments forced by rustc that break compilation for us
- src/rust/cpu2/Makefile: A monstrosity to postprocess c2rust's output
- gen/generate_interpreter.js: Ported to produce Rust instead of C
- src/rust/*: A few functions and macros to connect the old Rust code
  and the new Rust code
- src/*.js: Removes the loading of the old emscripten wasm module and
  adapts imports and exports from emscripten to llvm
2020-08-30 19:29:53 -05:00
Awal Garg 2541789ccc run rust tests with nightly toolchain 2020-08-30 19:29:53 -05:00
Fabian 766c50b6fb Enable api tests 2020-08-30 19:29:13 -05:00
Fabian c6764859b9 Add verbose to cargo builds 2020-08-30 19:29:13 -05:00
Ernest Wong bda133ba49 JSHint the lib directory 2020-08-30 19:29:13 -05:00
Fabian 3a8d644d75 Port jit to Rust
The following files and functions were ported:
- jit.c
- codegen.c
- _jit functions in instructions*.c and misc_instr.c
- generate_{analyzer,jit}.js (produces Rust code)
- jit_* from cpu.c

And the following data structures:
- hot_code_addresses
- wasm_table_index_free_list
- entry_points
- jit_cache_array
- page_first_jit_cache_entry

Other miscellaneous changes:
- Page is an abstract type
- Addresses, locals and bitflags are unsigned
- Make the number of entry points a growable type
- Avoid use of global state wherever possible
- Delete string packing
- Make CachedStateFlags abstract
- Make AnalysisType product type
- Make BasicBlockType product type
- Restore opcode assertion
- Set opt-level=2 in debug mode (for test performance)
- Delete JIT_ALWAYS instrumentation (now possible via api)
- Refactor generate_analyzer.js
- Refactor generate_jit.js
2020-08-30 19:29:13 -05:00
Fabian ba0c875254 libwabt: Download stable release 2020-08-30 19:27:07 -05:00
Fabian c06d141ea6 Run full tests in debug mode 2020-08-30 19:27:07 -05:00
Awal Garg bcefd54349 fix rustfmt invocation 2020-08-30 19:27:07 -05:00
Awal Garg 853bf477cc minor fixes 2020-08-30 19:27:07 -05:00
Awal Garg e33cc8f072 rust restructuring, some refactoring 2020-08-30 19:27:07 -05:00
Awal Garg 5d0d683bbc fix deps and remove trailing space 2020-08-30 19:27:07 -05:00
Awal Garg 75ed04e959 copy wasmgen bins instead of moving 2020-08-30 19:27:07 -05:00
Awal Garg fc7f4b468c add wasmgen tests to makefile 2020-08-30 19:27:07 -05:00
Awal Garg 95a65153f4 fix commit_instruction_body_to_cs 2020-08-30 19:27:07 -05:00
Awal Garg 03f0da9525 use wg_ prefix for wasmgen, add tests to makefile 2020-08-30 19:27:07 -05:00
Ernest Wong 129269fc14 Add devices test to CI + update tests to linux4 2020-08-30 19:27:07 -05:00
Fabian 4129335287 Stats printing 2020-08-30 19:27:02 -05:00
Fabian 9afb7eb39c Instruction stats: Instrument code to count how often certain opcodes are used 2020-08-30 19:27:02 -05:00
Fabian f2274e0a60 Fix nasm test with forced jit
This is a (partial) fix for #8. It manually forces compilation of the
first set of basic blocks in the nasm tests, waits for the blocks to be
compiled and then runs the test. It doesn't make use of the fragile
compile-time machinery to force compilation.

Analysis currently doesn't follow execution after the popf instructions,
which is included in most tests. It has been manually verified that
tests pass when the popf instruction is compiled, and this limitation
will be lifted soon.

Analysis also doesn't follow through call and return instructions, so
nasm tests can't currently test these in their compiled form.
2020-07-21 20:10:14 -05:00
Fabian 91480947da Expect test: Add missing dependency on build/v86-debug.wasm 2020-07-21 20:10:14 -05:00
Fabian e6af9f3d7f Expect tests 2020-07-21 20:10:14 -05:00
Fabian f093e23f9e Explicity use -std=c11 2020-07-21 20:10:14 -05:00