No abstract
In order to support the needs of non-Java languages, the JSR 292 Expert Group has designed a new bytecode "invokedynamic" which allows JVM bytecodes to contain call sites with pluggable, user-defined behavior. The bytecode is accompanied by a new data type called a "method handle" that reifies the pluggable behavior, in the form of a functional value. The authors have been building the JSR 292 Reference Implementation on top of Oracle's HotSpot JVM. This paper describes their implementation tactics. Interesting subtopics include connecting the novel features of JSR 292 to classic HotSpot optimizations, creating new code optimization techniques for HotSpot in support of JSR 292, using Java (along with HotSpot's customary C++) as an implementation language for method handles, using internally-generated bytecodes as an intermediate language for "freezing" dynamic call sites before optimization, and designing specialized "adapter" calling sequences which match callers and callees of differing type descriptors.
Method inlining is a well-known and effective optimization technique for object-oriented programs. In the context of dynamic compilation, method inlining can be used as an adaptive optimization in order to eliminate the overhead of frequently executed calls. This work presents an implementation of method inlining in the CACAO virtual machine. On-stack replacement is used for installing optimized code and for deoptimizing code when optimistic assumptions of the optimizer are broken by dynamic class loading. Three inlining heuristics are compared using empirical results from a set of benchmark programs. The best heuristic eliminates 51.5% up to 99.96% of all executed calls and improves execution time up to 18%.
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.
customersupport@researchsolutions.com
10624 S. Eastern Ave., Ste. A-614
Henderson, NV 89052, USA
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
Copyright © 2024 scite LLC. All rights reserved.
Made with 💙 for researchers
Part of the Research Solutions Family.