ObjectWeb ASM
   HOME

TheInfoList



OR:

The ASM library is a project of the
OW2 OW2 is an independent non-profit international consortium dedicated to developing open-source software code infrastructure for middleware information systems. OW2 federates IT vendors and users, universities, and research centers from Europe, A ...
consortium. It provides a simple API for decomposing, modifying, and recomposing binary Java classes (i.e.
bytecode Bytecode (also called portable code or p-code) is a form of instruction set designed for efficient execution by a software interpreter. Unlike human-readable source code, bytecodes are compact numeric codes, constants, and references (norma ...
). The project was originally conceived and developed by Eric Bruneton. ASM is Java-centric at present, and does not currently have a backend that exposes other bytecode implementations (such as .NET bytecode,
Python Python may refer to: Snakes * Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia ** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia * Python (mythology), a mythical serpent Computing * Python (pro ...
bytecode, etc.). The name "ASM" is not an acronym: it is just a reference to the asm keyword of C, which allows some functions to be implemented in assembly language.


Uses

ASM provides a simple library that exposes the internal aggregate components of a given Java class through its
visitor A visitor, in English and Welsh law and history, is an overseer of an autonomous ecclesiastical or eleemosynary institution, often a charitable institution set up for the perpetual distribution of the founder's alms and bounty, who can interve ...
oriented API. ASM also provides, on top of this visitor API, a tree API that represents classes as object constructs. Both APIs can be used for modifying the binary bytecode, as well as generating new bytecode (via injection of new code into the existing code, or through generation of new classes altogether.) The ASM library has been used in several diverse applications, such as: ;Performance and Profiling :Instrumentation calls that capture performance metrics can be injected into Java class binaries to examine memory/coverage data. (For example, injecting instrumentation at entry/exit points.) ;Implementation of New Language Semantics :For example,
Groovy ''Groovy'' (or, less commonly, ''groovie'' or ''groovey'') is a slang colloquialism popular during the 1950s, '60s and '70s. It is roughly synonymous with words such as "excellent", "fashionable", or "amazing", depending on context. History The ...
uses ASM to generate its bytecode. Also, Aspect-Oriented additions to the Java language have been implemented by using ASM to decompose class structures for point-cut identification, and then again when reconstituting the class by injecting aspect-related code back into the binary. (See:
AspectWerkz AspectJ is an aspect-oriented programming (AOP) extension created at PARC for the Java programming language. It is available in Eclipse Foundation open-source projects, both stand-alone and integrated into Eclipse. AspectJ has become a widely us ...
)


Invokedynamic

Since version 3.2, ASM has added support for the new invokedynamic code, which allows method invocation relying on dynamic
type checking In computer programming, a type system is a logical system comprising a set of rules that assigns a property called a type to every "term" (a word, phrase, or other set of symbols). Usually the terms are various constructs of a computer progra ...
on the latest JDK 7 binaries, thus easing support for dynamically typed languages.


Release history

This table presents only releases with significant steps in ObjectWeb ASM history, aside from versions that mainly fixed bugs and improved performance.


See also

*
Byte Code Engineering Library The Byte Code Engineering Library (BCEL) is a project sponsored by the Apache Foundation previously under their Jakarta charter to provide a simple API for decomposing, modifying, and recomposing binary Java classes (I.e. bytecode). The project wa ...
*
Javassist Javassist (Java programming assistant) is a Java library providing a means to manipulate the Java bytecode of an application. In this sense Javassist provides the support for structural reflection, i.e. the ability to change the implementation of ...


References


External links

*{{official website
OW2 Home
- The OW2 Consortium Home Page.
AspectWerkz
- The AspectWerkz Project Home Page. (One of the high-visibility projects that makes use of ASM.)

OW2 Java APIs Java (programming language) libraries Software using the BSD license