DOI QR코드

DOI QR Code

Static Dalvik Bytecode Optimization for Android Applications

  • Kim, Jeehong (College of Information and Communication Engineering, Sungkyunkwan University) ;
  • Kim, Inhyeok (College of Information and Communication Engineering, Sungkyunkwan University) ;
  • Min, Changwoo (College of Information and Communication Engineering, Sungkyunkwan University) ;
  • Jun, Hyung Kook (SW & Contents Research Laboratory, ETRI) ;
  • Lee, Soo Hyung (SW & Contents Research Laboratory, ETRI) ;
  • Kim, Won-Tae (SW & Contents Research Laboratory, ETRI) ;
  • Eom, Young Ik (College of Information and Communication Engineering, Sungkyunkwan University)
  • Received : 2014.01.29
  • Accepted : 2015.07.30
  • Published : 2015.10.01

Abstract

Since just-in-time (JIT) has considerable overhead to detect hot spots and compile them at runtime, using sophisticated optimization techniques for embedded devices means that any resulting performance improvements will be limited. In this paper, we introduce a novel static Dalvik bytecode optimization framework, as a complementary compilation of the Dalvik virtual machine, to improve the performance of Android applications. Our system generates optimized Dalvik bytecodes by using Low Level Virtual Machine (LLVM). A major obstacle in using LLVM for optimizing Dalvik bytecodes is determining how to handle the high-level language features of the Dalvik bytecode in LLVM IR and how to optimize LLVM IR conforming to the language information of the Dalvik bytecode. To this end, we annotate the high-level language features of Dalvik bytecode to LLVM IR and successfully optimize Dalvik bytecodes through instruction selection processes. Our experimental results show that our system with JIT improves the performance of Android applications by up to 6.08 times, and surpasses JIT by up to 4.34 times.

Keywords

References

  1. M.J. Cho et al., "AndroScope: An Insightful Performance Analyzer for All Software Layers of the Android-Based Systems," ETRI J., vol. 35, no. 2, Apr. 2013, pp. 259-269. https://doi.org/10.4218/etrij.13.0112.0203
  2. D. Bornstein, "Dalvik Virtual Machine Internals," presented at the Google I/O Developer Conf., San Francisco, CA, USA, 2008.
  3. Y. Shi et al., "Virtual Machine Showdown: Stack versus Registers," ACM Trans. Archit. Code Optimization, vol. 4, no. 4, Jan. 2008, pp. 1-36.
  4. Y. Zhang et al., "Swift: A Register-Based JIT Compiler for Embedded JVMs," Proc. ACM SIGPLAN/SIGOPS Conf. Virtual Execution Environment, London, UK, Mar. 3-4, 2012, pp. 63-74.
  5. R. Hutcherson, Compiler Optimizations: Can You Count on Compilers to Optimize Your Java Code, Java World, 2000. Accessed Jan. 20, 2014. http://www.javaworld.com/javaworld/jw-03-2000/jw-03-javaperf_4.html?page=1
  6. P. Haggar, Java Bytecode: Understanding Bytecode Makes You a Better Programmer, IBM Developer Works, 2001. Accessed Jan. 20, 2014. http://www.ibm.com/developerworks/ibm/library/it-haggar_bytecode/
  7. K, Venugopal, G. Manjunath, and V. Krishnan, "sEc: A Portable Interpreter Optimizing Technique for Embedded Java Virtual Machine," Java Virtual Mach. Res. Technol. Symp., San Francisco, CA, USA, Aug. 1-2, 2002, pp. 127-138.
  8. B. Cheng and B. Buzbee, "A JIT Compiler for Android's Dalvik VM," presented at the Google I/O Developer Conf., San Francisco, CA, USA, 2010.
  9. B. Carlstrom, A. Ghuloum, and I. Rogers, "The ART Runtime," presented at the Google I/O Developer Conf., San Francisco, CA, USA, 2014.
  10. C.-S. Wang et al., "A Method-Based Ahead-of-Time Compiler for Android Applications," Proc. Int. Conf. Compiler, Archit. Synthesis Embedded Syst., Taipei, Taiwan, Oct. 9-14, 2011, pp. 15-24.
  11. Y.-K. Lim et al., "A Selective Ahead-of-Time Compiler on Android Device," Int. Conf. Inf. Sci. Appl., Suwon, Rep. of Korea, May 23-25, 2012, pp. 1-6.
  12. J. Absar and D. Shekhar, "Eliminating Partially-Redundant Array-Bounds Check in the Android Dalvik JIT Compiler," Proc. Int. Conf. Principles Practice Programming Java, Kongens Lyngby, Denmark, Aug. 24-26, 2011, pp. 121-128.
  13. C. Wang, Y. Wu, and M. Cintra, "Acceldroid: Co-designed Acceleration of Android Bytecode," IEEE/ACM Int. Symp. Code Generation Optimization, Shenzhen, China, Feb. 23-27, 2013, pp. 1-10.
  14. GCJ-The GNU Compiler for the Java Programming Language. Accessed Jan. 20, 2014. http://gcc.gnu.org/java/
  15. DragonEgg-Using LLVM as a GCC Backend. Accessed Jan. 20, 2014. http://dragonegg.llvm.org/
  16. A.L. Hosking et al., "Partial Redundancy Elimination for Access Path Expressions," Software: Practice and Experience, vol. 31, no. 6, May 2001, pp. 577-600. https://doi.org/10.1002/spe.371
  17. R. Vallee-Rai et al., "Soot: A Java Bytecode Optimization Framework," Conf. Center Adv. Studies Collaborative Res., Toronto, Canada, 2010, pp. 214-224.
  18. N. Geoffray et al., "VMKit: A Substrate for Managed Runtime Environments," Proc. ACM SIGPLAN/SIGOPS Conf. Virtual Execution Environment, Pittsburgh, PA, USA, Mar. 17-19, 2010, pp. 51-62.
  19. C. Lattner and V. Adve, "LLVM: A Compilation Framework for Lifelong Program Analysis & Transformation," Int. Symp. Code Generation Optimization, Palo Alto, CA, USA, Mar. 20-24, 2004, pp. 75-86.
  20. The LLVM Compiler Infrastructure. Accessed Jan. 20, 2014. http://llvm.org/
  21. GCC-The GNU Compiler Collection. Accessed Jan. 20, 2014. http://gcc.gnu.org/
  22. Google Android Dx Tool. Accessed Jan. 20, 2014. http://wing-linux.sourceforge.net/guide/developing/tools/othertools.html
  23. Security Engineering Research Group, "Analysis of Dalvik Virtual Machine and Class Path Library," Institute of Management Sciences, Peshawar, Pakistan, Tech. Rep., Nov. 2009.
  24. LLVM Language Reference Manual. Accessed Jan. 20, 2014. http://llvm.org/docs/LangRef.html
  25. Extensible Metadata in LLVM IR. Accessed Jan. 20, 2014. http://blog.llvm.org/2010/04/extensible-metadata-in-llvm-ir.html
  26. J. Holewinski, "PTX Back-End: GPU Programming with LLVM," presented at the LLVM Developer's Meeting, San Jose, CA, USA, Nov. 8, 2011.
  27. Extending LLVM: Adding Instructions, Intrinsics, Types, etc. Accessed Jan. 20, 2014. http://llvm.org/docs/ExtendingLLVM.html
  28. LLVM's Analysis and Transform Passes. Accessed Jan. 20, 2014. http://llvm.org/docs/Passes.html
  29. The LLVM Target-Independent Code Generator. Accessed Jan. 20, 2014. http://www.llvm.org/docs/CodeGenerator.html
  30. A. Korobeynikov, "Tutorial: Building a Backend in 24 Hours," presented at the LLVM Developer's Meeting, Cupertino, CA, USA, 2009.
  31. Benchmark Pi-The Android Benchmarking Tool. Accessed Jan. 20, 2014. http://androidbenchmark.com/
  32. The Embedded CaffeineMark, Pendragon Software Corporation. Accessed Jan. 20, 2014. http://www.benchmarkhq.ru/cm30/info.html
  33. Galaxy Nexus, Samsung Electronics. Accessed Jan. 20, 2014. http://www.samsung.com/sec/consumer/mobile-phone/mobilephone/skt/SHW-M420STSSC.