fjit (page): current JIT entries stay out of batches too

After an epoch forgets, the JIT no longer knows what it made, and
re-translated served callees into every batch (libasound 28 MiB of wasm
by HK's menu, hp12).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_1896c5b302a54696aaa92c5f4047f20b
This commit is contained in:
velzieandClaude Opus 5.5 committed 2026-10-09 04:29:04 -04:00
1 parent 58e95157f9
commit 977a2236a4
2 files changed
+14 -1

No files matched your search

+7
View File
@@ -1072,6 +1072,13 @@ pub(crate) fn unit_serves(addr: u64) -> bool {
ftab(|m| m.get(addr).is_some_and(|f| m.install(f.install).tier == Tier::Unit))
}
/// Whether a current JIT function serves `addr` (its pages unchanged since).
/// After the JIT forgets (`fjit::on_retire`) this is what still knows
/// which functions it has made.
pub(crate) fn jit_serves(addr: u64) -> bool {
ftab(|m| m.get(addr).is_some_and(|f| m.install(f.install).tier == Tier::Jit && crate::fjit::current(f.install)))
}
/// How many units are published: a Worker installs up to this many.
#[no_mangle]
pub extern "C" fn gex_cgen_count() -> u32 {
+7 -1
View File
@@ -416,8 +416,14 @@ fn translate_root(addr: u64) -> Option<u32> {
// also what instruction fetch asks of every byte, and the JIT publishes
// resume points inside functions, so counting its own entries made it
// decode `cmovle` in libxcb's `_xcb_in_read_block` as illegal (hu15).
// (That entry was a function of libdbus, unloaded since: the epoch now
// forgets those. A current JIT function's entry counts again: after a
// forgetting the JIT no longer knows what it made, and re-translated
// libasound into 28 MiB of wasm by the menu, hp12. Fetch meeting one
// inside another function would need an entry in the middle of a
// function, which misses no longer make, `mid_function`.)
let served_memo = std::cell::RefCell::new(std::collections::HashMap::<u64, bool>::new());
let served = |a: u64| a != addr && *served_memo.borrow_mut().entry(a).or_insert_with(|| crate::cgen::unit_serves(a));
let served = |a: u64| a != addr && *served_memo.borrow_mut().entry(a).or_insert_with(|| crate::cgen::unit_serves(a) || crate::cgen::jit_serves(a));
let executable = |a: u64| {
exec.iter().any(|&(s, e)| a >= s && a < e)
&& !crate::cgen::elfprov::provided(a)