Lightweight On-Stack Replacement in Languages with Unstructured Loops
summary
Counts backward jumps (back-edges) to detect hot regions, compiles from the back-edge destination to the end of the method, and performs a tail-call into compiled code when ready. API uses a lightweight two-stage check with pollOSR on every back-edge and heavyweight tryOSR only when needed. Implementation adds a frame copy to enable scalar replacement and allocates OSR metadata lazily. Integrated with Truffle’s LLVM bitcode interpreter and the JVM interpreter, it speeds start-up without degrading warmed-up performance.
AI-written summary · about
chapters (9)
- 0:00Introduction
- 0:10Background
- 1:17Loopbased OSR
- 2:57Package OSR
- 4:49OSR Implementation
- 8:19Implementation Details
- 10:17Metadata
- 12:30Benchmarks
- 14:17Next Steps
related talks
14mOn-Stack Replacement for Program Generators and Source-to-Source Compilers
34mWhat happens to your code when you don't look?
18mSuperStack: Superoptimization of Stack-Bytecode via Greedy, Constraint-Based, and SAT(…)
30mOn Automating Hybrid Execution of Ahead-of-Time and Just-in-Time Compiled Code
25mHybrid Execution: Combining Ahead-of-Time and Just-in-Time Compilation
54mWhat Lies Beneath
26mAn Analysis of Compiled Code Reusability in Dynamic Compilation
16mBeyond Relooper: Recursive Translation of Unstructured Control Flow to Structu…
