CoSSJIT: Combining Static Analysis and Speculation in JIT Compilers
Aditya Anand, Vijay Sundaresan, Daryl Maier, Manas Thakur
Abstract
Just-in-time (JIT) compilers typically sacrifice the precision of program analysis for efficiency, but are capable of performing sophisticated speculative optimizations based on run-time profiles to generate code that is specialized to a given execution. On the contrary, ahead-of-time static compilers can often afford precise flow-sensitive interprocedural analysis, but produce conservative results in scenarios where higher precision could be derived from run-time specialization. In this paper, we propose the first-of-its-kind approach to enrich static analysis with the possibility of speculative optimization during JIT compilation, as well as its usage to perform aggressive stack allocation on a production Java Virtual Machine (JVM). Our approach of combining static analysis with JIT speculation – named CoSSJIT – involves three key contributions. First, we identify the scenarios where a static analysis would make conservative assumptions but a JIT could deliver precision based on run-time speculation. Second, we present the notion of ‘‘speculative conditions’’ and plug them into a static interprocedural dataflow analyzer (whose aim is to identify heap objects that can be allocated on stack), to generate partial results that can be specialized at run-time. Finally, we extend a production JIT compiler to read and enrich static-analysis results with the resolved values of speculative conditions, leading to a practical approach that efficiently combines the best of both worlds. Cherries on the cake: Using CoSSJIT , we obtain 5.7× improvement in stack allocation (translating to performance), while building on a system that ensures functional correctness during JIT compilation.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext d6cff8b9-0ba5-49f3-ad6e-796cf2f762feCited by top-tier papers1
Ask how each one uses itBuilds on6
- Rethinking Java Performance AnalysisStephen M. Blackburn, Zixian Cai, Rui Chen, Xi Yang et al.ASPLOS 2025 · 19 citations
- Efficient Static Vulnerability Analysis for JavaScript with Multiversion Dependency GraphsMafalda Ferreira, Miguel Monteiro, Tiago Brito, Miguel E. Coimbra et al.PLDI 2024 · 13 citations
- Compiler-assisted object inlining with value fieldsRodrigo Bruno, Vojin Jovanovic, Christian Wimmer, Gustavo AlonsoPLDI 2021 · 9 citations
- Reusing Just-in-Time Compiled CodeMeetesh Kalpesh Mehta, Sebastián Krynski, Hugo Musso Gualandi, Manas Thakur et al.OOPSLA 2023 · 9 citations
- Optimistic Stack Allocation and Dynamic Heapification for Managed RuntimesAditya Anand, Solai Adithya, Swapnil Rustagi, Priyam Seth et al.PLDI 2024 · 4 citations
Related papers
- The ART of Sharing Points-to Analysis: Reusing Points-to Analysis Results Safely and EfficientlyShashin Halalingaiah, Vijay Sundaresan, Daryl Maier, V. Krishna NandivadaOOPSLA 2024 · 2 citations
- Hybrid Inlining: A Framework for Compositional and Context-Sensitive Static AnalysisJiangchao Liu, Jierui Liu, Peng Di, Diyu Wu et al.ISSTA 2023 · 3 citations
- Detecting JVM JIT Compiler Bugs via Exploring Two-Dimensional Input SpacesHaoxiang Jia, Ming Wen, Zifan Xie, Xiaochen Guo et al.ICSE 2023 · 21 citations
- Validating JIT Compilers via Compilation Space ExplorationCong Li, Yanyan Jiang, Chang Xu, Zhendong SuSOSP 2023 · 22 citations
- JITfuzz: Coverage-guided Fuzzing for JVM Just-in-Time CompilersMingyuan Wu, Minghai Lu, Heming Cui, Junjie Chen et al.ICSE 2023 · 36 citations
