小型JIT编译器之最佳化技术评估.ppt_第1页
小型JIT编译器之最佳化技术评估.ppt_第2页
小型JIT编译器之最佳化技术评估.ppt_第3页
小型JIT编译器之最佳化技术评估.ppt_第4页
小型JIT编译器之最佳化技术评估.ppt_第5页
已阅读5页,还剩23页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

小型JIT編譯器之最佳化技術評估,指導教授:單智君老師指導學長:喬偉豪學長組員:鍾懿軒,蔣季融,李國丞,Outline,觀察-鍾懿軒動機-鍾懿軒目標-鍾懿軒初步設計-李國丞修改過的設計-蔣季融未來進度-蔣季融,觀察,Java是用stack運算。因為底層機器是register-based非stack-based,用interpreter執行,performance不佳。加入JIT將bytecode轉換為register-based的指令,可以增進performance。若於JIT中加入一些機制,增進其效能,則可進一步增進javaperformance。,動機,加入的機制若能產生IR,使JITcompiler後端處理更方便。就有可能增進JIT的速度。folding機制:讀入bytecode產生register-based的IR,簡便後段處理。因此決定於JIT中加入folding機制。,目標,將folding機制加入JIT中,以最少的overhead,fold最多的pattern,達到增加performance的目的。,初步設計,架構圖Bytecode分類Pattern統計遇到的問題,舊架構圖,舊folding架構圖,Bytecode分類,1.定義:參考kimspaper(AdvancedPOCModel-BasedJavaInstructionFoldingMechanism)P:非operation含有push。Op:operation含有push不含pop。Oc:operation含有pop不含push。C:非operation含有pop。On:不含pushpop,無法分類者。,Bytecode分類(續),參考學長的paper(stackoperationsfoldinginjavaprocessors)P:transferingdatafromConstantRegisterorLocalVariabletotheoperandstack。O:getsdatafromtheoperandstackandthenperformsdifferenttasksOe:ALUtypeoperatorthatwritestheresultbacktotheoperandstack。Ob:Branchtypeoperator。Oc:Complextypeoperatorincludingarrayaccess,constantpoolaccess。Ot:unableorhardtojointhefoldingoperation。C:consumesdatafromtheoperandstack,andstoresdatabackintothelocalvariable。,Bytecode分類(續),2.統計bytecodepush/pop數:檢視kvmsourcecode(bytecodes.c):查看每道bytecode的執行碼中有多少push,pop的動作。檢視jvmspec(chapter6)每道bytecode都已規定好stack情況,可直接紀錄。,AnalyzepatternspossibilityinJavaclassfile,GetinformationfromJavaclassfileDoitourself(inC+)BCELlibraryforJava(/bcel),Possibilityofpatterns,(1)KIM所統計出的Patterns及出現百分比(2)自行統計”EmbeddedCaffeineMark”的結果,Problems,ClassificationcansavetimeofstringmatchingUsing“Hashing”isbetterthanstringmatching!Benefitofclassificationnolongerexistswhenusing“Hashing”!使用stringmatchingsequentialsearch:Toomuchfindingoverhead。,修改過的設計,新架構圖Folding方法,Structureof“JVMwithJIT”,Javacodesource,JAVAcompiler,Javabytecode,ClassloaderBytecodeverifier,Hardware,OperatingSystem,Javaclasslibraries,Hotspot,Interpret,Nativecode,JVM,Interpreter,JIT,Y,N,InteractionbetweenInterpreterBytecodeinformation:TypeP_num:PushnumberPostive,stackgrowC_num:PopnumberNegative,stackfall,方法(4-3)-Algorithm,經由bytecode定義可得:P-type:C_num=0,P_num=1.C-type:P_num=0,C_num=1.O-type:不一定,視其功能而定。以O-type的attribute為尋找pattern的依據。P_num:向後尋找P_num個bytecodesC_num:向前尋找C_num個bytecodes,方法(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,繼續找下一個。針對continuouspattern設計。,未來進度,TracingcodeModifyingcodeSimulationPerformance,Tracingcode,EnvironmentconfigurationTracecodeConcentrateon“HowtoaddFoldingintoJIT?”,Modifyingcode,AddingFoldingtoJITModulizingFoldingandaddingitintoJITbetween“IRgenerator”and“Codegenerator”,IRGenerator,CodeGenerator,Bytecode,Nativecode,Folding,Simulation,RunbenchmarkonARMsimulatoronLinuxworkstationBenchmark:”EmbeddedCaffeineMark”,Performance,Findout“PerformanceSpeedup”afterusingfoldingSpeedup=(time_with_folding)/(t

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论