org.cojen.classfile
Class CodeDisassembler

java.lang.Object
  extended by org.cojen.classfile.CodeDisassembler

public class CodeDisassembler
extends Object

Disassembles a method into a CodeAssembler, which acts as a visitor.

Author:
Brian S O'Neill

Constructor Summary
CodeDisassembler(MethodInfo method)
           
 
Method Summary
 void disassemble(CodeAssembler assembler)
          Disassemble the MethodInfo into the given assembler.
 void disassemble(CodeAssembler assembler, LocalVariable[] params, Location returnLocation)
          Disassemble the MethodInfo into the given assembler.
protected  void error(byte opcode, String message)
          Invoked on disassembly errors.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CodeDisassembler

public CodeDisassembler(MethodInfo method)
                 throws IllegalArgumentException
Throws:
IllegalArgumentException - if method has no code
Method Detail

disassemble

public void disassemble(CodeAssembler assembler)
Disassemble the MethodInfo into the given assembler.

See Also:
CodeAssemblerPrinter

disassemble

public void disassemble(CodeAssembler assembler,
                        LocalVariable[] params,
                        Location returnLocation)
Disassemble the MethodInfo into the given assembler.

Parameters:
params - if not null, override the local variables which hold parameter values
returnLocation - if not null, disassemble will branch to this location upon seeing a return, leaving any arguments on the stack
See Also:
CodeAssemblerPrinter

error

protected void error(byte opcode,
                     String message)
Invoked on disassembly errors. By default, this method does nothing.



Copyright © 2004-2011 Brian S O'Neill. All Rights Reserved.