Abstract
Method inlining and data flow analysis are two major optimization components for effective program transformations, but they often suffer from the existence of rarely or never executed code contained in the target method. One major problem lies in the assumption that the compilation unit is partitioned at method boundaries. This article describes the design and implementation of a region-based compilation technique in our dynamic optimization framework, in which the compiled regions are selected as code portions without rarely executed code. The key parts of this technique are the region selection, partial inlining, and region exit handling. For region selection, we employ both static heuristics and dynamic profiles to identify and eliminate rare sections of code. The region selection process and method inlining decisions are interwoven, so that method inlining exposes other targets for region selection, while the region selection in the inline target conserves the inlining budget, allowing more method inlining to be performed. The inlining process can be performed for parts of a method, not just for the entire body of the method. When the program attempts to exit from a region boundary, we trigger recompilation and then use on-stack replacement to continue the execution from the corresponding entry point in the recompiled code. We have implemented these techniques in our Java JIT compiler, and conducted a comprehensive evaluation. The experimental results show that our region-based compilation approach achieves approximately 4% performance improvement on average, while reducing the compilation overhead by 10% to 30%, in comparison to the traditional method-based compilation techniques.
- Arnold, M., Hind, M., and Ryder, B. G. 2002. Online feedback-directed optimization of Java. In Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages and Applications. ACM Press, New York, 111--129.]] Google Scholar
- Bala, V., Duesterwald, E., and Banerjia, S. 2000. Dynamo: A transparent dynamic optimization system. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation. ACM Press, New York, 1--12.]] Google Scholar
- Ball, T. and Larus, J. 1993. Branch prediction for free. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation. ACM Press, New York, 300--313.]] Google Scholar
- Bruening, D. and Duesterwald, E. 2000. Exploring optimal compilation unit shapes for an embedded just-in-time compiler. In Proceedings of the ACM SIGPLAN Workshop on Feedback-Directed and Dynamic Optimization (FDDO-3). ACM Press, New York.]]Google Scholar
- Bruening, D., Garnett, T., and Amarasinghe, S. 2003. An infrastructure for adaptive dynamic optimization. In Proceedings of the ACM/IEEE International Symposium on Code Generation and Optimization (CGO). IEEE Computer Society, Los Alamitos, 265--275.]] Google Scholar
- Chambers, C. and Ungar, D. 1991. Making pure object-oriented languages practical. In Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages and Applications. ACM Press, New York, 1--15.]] Google Scholar
- Chang, P., Mahlke, S., and Hwu, W. 1991. Using profile information to assist classic code optimizations. Softw. Pract. Exper. 21, 12 (Dec.), 1301--1321.]] Google Scholar
- Chen, W., Lerner, S., Chaiken, R., and Gillies, D. 2000. Mojo: A dynamic optimization system. In Proceedings of the ACM SIGPLAN Workshop on Feedback-Directed and Dynamic Optimization (FDDO-3). ACM Press, New York.]]Google Scholar
- Cierniak, M., Lueh, G., and Stichnoth, J. 2000. Practicing judo: Java under dynamic optimizations. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation. ACM Press, New York, 13--26.]] Google Scholar
- Cohn, R. and Lowney, P. 1996. Hot cold optimization of large Windows/NT applications. In Proceedings of the 29th International Symposium on Microarchitecture. IEEE Computer Society, Los Alamitos, 80--89.]] Google Scholar
- Detlefs, D. and Agesen, O. 1999. Inlining of virtual methods. In 13th European Conference on Object-Oriented Programming. LNCS 1628, Springer-Verlag, Berlin, 258--278.]] Google Scholar
- Duesterwald, E. and Bala, V. 2000. Software profiling for hot path prediction: Less is more. In Proceedings of the 9th ACM Conference on Architectural Support on Programming Languages and Operating Systems. ACM Press, New York, 202--211.]] Google Scholar
- Fink, S. J. and Qian, F. 2003. Design, implementation and evaluation of adaptive recompilation with on-stack replacement. In Proceedings of the ACM/IEEE International Symposium on Code Generation and Optimization (CGO). IEEE Computer Society, Los Alamitos, 241--252.]] Google Scholar
- Hank, R. E. 1996. Region-based compilation. Ph.D. thesis, University of Illinois at Urbana-Champaign, Urbana.]] Google Scholar
- Hank, R. E., Hwu, W. W., and Rau, B. R. 1995. Region-based compilation: An introduction and motivation. In Proceedings of the 28th International Symposium on Microarchitecture. IEEE Computer Society, Los Alamitos, 158--168.]] Google Scholar
- Hank, R. E., Mahlke, S. A., Bringmann, R. A., Gyllenhaal, J. C., and Hwu, W. W. 1993. Superblock formation using static program analysis. In Proceedings of the 26th International Symposium on Microarchitecture. IEEE Computer Society, Los Alamitos, 247--255.]] Google Scholar
- Hölzle, U. 1994. Adaptive optimization for SELF: Reconciling high performance with exploratory programming. Ph.D. thesis, (CS-TR-94-1520) Stanford University, Stanford.]]Google Scholar
- Hwu, W., Mahlke, S., Chen, W., Chang, P., Warter, N., Bringmann, R., Ouellete, R., Hank, R., Kiyohara, T., Haab, G., Holm, J., and Lavery, D. 1993. The superblock: An effective technique for VLIW and superscalar compilation. J. Supercomput. 7, 1-2 (May), 229--248.]] Google Scholar
- IBM Corporation. 2002. WebSphere Studio Application Developer. Available at http://www.ibm.com/software/ad/studio.]]Google Scholar
- Ishizaki, K., Kawahito, M., Yasue, T., Komatsu, H., and Nakatani, T. 2000. A study of devirtualization techniques for a Java just-in-time compiler. In Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages and Applications. ACM Press, New York, 294--310.]] Google Scholar
- Java Grande Forum. 2000. Java grande benchmark. Available at http://www.epcc.ed.ac.uk/javagrande/sequential.html.]]Google Scholar
- Just System Corporation. 1998. IchitaroArk for Java, Japanese word processor system. Available at http://www.justsystem.com/ark/index.html.]]Google Scholar
- Knoop, J., Ruthing, O., and Steffen, B. 1994. Partial dead code elimination. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation. ACM Press, New York, 147--158.]] Google Scholar
- Lowney, P., Freudenberger, S., Karzes, T., Lichtenstein, W., Nix, R., O'Donnell, J., and Ruttenberg, J. 1993. The multiflow trace scheduling compiler. J. Supercomput. 7, 1-2 (May), 51--142.]] Google Scholar
- Mikheev, V. V., Fedoseev, S. A., Sukharev, V. V., and Lipsky, N. V. 2002. Effective enhancement of loop versioning in Java. In Proceedings of the 11th International Conference on Compiler Construction. LNCS 2304, Springer-Verlag, Berlin, 293--306.]] Google Scholar
- Ogasawara, T., Komatsu, H., and Nakatani, T. 2001. A study of exception handling and its dynamic optimization for Java. In Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages and Applications. ACM Press, New York, 83--95.]] Google Scholar
- Paleczny, M., Vick, C., and Click, C. 2001. The Java HotSpot server compiler. In Proceedings of the 1st Java Virtual Machine Research and Technology Symposium (JVM '01). USENIX Association, Berkley, 1--12.]] Google Scholar
- Pettis, K. and Hansen, R. 1990. Profile guided code positioning. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation. ACM Press, New York, 16--27.]] Google Scholar
- Standard Performance Evaluation Corporation. 2000. SPECjvm98 and SPECjbb2000 benchmarks. Available at http://www.spec.org/osg.]]Google Scholar
- Suganuma, T., Ogasawara, T., Takeuchi, M., Yasue, T., Kawahito, M., Ishizaki, K., Komatsu, H., and Nakatani, T. 2000. Overview of the IBM Java just-in-time compiler. IBM Syst. J. 39, 1 (Jan.), 175--193.]] Google Scholar
- Suganuma, T., Yasue, T., Kawahito, M., Komatsu, H., and Nakatani, T. 2001. A dynamic optimization framework for a Java just-in-time compiler. In Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages and Applications. ACM Press, New York, 180--194.]] Google Scholar
- Suganuma, T., Yasue, T., Kawahito, M., Komatsu, H., and Nakatani, T. 2005. Design and evaluation of dynamic optimizations for a Java just-in-time compiler. ACM Trans. Prog. Lang. Syst. 27, 4 (July). 732--785.]] Google Scholar
- Suganuma, T., Yasue, T., and Nakatani, T. 2002. An empirical study of method inlining for a Java just-in-time compiler. In Proceedings of the 2nd Java Virtual Machine Research and Technology Symposium (JVM '02). USENIX Association, Berkeley, 91--104.]] Google Scholar
- Suganuma, T., Yasue, T., and Nakatani, T. 2003. A region-based compilation technique for a Java just-in-time compiler. In Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation. ACM Press, New York, 312--323.]] Google Scholar
- Triantafyllis, S., Vachharajani, M., and August, D. I. 2002. Procedure boundary elimination for EPIC compilers. In Proceedings of the Second Workshop on Explicitly Parallel Instruction Computer Architectures and Compiler Technology. IEEE Computer Society, Los Alamitos.]]Google Scholar
- Way, T., Breech, B., and Pollock, L. 2000. Region formation analysis with demand-driven inlining for region-based optimization. In Proceedings of International Conference on Parallel Architectures and Compilation Techniques. IEEE Computer Society, Los Alamitos, 24--36.]] Google Scholar
- Way, T. and Pollock, L. 2002. Evaluation of a region-based partial inlining algorithm for an ILP optimizing compiler. In Proceedings of Conference on Parallel and Distributed Processing Techniques and Applications. IEEE Computer Society, Los Alamitos, 552--556.]] Google Scholar
- Whaley, J. 2001. Partial method compilation using dynamic profile information. In Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages and Applications. ACM Press, New York, 166--179.]] Google Scholar
- Whaley, J. and Rinard, M. 1999. Compositional pointer and escape analysis for Java programs. In Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages and Applications. ACM Press, New York, 187--206.]] Google Scholar
Index Terms
A region-based compilation technique for dynamic compilers
Recommendations
A region-based compilation technique for a Java just-in-time compiler
PLDI '03: Proceedings of the ACM SIGPLAN 2003 conference on Programming language design and implementationMethod inlining and data flow analysis are two major optimization components for effective program transformations, however they often suffer from the existence of rarely or never executed code contained in the target method. One major problem lies in ...
A region-based compilation technique for a Java just-in-time compiler
Method inlining and data flow analysis are two major optimization components for effective program transformations, however they often suffer from the existence of rarely or never executed code contained in the target method. One major problem lies in ...
Design and evaluation of dynamic optimizations for a Java just-in-time compiler
The high performance implementation of Java Virtual Machines (JVM) and Just-In-Time (JIT) compilers is directed toward employing a dynamic compilation system on the basis of online runtime profile information. The trade-off between the compilation ...








Comments