Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1145/2151024.2151035acmconferencesArticle/Chapter ViewAbstractPublication PagesveeConference Proceedingsconference-collections
research-article

Swift: a register-based JIT compiler for embedded JVMs

Published: 03 March 2012 Publication History

Abstract

Code quality and compilation speed are two challenges to JIT compilers, while selective compilation is commonly used to trade-off these two issues. Meanwhile, with more and more Java applications running in mobile devices, selective compilation meets many problems. Since these applications always have flat execution profile and short live time, a lightweight JIT technique without losing code quality is extremely needed. However, the overhead of compiling stack-based Java bytecode to heterogeneous register-based machine code is significant in embedded devices. This paper presents a fast and effective JIT technique for mobile devices, building on a register-based Java bytecode format which is more similar to the underlying machine architecture. Through a comprehensive study on the characteristics of Java applications, we observe that virtual registers used by more than 90% Java methods can be directly fulfilled by 11 physical registers. Based on this observation, this paper proposes Swift, a novel JIT compiler on register-based bytecode, which generates native code for RISC machines. After mapping virtual registers to physical registers, the code is generated efficiently by looking up a translation table. And the code quality is guaranteed by the static compiler which is used to generate register-based bytecode. Besides, we design two lightweight optimizations and an efficient code unloader to make Swift more suitable for embedded environment. As the prevalence of Android, a prototype of Swift is implemented upon DEX bytecode which is the official distribution format of Android applications.
Swift is evaluated with three benchmarks (SPECjvm98, EmbeddedCaffeineMark3 and JemBench2) on two different ARM SOCs: S3C6410 (armv6) and OMAP3530 (armv7). The results show that Swift achieves a speedup of 3.13 over the best-performing interpreter on the selected benchmarks. Compared with the state-of-the-art JIT compiler in Android, JITC-Droid, Swift achieves a speedup of 1.42.

References

[1]
Dalvik executable format. http://source.android.com/tech/dalvik/dex-format.html.
[2]
Embeddedcaffeinemark3.0. Pendragon Software Corporation.
[3]
Jazelle rct technology. ARM Ltd., http://www.arm.com/products/ processors/technologies/jazelle.php.
[4]
Specjvm98. Standard Performance Evaluation Corporation.
[5]
A.-R. Adl-Tabatabai, G. Langdale, S. Lucco, and R. Wahbe. Efficient and language-independent mobile programs. In Proceedings of the ACM SIGPLAN 1996 conference on Programming language design and implementation, PLDI '96, pages 127--136, New York, NY, USA, 1996. ACM.
[6]
C. Badea, A. Nicolau, and A. V. Veidenbaum. A simplified java bytecode compilation system for resource-constrained embedded processors. In Proceedings of the 2007 international conference on Compilers, architecture, and synthesis for embedded systems, CASES '07, pages 218--228, New York, NY, USA, 2007. ACM.
[7]
M. Bebenita, F. Brandner, M. Fahndrich, F. Logozzo, W. Schulte, N. Tillmann, and H. Venter. Spur: a trace-based jit compiler for cil. In Proceedings of the ACM international conference on Object oriented programming systems languages and applications, OOPSLA '10, pages 708--725, New York, NY, USA, 2010. ACM.
[8]
M. Bebenita, M. Chang, G. Wagner, A. Gal, C. Wimmer, and M. Franz. Trace-based compilation in execution environments without interpreters. In Proceedings of the 8th International Conference on the Principles and Practice of Programming in Java, PPPJ '10, pages 59--68, New York, NY, USA, 2010. ACM.
[9]
C. F. Bolz, A. Cuni, M. Fijalkowski, and A. Rigo. Tracing the meta-level: Pypy's tracing jit compiler. In Proceedings of the 4th workshop on the Implementation, Compilation, Optimization of Object-Oriented Languages and Programming Systems, ICOOOLPS '09, pages 18--25, New York, NY, USA, 2009. ACM.
[10]
D. Bornstein. Dalvik vm internals. http://sites.google.com/site/io/ dalvik-vm-internals.
[11]
B. Cheng and B. Buzbee. A jit compiler for android's dalvik vm. http://www.google.com/events/io/2010/sessions/jit-compiler-androids-dalvik-vm.html.
[12]
M. Cierniak, M. Eng, N. Glew, B. Lewis, and J. Stichnoth. The open runtime platform: a flexible high-performance managed runtime environment: Research articles. Concurr. Comput. : Pract. Exper., 17:617--637, April 2005.
[13]
B. Davis, A. Beatty, K. Casey, D. Gregg, and J. Waldron. The case for virtual register machines. In Proceedings of the 2003 workshop on Interpreters, virtual machines and emulators, IVME '03, pages 41--49, New York, NY, USA, 2003. ACM.
[14]
M. A. Ertl and D. Gregg. Optimizing indirect branch prediction accuracy in virtual machine interpreters. In Proceedings of the ACM SIGPLAN 2003 conference on Programming language design and implementation, PLDI '03, pages 278--288, New York, NY, USA, 2003. ACM.
[15]
M. A. Ertl and D. Gregg. The structure and performance of efficient interpreters. Journal of Instruction-Level Parallelism, 5:2003, 2003.
[16]
A. Gal, B. Eich, M. Shaver, D. Anderson, D. Mandelin, M. R. Haghighat, B. Kaplan, G. Hoare, B. Zbarsky, J. Orendorff, J. Ruderman, E. W. Smith, R. Reitmaier, M. Bebenita, M. Chang, and M. Franz. Trace-based just-in-time type specialization for dynamic languages. In Proceedings of the 2009 ACM SIGPLAN conference on Programming language design and implementation, PLDI '09, pages 465--478, New York, NY, USA, 2009. ACM.
[17]
A. Gal, C. W. Probst, and M. Franz. Hotpathvm: an effective jit compiler for resource-constrained devices. In Proceedings of the 2nd international conference on Virtual execution environments, VEE '06, pages 144--153, New York, NY, USA, 2006. ACM.
[18]
J. Gosling. Java intermediate bytecodes. In Papers from the 1995 ACM SIGPLAN workshop on Intermediate representations, IR '95, pages 111--118, New York, NY, USA, 1995. ACM.
[19]
S. Guo and J. Palsberg. The essence of compiling with traces. In Proceedings of the 38th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages, POPL '11, pages 563--574, New York, NY, USA, 2011. ACM.
[20]
I. Hiroshi, H. Hiroshige, W. Peng, and N. Toshio. A trace-based java jit compiler retrofitted from a method-based compiler. In Proceedings of the 8th annual IEEE/ACM international symposium on Code generation and optimization, CGO '11, New York, NY, USA, 2011. ACM.
[21]
D.-H. Jung, S.-M. Moon, and H.-S. Oh. Hybrid java compilation and optimization for digital tv software platform. In Proceedings of the 8th annual IEEE/ACM international symposium on Code generation and optimization, CGO '10, pages 73--81, New York, NY, USA, 2010. ACM.
[22]
A. Krall. Efficient javavm just-in-time compilation. In Proceedings of the 1998 International Conference on Parallel Architectures and Compilation Techniques, PACT '98, pages 205--, Washington, DC, USA, 1998. IEEE Computer Society.
[23]
C. Krintz and B. Calder. Using annotations to reduce dynamic optimization time. SIGPLAN Not., 36:156--167, May 2001.
[24]
C. Krintz and B. Calder. Using annotations to reduce dynamic optimization time. In Proceedings of the ACM SIGPLAN 2001 conference on Programming language design and implementation, PLDI '01, pages 156--167, New York, NY, USA, 2001. ACM.
[25]
G. J. Myers. The case against stack-oriented instruction sets. SIGARCH Comput. Archit. News, 6:7--10, August 1977.
[26]
M. Paleczny, C. Vick, and C. Click. The java hotspot server compiler. In In USENIX Java Virtual Machine Research and Technology Symposium, pages 1--12, 2001.
[27]
T. H. Romer, D. Lee, G. M. Voelker, A. Wolman, W. A. Wong, J.-L. Baer, B. N. Bershad, and H. M. Levy. The structure and performance of interpreters. In Proceedings of the seventh international conference on Architectural support for programming languages and operating systems, ASPLOS-VII, pages 150--159, New York, NY, USA, 1996. ACM.
[28]
M. Schoeberl, T. B. Preusser, and S. Uhrig. The embedded java benchmark suite jembench. In Proceedings of the 8th International Workshop on Java Technologies for Real-Time and Embedded Systems, JTRES '10, pages 120--127, New York, NY, USA, 2010. ACM.
[29]
P. U. Schulthess and E. P. Mumprecht. Reply to the case against stack-oriented instruction sets. SIGARCH Comput. Archit. News, 6:24--27, December 1977.
[30]
Y. Shi, D. Gregg, A. Beatty, and M. A. Ertl. Virtual machine showdown: stack versus registers. In Proceedings of the 1st ACM/USENIX international conference on Virtual execution environments, VEE '05, pages 153--163, New York, NY, USA, 2005. ACM.
[31]
T. Suganuma, T. Ogasawara, M. Takeuchi, T. Yasue, M. Kawahito, K. Ishizaki, H. Komatsu, and T. Nakatani. Overview of the ibm java just-in-time compiler. IBM Syst. J., 39:175--193, January 2000.
[32]
G. T. Sullivan, D. L. Bruening, I. Baron, T. Garnett, and S. Amarasinghe. Dynamic native optimization of interpreters. In Proceedings of the 2003 workshop on Interpreters, virtual machines and emulators, IVME '03, pages 50--57, New York, NY, USA, 2003. ACM.
[33]
C.-S. Wang, G. Perez, Y.-C. Chung, W.-C. Hsu, W.-K. Shih, and H.-R. Hsu. A method-based ahead-of-time compiler for android applications. In Proceedings of the 14th international conference on Compilers, architectures and synthesis for embedded systems, CASES '11, pages 15--24, New York, NY, USA, 2011. ACM.
[34]
B.-S. Yang, S.-M. Moon, S. Park, J. Lee, S. Lee, J. Park, Y. C. Chung, S. Kim, K. Ebcioglu, and E. Altman. Latte: A java vm just-in-time compiler with fast and efficient register allocation. In Proceedings of the 1999 International Conference on Parallel Architectures and Compilation Techniques, PACT '99, pages 128--, Washington, DC, USA, 1999. IEEE Computer Society.
[35]
A. Yermolovich, C. Wimmer, and M. Franz. Optimization of dynamic languages using hierarchical layering of virtual machines. In Proceedings of the 5th symposium on Dynamic languages, DLS '09, pages 79--88, New York, NY, USA, 2009. ACM.
[36]
L. Zhang and C. Krintz. Adaptive code unloading for resource-constrained jvms. In Proceedings of the 2004 ACM SIGPLAN/SIGBED conference on Languages, compilers, and tools for embedded systems, LCTES '04, pages 155--164, New York, NY, USA, 2004. ACM.
[37]
L. Zhang and C. Krintz. Profile-driven code unloading for resource-constrained jvms. In Proceedings of the 3rd international symposium on Principles and practice of programming in Java, PPPJ '04, pages 83--90. Trinity College Dublin, 2004.

Cited By

View all
  • (2024)Interactive Programming for Microcontrollers by Offloading Dynamic Incremental CompilationProceedings of the 21st ACM SIGPLAN International Conference on Managed Programming Languages and Runtimes10.1145/3679007.3685062(28-40)Online publication date: 13-Sep-2024
  • (2016)TaintARTProceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security10.1145/2976749.2978343(331-342)Online publication date: 24-Oct-2016
  • (2016)A static region-based compiler for the Dalvik virtual machineSoftware—Practice & Experience10.1002/spe.234446:8(1109-1130)Online publication date: 1-Aug-2016
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
VEE '12: Proceedings of the 8th ACM SIGPLAN/SIGOPS conference on Virtual Execution Environments
March 2012
248 pages
ISBN:9781450311762
DOI:10.1145/2151024
  • cover image ACM SIGPLAN Notices
    ACM SIGPLAN Notices  Volume 47, Issue 7
    VEE '12
    July 2012
    229 pages
    ISSN:0362-1340
    EISSN:1558-1160
    DOI:10.1145/2365864
    Issue’s Table of Contents
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 03 March 2012

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. android
  2. embedded jvm
  3. just-in-time compiler
  4. register-based bytecode

Qualifiers

  • Research-article

Conference

VEE '12

Acceptance Rates

Overall Acceptance Rate 80 of 235 submissions, 34%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)15
  • Downloads (Last 6 weeks)1
Reflects downloads up to 14 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Interactive Programming for Microcontrollers by Offloading Dynamic Incremental CompilationProceedings of the 21st ACM SIGPLAN International Conference on Managed Programming Languages and Runtimes10.1145/3679007.3685062(28-40)Online publication date: 13-Sep-2024
  • (2016)TaintARTProceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security10.1145/2976749.2978343(331-342)Online publication date: 24-Oct-2016
  • (2016)A static region-based compiler for the Dalvik virtual machineSoftware—Practice & Experience10.1002/spe.234446:8(1109-1130)Online publication date: 1-Aug-2016
  • (2015)Static Dalvik Bytecode Optimization for Android ApplicationsETRI Journal10.4218/etrij.15.0114.003637:5(1001-1011)Online publication date: 1-Oct-2015
  • (2014)A lightweight incremental analysis and profiling framework for embedded devicesProceedings of the 17th International Workshop on Software and Compilers for Embedded Systems10.1145/2609248.2609263(60-68)Online publication date: 10-Jun-2014
  • (2014)Extending the PCRE Library with Static Backtracking Based Just-in-Time Compilation SupportProceedings of Annual IEEE/ACM International Symposium on Code Generation and Optimization10.1145/2581122.2544146(306-315)Online publication date: 15-Feb-2014
  • (2014)Extending the PCRE Library with Static Backtracking Based Just-in-Time Compilation SupportProceedings of Annual IEEE/ACM International Symposium on Code Generation and Optimization10.1145/2544137.2544146(306-315)Online publication date: 15-Feb-2014
  • (2023)Verified Transformation of Continuation-Passing Style into Static Single Assignment FormTheoretical Aspects of Software Engineering10.1007/978-3-031-35257-7_2(20-37)Online publication date: 27-Jun-2023
  • (2019)Improved Ahead-of-time Compilation of Stack-based JVM Bytecode on Resource-constrained DevicesACM Transactions on Sensor Networks10.1145/334117015:3(1-44)Online publication date: 13-Aug-2019
  • (2017)Ahead-of-Time Compilation of Stack-Based JVM Bytecode on Resource-Constrained DevicesProceedings of the 2017 International Conference on Embedded Wireless Systems and Networks10.5555/3108009.3108022(84-95)Online publication date: 20-Feb-2017

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media