Título: Programmer-friendly decompiled Java
Autores: Naeem, Nomair A.
Fecha: 2006
Publicador: McGill University - MCGILL
Fuente:
Tipo: Electronic Thesis or Dissertation
Tema: Java (Computer program language)
Decompilers (Computer programs)
Descripción: Java decompilers convert Java class files to Java source. Common Java decompilers are javac-specific decompilers since they target bytecode produced from a particular javac compiler. We present work carried out on Dava, a tool-independent decompiler that decompiles bytecode produced from any compiler. A known deficiency of tool-independent decompilers is the generation of complicated decompiled Java source which does not resemble the original source as closely as output produced by javac-specific decompilers. This thesis tackles this short-coming, for Dava, by introducing a new back-end consisting of simplifying transformations.
The work presented can be broken into three major categories: transformations using tree traversals and pattern matching to simplify the control flow, the creation of a flow analysis framework for an Abstract Syntax Tree (AST) representation of Java source code and the implementation of flow analyses with their use in complicated transformations.
The pattern matching transformations rewrite the ASTs to semantically-equivalent ASTs that correspond to code that is easier for programmers to understand. The targeted Java constructs include If and If-Else aggregation, for-loop creation and the removal of abrupt control flow. Pattern matching using tree traversals has its limitations. Thus, we introduce a new structure-based data flow analysis framework that can be used to gather information required by more complex transformations. Popular compiler analyses e.g., reaching definitions, constant propagation etc. were implemented using the framework. Information from these analyses is then leveraged to perform more advanced AST transformations.
We performed experiments comparing different decompiler outputs for different sources of bytecode. The results from these experiments indicate that the new Dava back-end considerably improves code comprehensibility and readability.
Idioma: en