Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Redline: trampolines must be precomputed at build time; the Cranelift bridge must not be a runtime dependency

Chiusa
#202 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@andreaTP ci sta già lavorando.

Dal 7/10/2026.

  • #228 di @andreaTP — aperta

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Refactoring
Chiarezza
Da chiarire
Stato di attività
Attiva
Stack tecnologico
java, wasm

Direzione di ricerca

Trace JffiNativeMachine, the Panama NativeMachine, CraneliftBridge, and NativeCodeSerializer to map where trampolines are compiled and serialized. Start by comparing constructor-time compilation with the .native payload and runner dependencies. Done means all listed trampoline sets are available from build-time output, instance-specific addresses are handled by indirection or relocations, and both runner modules no longer require the bridge at runtime.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Both native machines (JffiNativeMachine and the Panama NativeMachine) compile their ABI trampolines in the constructor, i.e. once per instance:

try (var bridge = new CraneliftBridge()) {   // Instance.builder(Cranelift.load())...build()
    bridge.init(RedlineTarget.detectHost()...triple());
    var trampolines = bridge.compileTrampolines(compiledCode, funcTypesByBody, importTypes, importStubAddrs, ...);

CraneliftBridge() instantiates the Cranelift compiler (the 2.5 MB cranelift_bridge.wasm, on the bytecode compiler) every time. The build-time output (NativeCodeSerializer) only contains the function bodies, no trampolines. Measured with quickjs4j (Endive 1.1.0, javy module): 0.8–2.9 s and ~+26 MB RSS per Instance, versus ~0.1 s for the build-time compiled bytecode. Anything that creates instances regularly (camel-quickjs recycles an engine every few thousand evaluations) is dominated by this.

Expected design: everything is precomputed at build time. The runners only load and link, and redline-bridge-experimental (the Cranelift compiler) must not be a runtime dependency of redline-runner-experimental / redline-runner-jffi-experimental at all; today both declare it in compile scope.

Concretely:

  • the build-time compiler emits the entry trampolines, import trampolines, internal stub trampolines and memmove/memset trampolines next to the function bodies (one set per target), in the .native payload;
  • the per-instance addresses they embed today (import closure stubs, watchdog/memgrow stubs, memmove/memset) are either read indirectly from the ctx buffer / function table, so the trampolines are position-independent, or patched at load time through a small relocation table in the payload;
  • the runners drop the dependency on the bridge; the bridge stays a build-time-only artifact.

🤖 Generated with Claude Code

Lingua principale
Java
Stelle
310
Fork
23
Merge medio
1g 22h
PR unite (30g)
34

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di bytecodealliance/endive

Tutte le issue di bytecodealliance/endive

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.