Java bytecode engineering library
Program analysis, generation and transformation are useful techniques that can be used in many situations:
• Program analysis, which can range from a simple syntaxic parsing to a full semantic analysis, can be used to find potential bugs in applications, to detect unused code, to reverse engineer code, etc.
• Program generation is used in compilers. This include traditional compilers, but also stub or skeleton compilers used for distributed programming, Just in Time compilers, etc.
• Program transformation can be used to optimize or obfuscate programs, to insert debugging or performance monitoring code into applications, for aspect oriented programming, etc.
All these techniques can be used for any programming language, but this is more or less easy to do, depending on the language. In the case of Java they can be used on Java source code or on compiled Java classes. One of the advantages of working on compiled classes is that, obviously, the source code is not needed. Program transformations can therefore be used on any applications, including closed source and commercial ones. Another advantage of working on compiled code is that it becomes possible to analyze, generate or transform classes at runtime, just before they are loaded into the Java Virtual Machine (generating and compiling source code at runtime is possible, but this is really slow and requires a full Java compiler). The advantage is that tools such as stub compilers or aspect weavers become transparent to users. Due to the many possible usages of program analysis, generation and transformation techniques, many tools to analyze, generate and transform programs have been implemented, for many languages, Java included. ASM is one of these tools for the Java language, designed for runtime – but also offline – class
Get pdf download Java bytecode engineering library
Related Tutorial
Tags: aspect oriented programming, engineer code, engineering library, java bytecode, java classes, java compiler, java language, java source code, java virtual machine, library program, parsing, performance monitoring, program generation, program transformation, program transformations, programming language, semantic analysis, traditional compilers, transformation techniques, unused code
Comments
Leave a Reply