| java.lang.Object org.cojen.classfile.AbstractCodeAssembler org.cojen.classfile.CodeBuilder
CodeBuilder | public class CodeBuilder extends AbstractCodeAssembler implements CodeBuffer,CodeAssembler(Code) | | This class is used as an aid in generating code for a method.
It controls the max stack, local variable allocation, labels and bytecode.
author: Brian S O'Neill |
Constructor Summary | |
public | CodeBuilder(MethodInfo info) Construct a CodeBuilder for the CodeAttr of the given MethodInfo. | public | CodeBuilder(MethodInfo info, boolean saveLineNumberInfo, boolean saveLocalVariableInfo) Construct a CodeBuilder for the CodeAttr of the given MethodInfo. |
Method Summary | |
public void | arrayLength() | public void | branch(Location location) | public void | breakpoint() | public void | checkCast(TypeDesc type) | public void | convert(TypeDesc fromType, TypeDesc toType) | public void | convert(TypeDesc fromType, TypeDesc toType, int fpConvertMode) | public Label | createLabel() | public LocalVariable | createLocalVariable(String name, TypeDesc type) | public void | dup() | public void | dup2() | public void | dup2X1() | public void | dup2X2() | public void | dupX1() | public void | dupX2() | public void | exceptionHandler(Location startLocation, Location endLocation, String catchClassName) | public byte[] | getByteCodes() | public ExceptionHandler[] | getExceptionHandlers() | public int | getMaxLocals() | public int | getMaxStackDepth() | public LocalVariable | getParameter(int index) | public int | getParameterCount() | public void | ifComparisonBranch(Location location, String choice) | public void | ifEqualBranch(Location location, boolean choice) | public void | ifNullBranch(Location location, boolean choice) | public void | ifZeroComparisonBranch(Location location, String choice) | public void | instanceOf(TypeDesc type) | public void | integerIncrement(LocalVariable local, int amount) | public void | invokeConstructor(TypeDesc[] params) | public void | invokeConstructor(String className, TypeDesc[] params) | public void | invokeConstructor(TypeDesc classDesc, TypeDesc[] params) | public void | invokeInterface(String className, String methodName, TypeDesc ret, TypeDesc[] params) | public void | invokeInterface(TypeDesc classDesc, String methodName, TypeDesc ret, TypeDesc[] params) | public void | invokePrivate(String methodName, TypeDesc ret, TypeDesc[] params) | public void | invokeStatic(String methodName, TypeDesc ret, TypeDesc[] params) | public void | invokeStatic(String className, String methodName, TypeDesc ret, TypeDesc[] params) | public void | invokeStatic(TypeDesc classDesc, String methodName, TypeDesc ret, TypeDesc[] params) | public void | invokeSuper(String superClassName, String methodName, TypeDesc ret, TypeDesc[] params) | public void | invokeSuper(TypeDesc superClassDesc, String methodName, TypeDesc ret, TypeDesc[] params) | public void | invokeSuperConstructor(TypeDesc[] params) | public void | invokeVirtual(String methodName, TypeDesc ret, TypeDesc[] params) | public void | invokeVirtual(String className, String methodName, TypeDesc ret, TypeDesc[] params) | public void | invokeVirtual(TypeDesc classDesc, String methodName, TypeDesc ret, TypeDesc[] params) | public void | jsr(Location location) | public void | loadConstant(String value) | public void | loadConstant(TypeDesc type) | public void | loadConstant(boolean value) | public void | loadConstant(int value) | public void | loadConstant(long value) | public void | loadConstant(float value) | public void | loadConstant(double value) | public void | loadField(String fieldName, TypeDesc type) | public void | loadField(String className, String fieldName, TypeDesc type) | public void | loadField(TypeDesc classDesc, String fieldName, TypeDesc type) | public void | loadFromArray(TypeDesc type) | public void | loadLocal(LocalVariable local) | public void | loadNull() | public void | loadStaticField(String fieldName, TypeDesc type) | public void | loadStaticField(String className, String fieldName, TypeDesc type) | public void | loadStaticField(TypeDesc classDesc, String fieldName, TypeDesc type) | public void | loadThis() | public void | mapLineNumber(int lineNumber) | public void | math(byte opcode) | public void | monitorEnter() | public void | monitorExit() | public void | newObject(TypeDesc type) | public void | newObject(TypeDesc type, int dimensions) | public void | nop() | public void | pop() | public void | pop2() | public void | ret(LocalVariable local) | public void | returnValue(TypeDesc type) | public void | returnVoid() | public void | storeField(String fieldName, TypeDesc type) | public void | storeField(String className, String fieldName, TypeDesc type) | public void | storeField(TypeDesc classDesc, String fieldName, TypeDesc type) | public void | storeLocal(LocalVariable local) | public void | storeStaticField(String fieldName, TypeDesc type) | public void | storeStaticField(String className, String fieldName, TypeDesc type) | public void | storeStaticField(TypeDesc classDesc, String fieldName, TypeDesc type) | public void | storeToArray(TypeDesc type) | public void | swap() | public void | swap2() | public void | switchBranch(int[] cases, Location[] locations, Location defaultLocation) | public void | throwObject() |
CodeBuilder | public CodeBuilder(MethodInfo info)(Code) | | Construct a CodeBuilder for the CodeAttr of the given MethodInfo. The
CodeBuffer for the CodeAttr is automatically set to this CodeBuilder.
|
CodeBuilder | public CodeBuilder(MethodInfo info, boolean saveLineNumberInfo, boolean saveLocalVariableInfo)(Code) | | Construct a CodeBuilder for the CodeAttr of the given MethodInfo. The
CodeBuffer for the CodeAttr is automatically set to this CodeBuilder.
Parameters: saveLineNumberInfo - When set false, all calls to mapLineNumberare ignored. By default, this value is true. Parameters: saveLocalVariableInfo - When set true, all local variableusage information is saved in the ClassFile. By default, this valueis false. See Also: CodeBuilder.mapLineNumber |
arrayLength | public void arrayLength()(Code) | | |
breakpoint | public void breakpoint()(Code) | | |
dup2X1 | public void dup2X1()(Code) | | |
dup2X2 | public void dup2X2()(Code) | | |
dupX1 | public void dupX1()(Code) | | |
dupX2 | public void dupX2()(Code) | | |
getByteCodes | public byte[] getByteCodes()(Code) | | |
getMaxLocals | public int getMaxLocals()(Code) | | |
getMaxStackDepth | public int getMaxStackDepth()(Code) | | |
getParameterCount | public int getParameterCount()(Code) | | |
ifEqualBranch | public void ifEqualBranch(Location location, boolean choice)(Code) | | |
ifNullBranch | public void ifNullBranch(Location location, boolean choice)(Code) | | |
invokeConstructor | public void invokeConstructor(TypeDesc[] params)(Code) | | |
invokeSuperConstructor | public void invokeSuperConstructor(TypeDesc[] params)(Code) | | |
loadConstant | public void loadConstant(boolean value)(Code) | | |
loadConstant | public void loadConstant(int value)(Code) | | |
loadConstant | public void loadConstant(long value)(Code) | | |
loadConstant | public void loadConstant(float value)(Code) | | |
loadConstant | public void loadConstant(double value)(Code) | | |
loadNull | public void loadNull()(Code) | | |
loadThis | public void loadThis()(Code) | | |
mapLineNumber | public void mapLineNumber(int lineNumber)(Code) | | |
math | public void math(byte opcode)(Code) | | |
monitorEnter | public void monitorEnter()(Code) | | |
monitorExit | public void monitorExit()(Code) | | |
returnVoid | public void returnVoid()(Code) | | |
swap2 | public void swap2()(Code) | | |
throwObject | public void throwObject()(Code) | | |
|
|