




版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
小型JIT編譯器之最佳化技術評估指導教授:單智君老師指導學長:喬偉豪學長組員:鍾懿軒,蔣季融,李國丞小型JIT編譯器之最佳化技術評估指導教授:單智君老師1Outline觀察-----------------------------------鍾懿軒動機-----------------------------------鍾懿軒目標-----------------------------------鍾懿軒初步設計-----------------------------李國丞修改過的設計------------------------蔣季融未來進度-----------------------------蔣季融Outline觀察---------------------2觀察Java是用stack運算。因為底層機器是register-based非stack-based,用interpreter執(zhí)行,performance不佳。加入JIT將bytecode轉換為register-based的指令,可以增進performance。若於JIT中加入一些機制,增進其效能,則可進一步增進javaperformance。觀察Java是用stack運算。3動機加入的機制若能產(chǎn)生IR,使JITcompiler後端處理更方便。就有可能增進JIT的速度。folding機制:讀入bytecode產(chǎn)生register-based的IR,簡便後段處理。因此決定於JIT中加入folding機制。動機加入的機制若能產(chǎn)生IR,使JITcompiler後端處4目標將folding機制加入JIT中,以最少的overhead,fold最多的pattern,達到增加performance的目的。目標將folding機制加入JIT中,以最少的overhea5初步設計架構圖Bytecode分類Pattern統(tǒng)計遇到的問題初步設計架構圖6舊架構圖舊架構圖7舊folding架構圖舊folding架構圖8Bytecode分類1.定義:參考kim’spaper(AdvancedPOCModel-BasedJavaInstructionFoldingMechanism)P:非operation含有push。Op:operation含有push不含pop。Oc:operation含有pop不含push。C:非operation含有pop。On:不含pushpop,無法分類者。Bytecode分類1.定義:9Bytecode分類(續(xù))參考學長的paper(stackoperationsfoldinginjavaprocessors)P:transferingdatafromConstantRegisterorLocalVariabletotheoperandstack。O:getsdatafromtheoperandstackandthenperformsdifferenttasksOe:ALUtypeoperatorthatwritestheresultbacktotheoperandstack。Ob:Branchtypeoperator。Oc:Complextypeoperatorincludingarrayaccess,constantpoolaccess。Ot:unableorhardtojointhefoldingoperation。C:consumesdatafromtheoperandstack,andstoresdatabackintothelocalvariable。Bytecode分類(續(xù))參考學長的paper(stack10Bytecode分類(續(xù))2.統(tǒng)計bytecodepush/pop數(shù):檢視kvmsourcecode(bytecodes.c):查看每道bytecode的執(zhí)行碼中有多少push,pop的動作。檢視jvmspec(chapter6)每道bytecode都已規(guī)定好stack情況,可直接紀錄。Bytecode分類(續(xù))11AnalyzepatternspossibilityinJavaclassfileGetinformationfromJavaclassfileDoitourself(inC++)BCELlibraryforJava
(/bcel)
Analyzepatternspossibilityi12Possibilityofpatterns(1)KIM所統(tǒng)計出的Patterns及出現(xiàn)百分比(2)自行統(tǒng)計”EmbeddedCaffeineMark”的結果
Possibilityofpatterns(1)KIM所13ProblemsClassificationcansavetimeofstringmatchingUsing“Hashing”isbetterthanstringmatching!Benefitofclassificationnolongerexistswhenusing“Hashing”!使用stringmatchingsequentialsearch:Toomuchfindingoverhead。ProblemsClassificationcansav14修改過的設計新架構圖Folding方法修改過的設計新架構圖15Structureof“JVMwithJIT”JavacodesourceJAVAcompilerJavabytecodeClassloaderBytecodeverifierHardwareOperatingSystemJavaclasslibrariesHotspotInterpretNativecodeJVMInterpreterJITYNStructureof“JVMwithJIT”Jav16Interactionbetween
Interpreter&JITTimeOnemethodHotspotDetectInterpretTimeComplicatedcodeJITEndofmethod(Startofmethod)CodeblockCodeblockInteractionbetween
Interpret17StrutureofourJITJITIRgeneratorFoldingCodegeneratorIR1IR2NativecodeMethodStrutureofourJITIRgenerato18方法(4-1)-OverviewO-oriented.
SearchbytecodesforO-typebytecodethenfindfoldingpatternforthisO-typebytecode.Datastructure:array.Table:Usedforstoringinformationofbytecodes.方法(4-1)-OverviewO-oriented.
Se19方法(4-2)-DataStructureTable:usebytecodeIDnumberasindex.Buffer:length=4;Bytecodeinformation:TypeP_num:PushnumberPostive,stackgrowC_num:PopnumberNegative,stackfall方法(4-2)-DataStructureTable:u20方法(4-3)-Algorithm經(jīng)由bytecode定義可得:P-type:C_num=0,P_num=1.C-type:P_num=0,C_num=1.O-type:不一定,視其功能而定。以O-type的attribute為尋找pattern的依據(jù)。P_num:向後尋找P_num個bytecodesC_num:向前尋找C_num個bytecodes方法(4-3)-Algorithm經(jīng)由bytecode定義可21方法(4-4)Match:向前找C_num個bytecodes的P_num剛好和O-type的C_num相抵銷。向後找P_num個bytecodes的C_num剛好和O-type的P_num相抵銷。整個pattern的attribute和要為零。無法match放棄此O-typebytecode,繼續(xù)找下一個。針對continuouspattern設計。方法(4-4)Match:22未來進度TracingcodeModifyingcodeSimulationPerformance未來進度Tracingcode23TracingcodeEnvironmentconfigurationTracecodeConcentrateon“HowtoaddFoldingintoJIT?”TracingcodeEnvironmentconfig24ModifyingcodeAddingFoldingtoJITModulizingFoldingandaddingitintoJITbetween“IRgenerator”and“Codegenerator”IRGeneratorCodeGeneratorBytecodeNativecodeFoldingModifyingcodeAddingFoldingt25SimulationRunbenchmarkonARMsimulatoronLinuxworkstationBenchmark:”EmbeddedCaffeineMark”SimulationRunbenchmarkonARM26PerformanceFindout“PerformanceSpeedup”afterusingfoldingSpeedup=
(time_with_folding)/
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 公司新年開工小活動方案
- 公司競拍活動方案
- 公司案例收集活動方案
- 公司歡迎回來活動方案
- 公司職工健身房策劃方案
- 公司疫情捐贈活動方案
- 2025年裝修工程師職業(yè)資格考試試題及答案
- 公共關系與危機管理的2025年試卷及答案
- 2025年養(yǎng)老服務體系建設考試試卷及答案
- 2025年刑法學知識與實踐應用考核題及答案
- 2025年湖北省高考政治試卷真題(含答案)
- 老齡化社會的數(shù)字包容-洞察及研究
- 廣東省深圳市寶安區(qū)2023-2024學年二年級下冊期末測試數(shù)學試卷(含答案)
- 2025江蘇揚州寶應縣“鄉(xiāng)村振興青年人才”招聘67人筆試備考試題及參考答案詳解
- 北京市順義區(qū)2023-2024學年五年級下學期數(shù)學期末試卷(含答案)
- 2025公基題庫(附答案解析)
- 三大監(jiān)測培訓試題及答案
- 超市商場保密協(xié)議書
- 系統(tǒng)思維與系統(tǒng)決策系統(tǒng)動力學知到智慧樹期末考試答案題庫2025年中央財經(jīng)大學
- 社工社會考試試題及答案
- 跨文化交際知識體系及其前沿動態(tài)
評論
0/150
提交評論