Code that loads an address in the code region can't be snapshot as-is, since the dummy CodeBlock is mapped at a different address every run and the number of instructions it takes to load an address depends on it. stable_disasm() collap...alanwu (Alan Wu)
Since CodePtr became an offset into the code region, the fallback in emit_jmp_ptr for targets out of the range of `b` loads that offset instead of the address before `br`, so it jumps to a small address. Every side exit ends with a jump...alanwu (Alan Wu)
generate_branch takes the destination as an offset into the code region, and its far path uses that offset both to size the load and as the value to load before `br`. So it previously jumped to a small address erroneously. Nothing emits...alanwu (Alan Wu)
Without this it shells out to `cargo metadata` which takes about ~15ms per snapshot test. The costs add up quickly considering we give each test a dedicated process. Setting this variable saves ~1.5s in a full test run on my laptop.alanwu (Alan Wu)
Use a single-instruction relaxed add instead of a retry loop (!) for counters when Large System Extensions (LSE) are available. For reference, Apple's M series chips all have LSE. Implementation is straightforward thanks to Rust's `is_a...alanwu (Alan Wu)
Previously, ZJIT required --zjit-stats for showing how many side exits had been taken. As the first point of contact for ZJIT performance observability, this info was too hidden, not least because --zjit-stats has a significant probe eff...alanwu (Alan Wu)
Use a simple `tag,payload` scheme with a variable length integer scheme for the opcodes in zjit_jit_frame_t. The integer scheme (`varint`) uses a set high bit to signal to read more. This is setup work for having locals in the stack map...alanwu (Alan Wu)