Expand description
Image bytecode predecode cache.
Predecoding a javm_exec::PvmProgram is expensive (basic-block
analysis, gas cost computation, instruction predecoding); doing it
per CALL would dominate the per-invocation cost. The cache is
keyed by Image content_hash so identical Images share a single
Predecoded (the bytecode is content-addressed; identical content
always produces identical decoded state).
Stage 3 stores predecoded PvmProgram directly. A future
optimization can swap in JIT-compiled bytes for the same key and
serve both paths from one cache.
Structsยง
- Image
Cache - Map from
Image::content_hashto a parsedPvmProgram. ThePvmProgramis wrapped inArcso the same predecoded body can be referenced from multiple in-flight InstanceEntries (siblings) and from concurrent threads (the kernel may eventually be multi-threaded).