Skip to content

Instantly share code, notes, and snippets.

View JustinMeimar's full-sized avatar
👾

Justin JustinMeimar

👾
View GitHub Profile
@JustinMeimar
JustinMeimar / gist:7e5f264f052f2b864f8cbcb6be342f9c
Last active August 17, 2026 21:09
state of ambermonkey paper
Main Updates from Last week:
- First story change: Reducing the emphasis on AOT Baseline compilation,
elevating the contribution of AOT ICs. Making the argument that a
stuctured Inline Caching IR and separation from code and data enables the
high coverage we see. AOT baseline compilation is kept around only as a
contrast.
- I'm still working out the arguments for section III. I will work on
this tongiht to get your thoughts tomrorrow or later here.
@JustinMeimar
JustinMeimar / gist:cb635caffa5356c511bea993c2d73339
Created July 23, 2026 17:43
AOT_code_discussion_07_23_2026.txt
Notes from code discussion:
- Make AOT loading infallible.
- Baseline interpreter must always be present. Other artifacts
(ICs/ Baseline functions) can still fail to load since corpus is
finite. More MOZ_ASSERTS.
- Remove aot blob YAML field for "kind", becomes internally generated.
@JustinMeimar
JustinMeimar / AOT_build_instructions.md
Last active July 10, 2026 21:59
AOT building and usage

Boostrapping Shell with AOT:

  1. An empty AOTBaselineStub.S scaffold is checked in, but not attached as build input. AOT dumps direct into AOTBaseline.S, which is a build input. First step is: cp js/src/jit/AOTBaselineStub.S js/src/jit/AOTBaseline.S

  2. I have some mozconfigs here, but the only option necessary is: ac_add_options --enable-aot. Then ./mach configure && ./mach build

I've been revisiting some ideas around optimized builtins. Since the paper is de-emphasizing JITless as the primary contribution, it would be nice to have a small performance win. Ideally we find an optimization not previously possible without AOT infrastructure. For this reason I've revived the IC inlining idea under "Profile Guided Speculative Monomorphic IC Inlining". A bit of a word salad.

defining as a source of truth for future reference:
jitless --no-jit-backend
------------------------------------
no dynamic executable memory
aot-interp: --aot-interp --cache-ir-stubs=off
-----------------------------------------------------
use the aot baseline interpreter but without inline cache stubs
or aot-selfhosted code, even if the bootstrap contains it.
@JustinMeimar
JustinMeimar / 04_30_2026_tls_in_aot_code.md
Created April 30, 2026 18:47
problem with TLS used in AOT code when in browser and two explored solutions

problem:

We use TLS to load the &AOTIndirectionTable (TLS -> JSContext -> JSRuntime -> JitRuntime -> AOTIndirectionTable) into a BaselineFrame field, allowing AOT indirections to go through the

@JustinMeimar
JustinMeimar / 04_23_2026_octane_aot_perf.md
Last active April 23, 2026 21:01
octane benchmark on aot mode

config:

  • release build of shell
  • amd ryzen 5 7640u, pinned to core 2, governor=performance, boost=off
  • aot ic corpus accrued directly from octane (all ic stubs are pertinent)
  • subset of all self-hosted builtins are provided AOT [1]
  • n=2 iterations per shell config
  • all comparissons done against vm-only as a baseline
@JustinMeimar
JustinMeimar / aot_ics.txt
Last active April 16, 2026 19:48
semi-organized thoughts on AOT ICs
On AOT ICs:
I'm beginning to appreciate how IC stubs resemble tiny
programs. Compared to the deterministic codegen, like in
blinterp and builtins, there is much more combinatorial
variability. Some stub traits have proved more
challenging than others to provide relocations for.
Here is a brief, informal taxonomy, ordered from least
to most difficult:
@JustinMeimar
JustinMeimar / 03_31_2025_masm_api_update.md
Last active April 2, 2026 17:55
03_31_2025_masm_api_update.md

A short update on the current AOT api:

We discussed previously whether ImmPtr is suitable for AOT interception.

  • ImmPtr should be the right place to catch runtime ptrs being emitted through the masm. However there are some issues:
  1. a few uses of ImmPtr(nullptr) prevent a verified
@JustinMeimar
JustinMeimar / 03_23_2025_octane.md
Last active March 23, 2026 18:14
benchmarking: AOT w/ semi-optimized indirection on Octane

Running octane with and without AOT mode:

Benchmarking setup:

  • Ryzen5 7640U
  • Dynamic freq. scaling off
  • Disable hyperthreading
  • Running 5 times each for AOT/non-AOT
  • Pin process to one core