簡易檢索 / 詳目顯示

研究生: 羅仁杰
Lo, Ren-Jie
論文名稱: 提升 Java 直譯器效能之新的位元碼轉換技術
A New Approach to Bytecode Translation for Accelerating Java Interpreters
指導教授: 侯廷偉
Hou, Ting-Wei
學位類別: 碩士
Master
系所名稱: 工學院 - 工程科學系
Department of Engineering Science
論文出版年: 2005
畢業學年度: 93
語文別: 中文
論文頁數: 52
中文關鍵詞: 直譯器快速方法轉換
外文關鍵詞: Interpreter, Threaded Code, Quick Method Translation, goto
相關次數: 點閱:103下載:1
分享至:
查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報
  •  由於 Java 直譯器有著簡單實作、容易維護和移植的優點,所以如何提升 Java 直譯器的執行效率,而讓沒有Just-In-Time 的 Java 虛擬機器,執行速度能夠更為提升,且其應用範圍能夠更為廣泛,是ㄧ個很重要的議題。
     本研究提出一個新穎並稱為快速方法轉換的技術,將原本 Java 類別檔方法裡所存的 bytecode 資訊,轉換成相對應的 bytecode 實作位址。藉由這轉換技術的實作,能讓直譯器在每次指令分發之間,能夠節省兩次的記憶體存參考時間,也因此能夠提升整體 Java 虛擬機器的執行速度。本研究將此法實作在開放原始碼的 JamVM 上,並使用 SPECjvm98 的效能測試程式,進行方法轉換技術的效能評估。經實驗證實,實作了本研究所提出的方法轉換技術,SPECjvm98 有 1.28 倍至 1.6 倍的效能提升。

     Java Virtual Machines have interpreters and optional Just-In-Time compilers. Interpreters have advantages of easier implementation, easier maintenance, and better portability, as compared with Just-In-Time compilers. How to improve the performance of the Java Virtual Machine and make the overall performance acceptable without a Just-In-Time compiler has been an important issue.
     In this thesis, we proposed a new Java Method Translation for Java Virtual Machines. The bytecode in the original Java method are translated into the addresses where bytecode were implemented. By this approach, a Java Virtual Machine saves 2 times memory accesses during each bytecode dispatching. So the performance is speeded up.
     JamVM, an open source VM, is taken as the testing platform and SPECjvm98 benchmarks are used. The result of the measurements shows that the new JamVM with the proposed Java Method Translation implementation could improve the performance from 1.28 times up to 1.6 times on SPECjvm98 applications.

    第一章 緒論.......................................................1  1.1  研究動機與背景............................................1  1.2  研究目的..................................................2  1.3  章節概要..................................................3 第二章 簡述目前實作於直譯器之最佳化技術..........................4  2.1  快速指令的技術(QUICK INSTRUCTION).......................4  2.2  指令的管線操作技術(INSTRUCTION PIPELINING)..............5  2.3  轉換堆疊動作的技術(STACK CACHE).........................6  2.4  線串程式碼(THREADED CODE)...............................7  2.5  小結......................................................10 第三章 快速方法轉換(QUICK METHOD TRANSLATION)的設計............11  3.1  基本概念..................................................11   3.1.1 簡述和分析 switch-case 的架構...........................11   3.1.2 簡述和分析間接線串程式碼架構............................12   3.1.3 快速方法轉換的基本概念..................................15  3.2  快速方法轉換(QUICK METHOD TRANSLATION)實作方式的設計....17   3.2.1 快速方法轉換的時機......................................17   3.2.2 快速方法轉換動作的設計..................................18  3.3  預估的效能提升............................................20 第四章 快速方法轉換(QUICK METHOD TRANSLATION)的實作............21  4.1  嵌入轉換程式於類別載入器裡................................21  4.2  預先抓取 BYTECODE LABEL 在記憶體裡的相對位址..............21  4.3  為方法區塊(METHOD BLOCK)作轉換..........................23  4.4  直譯器因應轉換所要修改的程式部份..........................35  4.5  利用暫存器來再次降低記憶體參考的時間......................35 第五章 效能分析..................................................36  5.1  JAMVM 簡介................................................36   5.1.1 JamVM...................................................36  5.2  實作環境..................................................36  5.3  效能測試程式..............................................36  5.4  測試平台..................................................37  5.5  實驗參數設定..............................................37  5.6  實驗結果..................................................37  5.7  記憶體消耗之比較..........................................46  5.8  評估 JamVM 在實作上所做的修改.............................46 第六章 結論與未來工作............................................48  6.1  結論......................................................48  6.2  未來工作..................................................49 參考文獻...........................................................50 自述...............................................................52

    [1]Matthew Arnold, Stephen J. Fink, David Grove, Michael Hind, Peter F. Sweeney, “A Survey of Adaptive Optimization in

    Virtual Machines,” IBM Research Division Thomas J. Waston Research Center, P.O. Box 704, Yorktown Heights, May 18, 2004.

    [2]Brian Davis, John Waldron, “A Survey of Optimisations for the Java Virtual Machine,” Proceedings of the Principles and

    practice of programming in Java, Kilkenny City, Ireland, p.181-183, June 2003.

    [3]GNU Compiler Collection, http://gcc.gnu.org/.

    [4]David Gregg, M. Anton Ertl and Andreas Krall, “A Fast Java Interpreter,” Proceedings of Java Optimization Strategies

    for Embedded System Workshop at ETAPS’01, In Uwe Assmann, 2001.

    [5]Jan Hoogerbrugge and Lex Augusteijn, “Pipelined Java Virtual Machine Interpreters,” Proceedings of the 9th International

    Conference on Compiler Construction(CC’00),Springer LNCS, p.35-49, 2000.

    [6]Dewar, R. B K., “Indirect Threaded Code,” Proceedings of Communications of the ACM, Volume 18 , Issue 6, p.330-331,

    1975.

    [7]Robert Lougher , JamVM. http://jamvm.sourceforge.net/.

    [8]Bell, J. R., “Threaded Code,” Proceedings of Communications of the ACM, Volume 16 , Issue 6, p.370-372, 1973.

    [9]Standard Performance Evaluation Corporation, http://www.spec.org/

    [10]Lindholm, T. The Java(TM) Virtual Machine Specification. Addison-Wesley Professional, 1999.

    [11]Wiki Web, http://c2.com/cgi/wiki?FirstClass/

    [12]楊方瑜,應用於 x86 平台之 Java 及時編譯器的設計與實作,國立成功大學工程科學系碩士論文,1998.

    下載圖示 校內:2006-07-14公開
    校外:2006-07-14公開
    QR CODE