Implement AArch64 assembler infrastructure for JIT compiler
Add the low-level building blocks for JIT compilation in crates/js/src/jit/:
- ExecutableMemory: mmap-based allocator with W^X policy using MAP_JIT and
pthread_jit_write_protect_np for Apple Silicon
- JitBuffer: manages code pages with automatic overflow to new pages,
tracks used/free space per page
- CodePtr: type-safe wrapper for calling into JIT-compiled code
- Assembler: full AArch64 instruction emitter with label-based forward
references and backpatching, covering:
- Arithmetic: add, sub, mul, sdiv (register and immediate)
- Logic: and, orr, eor, lsl, lsr, asr
- Memory: ldr, str (register/immediate/pre-index/post-index), stp, ldp
- Branch: b, b.cond, bl, blr, br, ret, cbz, cbnz
- Comparison: cmp, tst
- Move: mov, movz, movk, mov_imm64
- FP: fmov, fadd, fsub, fmul, fdiv, fcmp, scvtf, fcvtzs
- Entry/exit stubs: prologue/epilogue saving/restoring callee-saved
registers (x19-x28, fp, lr) with proper frame pointer setup
- 88 tests including instruction encoding verification and execution
tests that JIT-compile and run AArch64 code
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>