標題: 針對爪哇即時編譯器嵌入式系統之區域程式碼分析器與樣式化區間程式碼優化器
Local Code Analyzer and Pattern-Based Peephole Optimizer in Java JIT Compilers for Embedded Systems
作者: 黃帥維
Shuai-Wei Huang
楊武
Wuu Yang
網路工程研究所
關鍵字: 即時編譯器;區間優化技術;樣式比對;嵌入式系統;區間優化器;JIT compiler;peephole optimization;pattern matching;embedded system;peephole optimizer
公開日期: 2007
摘要: 現今許多經移植過的嵌入式編譯系統,常由於指令集架構(Instruction Set Architecture,ISA)的不同,無法充分利用新的硬體平台的指令集特性,容易產生效率較差的程式碼。透過程式原始碼中尋找可優化的指令樣式,可以有效地協助改善程式碼產生器產生多餘或無效率指令的情況。減少多餘的指令,可降低程式運算時間,替換為較有效率的指令,可降低存取記憶體次數,進而間接地減少資料快取失敗的機會,有利於提升整體運算效能。由於透過軟體分析的方式,不需改變硬體,使得許多學者及研發人員投入其研究,例如,改變程式的暫存器分配演算法、指令的排程、全域/區域程式碼優化、分支預測、內嵌函式等等。而在嵌入式處理器日漸普及與多樣的趨勢下,我們觀察到編譯器產生的程式碼與嵌入式處理器的指令集架構有著密切的關係,不同的指令集架構的差異性,往往隱含著可進一步優化的機會。因此在本論文中,我們針對爪哇即時編譯器產生的程式碼,除了在區域程式碼分析器上實作了幾項常見的優化技術外,我們亦針對系統指令集架構的特色,透過遞迴的方式,協助我們徹底找出新的樣式,藉以改善爪哇即時編譯器上的JCS規則(Java Code Select Rule)與程式產生器(Code emitters),並以Andes處理器指令集架構提出了幾個常見的可優化樣式。此外,為了驗證各種優化方法所能貢獻的效果,我們設計了一連串的實驗,以CVM上的即時編譯器作為實驗的平台系統,在系統上實行優化樣式,探討各個優化技術對系統的影響與改進。
When a Java JIT compiler is ported to a new hardware platform, it usually cannot take full advantage of the special features of the new platform unless it undergoes thorough and massive optimizing. We propose a new approach to improve the code generator in a ported Java JIT compiler. A static code analyzer is used to automatically discover frequently-occurring patterns in the generated code that are suitable for peephole optimizations. Then the patterns are incorporated in the JIT compiler by modifying instruction selection rules and code emitters. The approach of automatically discovering patterns is feasible because (1) there does exist patterns in the code generated by most compilers and (2) a peephole optimizer requires only quite simple patterns, which can be discovered easily. Our target platform is the Andes architecture, which features several novel hardware facilities. The result of our experiment shows the approach is quite promising.
URI: http://140.113.39.130/cdrfb3/record/nctu/#GT009556554
http://hdl.handle.net/11536/39650
顯示於類別:畢業論文


文件中的檔案:

  1. 655401.pdf

若為 zip 檔案,請下載檔案解壓縮後,用瀏覽器開啟資料夾中的 index.html 瀏覽全文。