| 研究生: |
陳富國 Chen, Fuh-Gwo |
|---|---|
| 論文名稱: |
Java虛擬機器的重構與最佳化技術 New Restructuring and Optimization Techniques for Java Virtual Machine |
| 指導教授: |
侯廷偉
Hou, Ting-Wei |
| 學位類別: |
博士 Doctor |
| 系所名稱: |
工學院 - 工程科學系 Department of Engineering Science |
| 論文出版年: | 2008 |
| 畢業學年度: | 96 |
| 語文別: | 英文 |
| 論文頁數: | 95 |
| 中文關鍵詞: | Java 、虛擬機器 |
| 外文關鍵詞: | Java, Virtual machine |
| 相關次數: | 點閱:99 下載:2 |
| 分享至: |
| 查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報 |
本篇論文係提出針對應用程式虛擬機器的效能、空間成本與結構的改善技術,並且以Java虛擬機器為應用範例。其中基礎工作是以Java虛擬器的規格自行開發了一個Java虛擬機器-Gabi (咖啡的台語發音,Java的隱含的意思即是咖啡)。在虛擬機器的效能議題上,首先應用平行處理技術將Java的應用程式執行分散至分散式系統-由成功大學電機系所發展的分散式分享記憶體系統Teamster,一個顯著的加速例子是512x512矩陣乘法運算的效能在一個四節點的系統上被加速了3.83倍。本論文在應用程式虛擬機器的效能議題上的另一貢獻是:虛擬機器的開發者傾向使用靜態暫存器配置暫存器給那些存取頻繁的變數,如程式計數器或堆疊指標,以預期可以得到虛擬機器的效能提升;然而,這樣的方式對虛擬機器的效能提升並非有決定性的影響,本篇論文針對這一個現象做一個深度的探討。
在虛擬機器的結構議題上,本篇論文針對直譯器的結構進行探討。虛擬機器的核心是虛擬指令的分派元件-直譯器,直譯器的實作方式相當多,其中以直接線程直譯器 (Directly threaded interpreter) 有較佳的指令分派效率。然而,由於要對原有的方式進行轉換,必須在直譯器內部插入一個與直譯器無關的轉換器,導致這樣的一個直譯器的設計除了指令直譯功能外尚需另有一個指令轉換器配合,使得直譯器功能模組的設計具備了不良的低偶合度特性。因此,本論文從結構上的角度提出一個新的指令包裝形式的轉換器 (Instruction-coated Translation)來解決上述的問題。
在虛擬機器的空間成本議題上,本論文針對直接線程直譯器所產生的空間成本進行改善。由於直接線程直譯器必須對原有以位元碼形式的方法轉換成32位元或64位元寬的位址形式方法,方法所使用的記憶空間於是被擴大四或八倍,於是空間成本大增,本篇論文提出Shortcode線程直譯器來改善直接線程直譯器的空間成本,此方法相較於直接線器直譯器於32位元定址形式只需一半;64位元定址形式只需四分之一的空間成本。此方式可以在不減損指令分派速度過大的情況下,節省及固定Java虛擬機器的空間成本,此方法有助於記憶體有限的嵌入式系統上的虛擬機器。
The dissertation focuses on accelerating, memory-saving, and restructuring techniques for application virtual machines using Java virtual machine (JVM) as an example. Our JVM, Gabi (the assonance of ‘café’ in Taiwanese), and later called ES-JVM, where ES-JVM is both the JVM for Embedded System and the JVM developed by Department of Engineering Science, National Cheng Kung University, was developed from scratch as a foundation of later works. A distributed version of ES-JVM was integrated into the distributed-shared memory system, Teamster (developed by department of EE, NCKU), where the multiplication of 512x512 matrices was accelerated by a factor of 3.83 on a four-node cluster. An anomaly was found that using GCC source-code-level register allocation to assign important variables of a program to hard registers would not improve performance. A new restructuring technique, instruction-coated translation, was developed to improve the cohesion of a directly threaded interpreter from communication cohesion to functional cohesion. A new technique, called Shortcode threading, was developed to have a comparable speedup to a directly threading with less memory space: one half in a 32-bit addressing machine and one quarter in a 64-bit addressing machine, respectively.
[1] J. Gosling, B. Joy, G. Steele, et al., The Java Language Specification: Addison-Wesley Professional, 2000, ISBN 0201310082.
[2] S. M. Inc., "Java API Specifications." 3 October, 2006, available at http://java.sun.com/reference/api.
[3] C. Ditzel, "JavaOne Announcements : JavaFX Mobile [cld.blog-city.com]." 21 September, 2007, available at http://cld.blog-city.com/javaone_announcements__javafx_mobile.htm
[4] M. John, "History of LISP," in History of programming languages: ACM Press, 1981, pp. 173-185, ISBN 0-12-745040-8.
[5] P. Deutsch and A. Schiffman, "Efficient Implementation of the Smalltalk-80 System," in Conference Record of the Eleventh Annual ACM Symposium on Principles of Programming Languages, Salt Lake City, Utah, United States, January 15-18, 1984, pp. 297-302.
[6] C. K. Alan, "The early history of Smalltalk," in Proceedings of The second ACM SIGPLAN conference on History of programming languages, Cambridge, Massachusetts, United States, April 20-23 1993, pp. 69-95.
[7] ISO/IEC, "The standard ISO/IEC 14882:1998 on the programming language C++," 1998.
[8] T. Lindholm and F. Yellin, The Java(TM) Virtual Machine Specification: Addison-Wesley Professional, 1999, ISBN 0201432943
[9] Ting-Wei Hou, Fuh-Gwo Chen, Kun-Hung Lin, et al., "Just Another Java Virtual Machine," in Proceedings of The 14th International Conference on Information Networking (ICOIN-14) Hsin-Chu, Taiwan, R.O.C., January 26-28 2000, pp. 2.1-2.7.
[10] Ting-Wei Hou, Fuh-Gwo Chen, J. L. Lee, et al., "Distributed and Parallel Execution of Java programs On a DSM System," in Proceedings of ACM/IEEE International Symposium on Cluster Computing and the Grid (CCGrid'01), Brisbane, Australia, May 15-18 2001, pp. 555-559.
[11] A. Ertl, "Threaded Code." 3 October, 2006, available at http://www.complang.tuwien.ac.at/forth/threaded-code.html
[12] GNU Org., "Labels as Values - Using the GNU Compiler Collection (GCC)." 25 June, 2007, available at http://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html
[13] Fuh-Gwo Chen and Ting-Wei Hou, "Instruction-coated Translation: An Approach to Restructure Directly Threaded Interpreters with Low Cohesion," ACM SIGPLAN Notices, Vol. 41, No. 8, August, 2006, pp. 29-33.
[14] Ting-Wei Hou and Fuh-Gwo Chen, "An Anomaly in an Interpreter Using GCC Source-Code-level Register Allocation," ACM SIGPLAN Notices, Vol. 42, No. 4, April, 2007, pp. 9-13.
[15] Yi-Chieh Wang, Fuh-Gwo Chen, and Ting-Wei Hou, "The Study of Accelerating Methods for Python Interpreter without a JIT Compiler (In Chinese)," in Proceedings of 2007 Symposium on Digital Life Technologies, National Cheng Kung University, Tainan, Taiwan, R.O.C., June 7-8, 2007.
[16] Bureau of National Health Insurance, "NHI IC CARD." 21 October, 2007, available at http://www.nhitb.gov.tw/english/iccard.asp
[17] C. Michal, T. L. Brian, and M. S. James, "Open runtime platform: flexibility with performance using interfaces," in Proceedings of the 2002 joint ACM-ISCOPE conference on Java Grande, Seattle, Washington, USA, 2002, pp. 156-164.
[18] Python Org., "Python Programming Language -- Official Website." 26 September, 2006, available at http://www.python.org.
[19] Perl Org., "The Perl Directory." 26 September, 2006, available at http://www.perl.org.
[20] E. Meijer and J. Gough, "Technical Overview of the Common Language Runtime." available at http://groups.csail.mit.edu/pag/reading-group/meijer01clr.pdf.
[21] M. John, "History of LISP," in History of programming languages I: ACM Press, 1981, pp. 173-185, ISBN 0-12-745040-8.
[22] H. Gilbert Joseph, "Adaptive systems for the dynamic run-time optimization of programs," Doctoral Thesis, Dept. of Computer Science, Carnegie Mellon University
[23] Urs Holzle and David Ungar, "A third-generation SELF implementation: reconciling responsiveness with performance," in Proceedings of the ninth annual conference on Object-oriented programming systems, language, and applications, Portland, Oregon, United States, 1994, pp. 229-243.
[24] Guy Lewis Steele, Jr. and S. Gerald Jay, "Design of a LISP-based microprocessor," Communications of the ACM Vol. 23, No. 11, Nov., 1980, pp. 628-645.
[25] B. Andrew and W. Henry, "Scheme86: a system for interpreting scheme," in Proceedings of the 1988 ACM conference on LISP and functional programming, Snowbird, Utah, United States, April 03-05, 1988, pp. 116-123.
[26] B. H. J, A. Frick, and S. Ch, "High level language oriented hardware and the post-von Neumann era," in Proceedings of the 5th annual symposium on Computer architecture, April 03-05, 1978, pp. 60-65.
[27] R. B. K. Dewar, "Indirect Threaded Code," Communications of the ACM, Vol. 18, No. 6, Nov., 1975, pp. 330-331.
[28] J. R. Bell, "Threaded Code," Communications of the ACM, Vol. 16, No. 6, June, 1973, pp. 370-372.
[29] M. Richards, "The implementation of BCPL," Software Portability, P. J. Brown, Ed. Cambridge University Press, No. 1977, pp. 192-202.
[30] K. V. Nori, U. Ammann, K. Jensen, et al., "The Pascal (P) Compiler: Implementation Notes," Technical Report No. 10, Institut für Informatik, ETH Zürich, Dec. 1975.
[31] M. A. Ertl, "Threaded Code Variations and Optimizations," in EurpFoth 2001 Conference Proceedings, 2001, pp. 49-55.
[32] I. Piumarta and F. Riccardi, "Optimizing Direct Threaded Code By Selective Inlining," in Proceedings of the 1998 ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), Montreal, Canada, June 17-19, 1998, pp. 291-300.
[33] M. A. Ertl and G. David, "Combining stack caching with dynamic superinstructions," in Proceedings of the 2004 workshop on Interpreters, virtual machines and emulators, Washington, D.C., 2004, pp. 7-14.
[34] E. Gagnon and L. Hendren, "Effective Inline-Threaded Interpretation of Java Bytecode Using Preparation Sequences," in In Proceedings of Compiler Construction, 12th International Conference, CC 2003, Held as Part of the Joint European Conferences on Theory and Practice of Software (ETAPS 2003), Springer Verlag, Warsaw, Poland, 2003, pp. 170-184.
[35] Etienne Gagnon and L. Hendren, "SableVM: A Research Framework for the Efficient Execution of Java Bytecode," in Proceedings of Java Virtual Machine Research and Technology Symposium (JVM '01), Monterey, California, April 23-24, 2001, pp. 27-40.
[36] A. P. Todd, "Optimizing an ANSI C interpreter with superoperators," in Proceedings of the 22nd ACM SIGPLAN-SIGACT symposium on Principles of programming languages, San Francisco, California, United States, January 23-25, 1995, pp. 322-332.
[37] M. Anton Ertl, David Gregg, Andreas Krall, et al., "Vmgen - a generator of efficient virtual machine interpreters," Software Practice and Experience, Vol. 32, No. 3, 2002, pp. 265-294.
[38] Sun Microsystems Inc., "Java SE - Overview - at a Glance." 24 October, 2007, available at http://java.sun.com/javase.
[39] "OpenJDK." 24 October, 2007, available at http://openjdk.java.net.
[40] B. Alpern, C. R. Attanasio, J. J. Barton, et al., "The Jalapen˜o Virtual Machine," IBM Systems Journal, Vol. 39, No. 1, 2000, p. 211~238.
[41] IBM, "The Jikes Research Virtual Machine (RVM)." 3 October, 2006, available at http://www-128.ibm.com/developerworks/java/library/j-jalapeno.
[42] R. Lougher, "JamVM Web Pages." available at http://jamvm.sourceforge.net.
[43] Kaffe Org., "Kaffe.org." 3 October, 2006, available at http://www.kaffe.org.
[44] K. Shudo, "Performance Comparison of Java/.NET Runtimes (Oct 2004)." 23 October, 2007, available at http://www.shudo.net/jit/perf.
[45] "The Open JAVA(TM) Environment - KaffePC." 22 October, 2007, available at http://www.openje.org/kaffepc.
[46] S. MASS Laboratory, "LaTTe: A Fast and Efficient Java VM Just-in-Time Compiler." 18 October, 2007, available at http://latte.snu.ac.kr.
[47] "The Janos Project: The JanosVM." 18 October, 2007, available at http://www.cs.utah.edu/flux/janos/janosvm.html
[48] M. J. M. Ma, C.-L. Wang, and F. C. M. Lau, "JESSICA: Java-Enabled Single-System-Image Computing Architecture," Journal of Parallel and Distributed Computing, Vol. 60, No. 10, 2000, pp. 1194-1222.
[49] "Gilgul." 23 October, 2007, available at http://javalab.cs.uni-bonn.de/research/gilgul.
[50] "Alta: The Nested Process Model In Java." 23 October, 2007, available at http://www.cs.utah.edu/flux/java/alta/index.html
[51] "Guaran - A Reflective Architecture." 23 October, 2007, available at http://www.lsd.ic.unicamp.br/~oliva/guarana.
[52] "Kangaroo VM." 23 October, 2007, available at http://www.sigs.de/publications/js/2003/systems/kleine-budde_JS_systems_03.pdf
[53] J. Frijters, "IKVM.NET Weblog - The development of a Java VM for .NET." 22 October, 2007, available at http://weblog.ikvm.net.
[54] Intel Corp., "Open Runtime Platform." 22 October, 2007, available at http://orp.sourceforge.net.
[55] "Japhar - The Hungry Java Runtime." 23 September, 2007, available at http://www.hungry.com/old-hungry/products/japhar.
[56] "The Jupiter Project." 22 October, 2007, available at http://www.eecg.toronto.edu/jupiter.
[57] SuperWaba, "SuperWaba : The Real Power of Mobile Computing." 22 October, 2007, available at http://www.superwaba.com.br/en/default.asp
[58] "kissme - A free Java Virtual Machine." 22 October, 2007, available at http://kissme.sourceforge.net.
[59] GNU Org., "GNU Classpath - GNU Project - Free Software Foundation (FSF)." 24 October, 2006, available at http://www.gnu.org/software/classpath.
[60] "Teaseme - A JVM that runs in the linux kernel." 22 October, 2007, available at http://teaseme.sourceforge.net.
[61] W. John, "Joeq: a virtual machine and compiler infrastructure." 1 January, 2007, available at http://joeq.sourceforge.net.
[62] P. W. L. Fong, "AegisVM Web Pages." available at http://aegisvm.sourceforge.net.
[63] "JAOS - Java on Active Object System." 23 October, 2007, available at http://www.oberon.ethz.ch/jaos.
[64] "Welcome to Bluebottle." 23 October, 2007, available at http://bluebottle.ethz.ch.
[65] "CACAO Home Page." 3 October, 2006, available at http://www.complang.tuwien.ac.at/cacaojvm.
[66] A. Lakhotia and J. C. Deprez, "Restructuring functions with low cohesion," in Proceedings of Sixth Working Conference on Reverse Engineering, Atlanta, Georgia, USA, October 6-8, 1999, pp. 36-46.
[67] A. D. Lucia, "Program slicing: Methods and applications," in First IEEE International Workshop on Source Code Analysis and Manipulation, Florence, Italy, Nov. 2001, pp. 142-149.
[68] A. Lakhotia and J.-C. Deprez, "Restructuring Programs By Tucking Statements Into Functions " Information and Software Technology, Vol. 40, No. 11-12, 1998, pp. 677-690.
[69] J. M. Bieman and K. Byung-Kyoo, "Measuring design-level cohesion," IEEE Transactions on Software Engineering, Vol. 24, No. 2, February, 1998, pp. 111-124.
[70] H. S. Kim, I. S. Chung, and Y. R. Kwon, "Restructuring programs through program slicing," International Journal of Software Engineering and Knowledge Engineering, Vol. 4, No. 3, September, 1994, pp. 349-368.
[71] R. S. Arnold, "Software restructuring," in Proceedings of the IEEE, April, 1989, pp. 607-617.
[72] Fuh-Gwo Chen and Ting-Wei Hou, "Design and Implementation of a Java Virtual Machine," in Proceedings of 6th International Conference on Parallel and Distributed Systems (ICPADS '98) Tainan, Taiwan, R.O.C., December 14-16 1998, pp. 686-692.
[73] B. R. Montague, "JN: OS for an Embedded Java Network Computer," IEEE Micro Vol. 17, No. 3, May/June, 1997, pp. 54-60.
[74] K.H. Lin and Ting-Wei Hou, "Design and Implementation of a virtual platform for embedded Java Virtual Machine," in Proceedings of 1998 workshop on Distributed System, Technologies and Applications, Tainan, Taiwan, R.O.C., May 14-15, 1998, pp. 1-9.
[75] C. Timothy, F. Richard, M. Terrence, et al., "Compiling Java Just in Time," IEEE Micro, Vol. 17, No. 3, May/June, 1997, pp. 36-43.
[76] Smalltalk Org., "Smalltalk.org." 3 October, 2006, available at http://www.smalltalk.org/main.
[77] FORTH Org., "Forth Interest Group Home Page." 3 October, 2006, available at http://www.forth.org.
[78] INRIA, "Objective Caml." 4 January, 2007, available at http://caml.inria.fr/ocaml.
[79] GNU Org., "Using and Porting GNU CC - Defining Global Register Variables." 20 November, 2006, available at http://gcc.gnu.org/onlinedocs/gcc.
[80] GNU Org., "Gforth - GNU Project - Free Software Foundation (FSF)." 30 March, 2007, available at http://www.gnu.org/software/gforth.
[81] Ren-Jie Lo, "A New Approach to Bytecode Translation for Accelerating Java Interpreters," Master Thesis, Dept. of Engineering Science, National Cheng Kung University
[82] SPEC Org., "SPEC JVM98." 3 October, 2006, available at http://www.spec.org/osg/jvm98.
[83] IBM, "IBM Power Architecture offerings." 24 October, 2006, available at http://www-03.ibm.com/chips/power/powerpc.
[84] Intel Corp., "Intel Processors." 24 October, 2006, available at http://www.intel.com/products/processor.
[85] D. W. Barron, "Pascal - The Language and its Implementation," John Wiley 1981.
[86] W. P. Stevens, G. J. Myers, and L. L. Constantine, "Structured Design," IBM Systems Journal, Vol. 13, No. 2, 1974, pp. 115-139.
[87] J. M. Bieman and L. M. Ott, "Measuring functional cohesion," IEEE Transactions on Software Engineering Vol. 20, No. 8, 1994, pp. 644-657.
[88] K. Byung-Kyoo and J. M. Bieman, "Design-level cohesion measures: derivation, comparison, and applications," in Proceedings of 20th Computer Software and Applications Conference, Seoul, Korea, 19-23 August 1996, pp. 92-97.
[89] E. J. Chikofsky and J. H. Cross, "Reverse engineering and design recovery: a taxonomy," IEEE Software, Vol. 7, No. 1, 1990, pp. 13-17.
[90] W. C. Chu and S. Patel, "Software restructuring by enforcing localization and information hiding," in The Proceedings of the IEEE International Conference on Software Maintenance, Orlando, Florida, Nov. 1992, pp. 165-172.
[91] N. Gupta and P. Rao, "Program execution based module cohesion measurement," in Proceedings of 16th International Conference on Auto-mated on Software Engineering, San Diego, USA, Nov. 2001, pp. 144-153.
[92] E. Jacques, "Software restructuring: implementing a code abstraction transformation," in Proceedings of the 2002 annual research conference of the South African institute of computer scientists and information technologists on Enablement through technology, Port Elizabeth, South Africa, September 16-18, 2002, pp. 83-92.
[93] W. B. Robert and G. G. William, "Supporting the restructuring of data abstractions through manipulation of a program visualization," ACM Transactions on Software Engineering and Methodology (TOSEM) Vol. 7, No. 2, 1998, pp. 109-157.
[94] Michael Siff and Thomas Reps, "Identifying modules via concept analysis," IEEE Transactions on Software Engineering, Vol. 25, No. 6, 1999, pp. 749-768.
[95] P. Tonella, "Concept analysis for module restructuring," IEEE Transactions on Software Engineering, Vol. 27, No. 4, 2001, pp. 351-363.
[96] B.-K. Kang and J. M. Bieman, "Using Design Cohesion to Visualize, Quantify, and Restructure Software," in Proceedings of 8th International Conference on Software Engineering and Knowledge Engineering, June, 1996, pp. 222-229.