ASM 4.0
A Java bytecode engineering library
Eric BrunetonCopyright c/circlecopyrt2007, 2011 Eric Bruneton
All rights reserved.
Redistribution and use in source (L YX format) and compiled forms (L ATEX,
PDF, PostScript, HTML, RTF, etc), with or without modification, are per-
mitted provided that the following conditions are met:
1. Redistributions of source code (L YX format) must retain the above copy-
right notice, this list of conditions and the following disclaimer.
2. Redistributions in compiled form (converted to L ATEX, PDF, PostScript,
HTML, RTF, and other formats) must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the docu-
mentation and/or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products
derived from this documentation without specific prior written permis-
sion.
THISDOCUMENTATIONISPROVIDEDBYTHEAUTHOR“ASIS”AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
NOEVENTSHALLTHEAUTHORBELIABLEFORANYDIRECT,INDI-
RECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS DOCUMENTATION,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Version 2.0, September 2011Contents
1. Introduction 1
1.1. Motivations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2.1. Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2.2. Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2.3. Architecture . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3. Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.4. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . 6
I. Core API 7
2. Classes 9
2.1. Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.1.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.1.2. Internal names . . . . . . . . . . . . . . . . . . . . . . . 11
2.1.3. Type descriptors . . . . . . . . . . . . . . . . . . . . . . 11
2.1.4. Method descriptors . . . . . . . . . . . . . . . . . . . . . 12
2.2. Interfaces and components . . . . . . . . . . . . . . . . . . . . . 12
2.2.1. Presentation . . . . . . . . . . . . . . . . . . . . . . . . 12
2.2.2. Parsing classes . . . . . . . . . . . . . . . . . . . . . . . 14
2.2.3. Generating classes . . . . . . . . . . . . . . . . . . . . . 16
2.2.4. Transforming classes . . . . . . . . . . . . . . . . . . . . 18
2.2.5. Removing class members . . . . . . . . . . . . . . . . . 22
2.2.6. Adding class members . . . . . . . . . . . . . . . . . . . 23
2.2.7. Transformation chains . . . . . . . . . . . . . . . . . . . 25
2.3. Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.3.1.Type. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.3.2.TraceClassVisitor . . . . . . . . . . . . . . . . . . . . 27
2.3.3.CheckClassAdapter . . . . . . . . . . . . . . . . . . . . 28
2.3.4.ASMifier . . . . . . . . . . . . . . . . . . . . . . . . . . 28
iContents
3. Methods 31
3.1. Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
3.1.1. Execution model . . . . . . . . . . . . . . . . . . . . . . 31
3.1.2. Bytecode instructions . . . . . . . . . . . . . . . . . . . 33
3.1.3. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 35
3.1.4. Exception handlers . . . . . . . . . . . . . . . . . . . . . 38
3.1.5. Frames . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.2. Interfaces and components . . . . . . . . . . . . . . . . . . . .
asm4-guide
安全标准 >
国标 >
文档预览
中文文档
154 页
50 下载
1000 浏览
0 评论
309 收藏
3.0分
温馨提示:本文档共154页,可预览 3 页,如浏览全部内容或当前文档出现乱码,可开通会员下载原始文档
本文档由 思考人生 于 2023-12-02 21:08:13上传分享