org.objectweb.asm.commons

Class JSRInlinerAdapter

public class JSRInlinerAdapter extends MethodNode implements Opcodes

A MethodAdapter that removes JSR instructions and inlines the referenced subroutines. Explanation of how it works TODO

Author: Niko Matsakis

Nested Class Summary
protected static classJSRInlinerAdapter.Subroutine
Constructor Summary
JSRInlinerAdapter(MethodVisitor mv, int access, String name, String desc, String signature, String[] exceptions)
Creates a new JSRInliner.
Method Summary
voidvisitEnd()
If any JSRs were seen, triggers the inlining process.
voidvisitJumpInsn(int opcode, Label lbl)
Detects a JSR instruction and sets a flag to indicate we will need to do inlining.

Constructor Detail

JSRInlinerAdapter

public JSRInlinerAdapter(MethodVisitor mv, int access, String name, String desc, String signature, String[] exceptions)
Creates a new JSRInliner.

Parameters: mv the MethodVisitor to send the resulting inlined method code to (use null for none). access the method's access flags (see Opcodes). This parameter also indicates if the method is synthetic and/or deprecated. name the method's name. desc the method's descriptor (see Type). signature the method's signature. May be null. exceptions the internal names of the method's exception classes (see getInternalName). May be null.

Method Detail

visitEnd

public void visitEnd()
If any JSRs were seen, triggers the inlining process. Otherwise, forwards the byte codes untouched.

visitJumpInsn

public void visitJumpInsn(int opcode, Label lbl)
Detects a JSR instruction and sets a flag to indicate we will need to do inlining.