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. |
||
---|---|---|
.. | ||
tests | ||
readme.md | ||
run.js |
Expect tests
These so-called "expect tests" test the code generation, i.e. the translation of x86 assembly to Web Assembly. Use the following workflow:
- Hack on the code generator
- Run make
expect-tests
- For each failing test:
- Manually verify that the generated code changes are as expected by the diff
- If so, accept the new code by copying the .actual.wast file over the .wast file and checking the new .wast file into git
In order to add a new expect test:
- Create a new .asm file in tests/
- Run make
expect-tests
- Verify the generated code and use the printed cp command to accept the test
Note that .asm files are translated to flat binaries, not elf files, so a .data section may be meaningless.
For more information, see https://blog.janestreet.com/testing-with-expectations/