標題: T2R: Off-line Hot Region Compilation for Dalvik Virtual Machine
T2R: Off-line Hot Region Compilation for Dalvik Virtual Machine
作者: 陳建如
Chen, Jian-Ru
游逸平
You, Yi-Ping
資訊科學與工程研究所
關鍵字: Android;Dalvik虛擬機;編譯器;Android;Dalvik virtual machine;region-based compilation
公開日期: 2013
摘要: Android 系統為行動裝置上重要的作業系統代表,而其使用 Dalvik 虛擬機執行程式。Dalvik 虛擬機使用直譯的方式執行程式,而為了加速經常執行的程式碼,也加入了 trace-based即時式編譯器。然而,由 Dalvik 虛擬機所產生的 trace,其結束為條件式跳躍或函式的呼叫及返回,所以它們的長度通常很短,也因此減少了編譯器能提供優化的可能。此外,基於效能考量,即時式編譯器能提供的只有少數且簡單的優化技術。因此,我們對 Dalvik 虛擬機提出一靜態常用程式碼區段編譯器,此編譯器用來延伸編譯範圍(Region)並在靜態時間將常使用的程式碼區段編譯為機械碼以提升 Android 程式的效能。此靜態常用程式碼區段編譯器分為三個階段:(1) 分析階段用來擷取程式執行時所產生的 trace 資訊,(2) 編譯階段用來延伸編譯範圍,並將指令編譯為機械碼,以及(3) 執行階段將已預先編譯好之機械碼讀取至程式碼快取並執行。最後的實驗結果顯示,此靜態編譯器可有效改善 Android 程式效能 10.5%至 16.2%,並且可減少程式碼快取中的記憶體使用量約 5%至 28.5%。
The Dalvik virtual machine (VM) is a significant component of Android, one of the leading operating systems for mobile devices, to execute applications. The Dalvik VM, which is an interpreter, is equipped with a trace-based just-in-time (JIT) compiler for enhancing the execution performance of frequently executed paths, or traces. However, traces generated by the Dalvik VM are chosen to stop on a conditional branch or a method call/return, so they are usually short, which decreases the effectiveness of compiler optimizations applied to these traces. Furthermore, the JIT compiler applies few, simple optimizations due to performance considerations. In this thesis we present a Traces-to-Region (T2R) framework that extends traces to regions and statically compiles regions into native binaries for improving the execution of Android applications. The T2R framework involves three main stages: (1) the profiling stage, in which the run-time trace information of an application is extracted, (2) the compilation stage, in which regions are constructed from the traces extracted and statically compiled into a native binary, and (3) the execution stage, in which the compiled binary is loaded into the code cache before the application starts to execute. The experimental results demonstrated that the T2R framework was effective in improving the execution performance of Android applications by 10.5%--16.2% and decreasing the usage of the code cache by 5%--28.5%.
URI: http://140.113.39.130/cdrfb3/record/nctu/#GT070056055
http://hdl.handle.net/11536/74005
顯示於類別:畢業論文