Faculty of Informatics – Università della Svizzera italiana (USI)

Dynamic Analysis on the JVM


DiSL and ShadowVM are dynamic program analysis frameworks for the JVM.

DiSL [1] offers a flexible, high-level programming model based on aspect-oriented-programming abstractions to concisely express dynamic analyses. We have recast many existing dynamic analyses in DiSL, resulting in much more compact and maintainable implementations. DiSL ensures comprehensive code coverage (i.e., all code that has a bytecode representation can be analyzed) and features a partial evaluator to optimize inserted instrumentation code. While DiSL performs instrumentation in a separate process, it provides reflective information on the supertypes of each class being instrumented [2][3]. The latest addition to DiSL consists in a controller for adaptive analyses that change the instrumentation at runtime. Thanks to the Dispatch API, DiSL is able to add or remove instrumentation from loaded classes at runtime.

ShadowVM [4] enables dynamic analysis in a separate process to minimize perturbations of the observed program. This setting avoids sharing states between the analysis and the observed application, preventing certain problems that may be introduced by less isolated approaches. Moreover, ShadowVM eases proper handling of all thread lifecycle events, and guarantees that all thread termination events are received even during the shutdown phase of the JVM. Both frameworks have been extended to integrate support for accurate profiling for Graal. The latest version of DiSL and ShadowVM supports Java 16.

We have used DiSL and ShadowVM for developing many artifacts and for different research tasks. Our frameworks have enabled the development of toolchains for characterizing the diversity and complexity workloads, such as tgp (for analyzing and optimizing task granularity) and P3 (for characterizing concurrent aspects of multithreaded applications). Both tools have been used for selecting and characterizing the benchmarks composing the Renaissance suite. Moreover, we have developed domain-specific dynamic analyses on top of DiSL and ShadowVM that have been applied on the wild thanks to NAB. Such analyses have also been used to identify candidate workloads from open-source GitHub projects to be included in Renaissance.

Both frameworks are available open-source [A] and have been successfully used by many researchers. DiSL has also been included in the SPEC Research Group’s repository of peer-reviewed tools for quantitative system evaluation and analysis.


Key Publications


[1] Lukás Marek, Alex Villazón, Yudi Zheng, Danilo Ansaloni, Walter Binder, Zhengwei Qi: DiSL: A Domain-specific Language for Bytecode Instrumentation. AOSD 2012: 239-250 [pdf]
[2] Andrea Rosà, Walter Binder: Optimizing Type-specific Instrumentation on the JVM with Reflective Supertype Information. J. Vis. Lang. Comput. 49: 29-45 (2018) [pdf]
[3] Andrea Rosà, Eduardo Rosales, Walter Binder: Accurate Reification of Complete Supertype Information for Dynamic Analysis on the JVM. GPCE 2017: 104-116 [pdf][video][slides]
[4] Lukás Marek, Stephen Kell, Yudi Zheng, Lubomír Bulej, Walter Binder, Petr Tuma, Danilo Ansaloni, Aibek Sarimbekov, Andreas Sewe: ShadowVM: Robust and Comprehensive Dynamic Program Analysis for the Java Platform. GPCE 2013: 105-114 [pdf]


Software


[A] See the software pages of DiSL and ShadowVM