Font Size: a A A

The Implementation And Optimization Of DiSL Weaver

Posted on:2014-02-08Degree:MasterType:Thesis
Country:ChinaCandidate:Y D ZhengFull Text:PDF
GTID:2248330392961624Subject:Computer Science and Technology
Abstract/Summary:PDF Full Text Request
Dynamicprogramanalysistoolssupportnumeroussoftwareengineeringtasks,in-cluding profling, debugging, testing, program comprehension, and reverse engineer-ing. A key technique for the implementation of dynamic program analysis tools isbytecode instrumentation, which has been supported by low-level bytecode engineer-ing libraries. However, building dynamic program analysis tools on top of low-levelbytecode engineering libraries makes the development and maintenance tedious, error-prone, and hence expensive. On the other side, researchers have explored the use ofaspect-oriented programming (AOP) language on developing dynamic programminganalysistools. AlthoughAOPofershigh-levelabstractionstoconciselyexpresscertaindynamic analysis, join point model of mainstream AOP languages is not well suited formany analysis tasks and the code generated by weavers in support of certain languagefeatures incurs high overhead.Recently,thedomain-specifcaspectlanguageDiSLhasbeenproposedtoimprovethe development on dynamic programming analysis tools. DiSL ofers an open joinpoint model where any region of bytecodes can be selected as join point, access toextensible static context and weave-time execution of user-defned static analysis code.Whilethelanguageitselfensuresthehighexpressivenessandtheconvenient,high-levelprogramming model, DiSL requires an implementation of weaver that provides highefciencyofdevelopedanalysistools. Moreover, despitethefactthatDiSLofershigh-level abstractions for the rapid development of efcient bytecode instrumentations, itis required that DiSL programmer should factor out the expressions to be evaluatedat weave-time, or otherwise generate a signifcant amount of dead code, which mayimpair some optimizations performed by the runtime. If the DiSL weaver provides aruntime optimization of the woven code, then the DiSL programming model will besimplifed. The scientifc contributions of this thesis are twofold:1. We present the efcient implementation of DiSL weaver, and evaluate it using arecast version of Senseo.2. We integrate a partial evaluator called Turbo into the DiSL weaver, and presentfourcasestudiestoillustratethebeneftsofTurbo. Withoneofthesecasestudies,theperformanceimpactofTurboisevaluatedbothonweave-timeandonruntimeof the woven applicationThe DiSL weaver presented in this thesis ofers direct inlining of instrumentedcode, efcient data passing using synthetic local variables and thread local variables,efcient access to comprehensive static and dynamic context information, and efcientmechanism to process arguments. The benefts of DiSL weaver is demonstrated with acasestudy,recastinganexistingcomplexdynamicanalysistooloriginallyimplementedin AspectJ. The partial evaluator Turbo processes the generated instrumentation code,performs constant propagation, conditional reduction, pattern-based code simplifca-tion, and executes pure functions at weave-time. With Turbo, it is often unnecessary towrap expressions for evaluation at weave-time in separate classes, as shown in severalcase studies.The evaluation result for DiSL weaver shows that the overhead factor introducedby DiSL version of Senseo is only3.09while for AspectJ version of Senseo, withthe same code coverage, the overhead is a factor of6.47. The evaluation result forTurbo shows that although Turbo increases weave-time by a factor of4.2while themanually tuned implementation is only10%slower than the baseline, they reach thesame high speedup of about13x for steady-state performance. To conclude this, theimplmentation of DiSL weaver incurs signifcantly less overhead than AspectJ, anda simple DiSL instrumentation optimized by Turbo can reach the same steady-stateperformance as a complicated, manually tuned instrumentation, at the expense of anincrease in weave-time.
Keywords/Search Tags:Bytecode instrumentation, dynamic program analy-sis, aspect-oriented programming, partial evaluation
PDF Full Text Request
Related items