public class CodeGenerator
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
CodeGenerator.EmitArrayElementCallback |
| Constructor and Description |
|---|
CodeGenerator(MethodBuilder methodBuilder) |
CodeGenerator(MethodBuilder methodBuilder,
int initialSize) |
| Modifier and Type | Method and Description |
|---|---|
void |
beginCatchBlock(Type<?> caughtType) |
Label |
beginExceptionBlock() |
void |
beginFinallyBlock() |
void |
call(ConstructorInfo constructor) |
void |
call(MethodInfo method) |
void |
call(OpCode opCode,
MethodInfo method) |
static boolean |
canEmitConstant(java.lang.Object value,
Type<?> type) |
LocalBuilder |
declareLocal(java.lang.String name,
Type<?> localType) |
LocalBuilder |
declareLocal(Type<?> localType) |
Label |
defineLabel() |
void |
dup() |
void |
dup2() |
void |
dup2x1() |
void |
dup2x2() |
void |
emit(OpCode opCode) |
void |
emit(OpCode opCode,
byte arg) |
void |
emit(OpCode opCode,
ConstructorInfo constructor) |
void |
emit(OpCode opCode,
double arg) |
void |
emit(OpCode opCode,
FieldInfo field) |
void |
emit(OpCode opCode,
float arg) |
void |
emit(OpCode opCode,
int arg) |
void |
emit(OpCode opCode,
Label label) |
void |
emit(OpCode opCode,
long arg) |
void |
emit(OpCode opCode,
MethodInfo method) |
void |
emit(OpCode opCode,
short arg) |
void |
emit(OpCode opCode,
java.lang.String arg) |
void |
emit(OpCode opCode,
Type<?> type) |
void |
emitArray(Type<?> elementType,
int count,
CodeGenerator.EmitArrayElementCallback emit) |
void |
emitBoolean(boolean value) |
void |
emitBox(Type<?> type) |
void |
emitByte(byte value) |
void |
emitCharacter(char value) |
void |
emitConstant(java.lang.Object value) |
void |
emitConstant(java.lang.Object value,
Type<?> type) |
void |
emitConstantArray(java.lang.Object array) |
void |
emitConversion(Type<?> sourceType,
Type<?> targetType) |
void |
emitDefaultValue(Type<?> type) |
void |
emitDouble(double value) |
void |
emitFloat(float value) |
void |
emitGoto(Label label) |
void |
emitInteger(int value) |
void |
emitLoad(LocalBuilder local) |
protected void |
emitLoad(Type<?> type,
int absoluteIndex) |
void |
emitLoadArgument(int index) |
protected void |
emitLoadConstant(int token) |
void |
emitLoadElement(Type<?> elementType) |
protected void |
emitLoadLongConstant(int token) |
void |
emitLong(long value) |
void |
emitMethod(MethodBase value) |
void |
emitNew(Type<?> type) |
void |
emitNewArray(Type<?> arrayType) |
void |
emitNewArray(Type<?> arrayType,
int dimensionsToInitialize) |
void |
emitNull() |
void |
emitReturn() |
void |
emitReturn(Type<?> returnType) |
void |
emitShort(short value) |
void |
emitStore(LocalBuilder local) |
protected void |
emitStore(Type<?> type,
int absoluteIndex) |
void |
emitStoreArgument(int index) |
void |
emitStoreElement(Type<?> elementType) |
void |
emitString(java.lang.String value) |
<E extends java.lang.Enum<E>> |
emitSwitch(E[] keys,
EnumSwitchCallback<E> callback) |
<E extends java.lang.Enum<E>> |
emitSwitch(E[] keys,
EnumSwitchCallback<E> callback,
SwitchOptions options) |
void |
emitSwitch(int[] keys,
SwitchCallback callback) |
void |
emitSwitch(int[] keys,
SwitchCallback callback,
SwitchOptions options) |
void |
emitSwitch(java.lang.String[] keys,
StringSwitchCallback callback) |
void |
emitSwitch(java.lang.String[] keys,
StringSwitchCallback callback,
SwitchOptions options) |
void |
emitThis() |
void |
emitType(Type<?> value) |
void |
emitUnbox(Type<?> type) |
void |
endExceptionBlock() |
void |
endTryBlock() |
void |
getField(FieldInfo field) |
void |
increment(LocalBuilder local,
int delta) |
void |
markLabel(Label label) |
int |
offset() |
void |
pop() |
void |
pop(Type<?> type) |
void |
pop2() |
void |
putField(FieldInfo field) |
public CodeGenerator(MethodBuilder methodBuilder)
public CodeGenerator(MethodBuilder methodBuilder, int initialSize)
public int offset()
public Label beginExceptionBlock()
public void endExceptionBlock()
public void endTryBlock()
public void beginCatchBlock(Type<?> caughtType)
public void beginFinallyBlock()
public Label defineLabel()
public void markLabel(Label label)
public LocalBuilder declareLocal(Type<?> localType)
public LocalBuilder declareLocal(java.lang.String name, Type<?> localType)
public void dup()
public void dup2()
public void dup2x1()
public void dup2x2()
public void pop()
public void pop2()
public void pop(Type<?> type)
public void emit(OpCode opCode)
public void emit(OpCode opCode, byte arg)
public void emit(OpCode opCode, short arg)
public void emit(OpCode opCode, int arg)
public void emit(OpCode opCode, long arg)
public void emit(OpCode opCode, float arg)
public void emit(OpCode opCode, double arg)
public void emit(OpCode opCode, java.lang.String arg)
public void emit(OpCode opCode, ConstructorInfo constructor)
public void emit(OpCode opCode, MethodInfo method)
public void call(MethodInfo method)
public void call(ConstructorInfo constructor)
public void call(OpCode opCode, MethodInfo method)
public void emitGoto(Label label)
public void emitReturn()
public void emitReturn(Type<?> returnType)
public void emitNew(Type<?> type)
public void emitNewArray(Type<?> arrayType)
public void emitNewArray(Type<?> arrayType, int dimensionsToInitialize)
public final void emitArray(Type<?> elementType, int count, CodeGenerator.EmitArrayElementCallback emit)
public void increment(LocalBuilder local, int delta)
public void emitLoad(LocalBuilder local)
public void emitStore(LocalBuilder local)
public void emitThis()
public void emitLoadArgument(int index)
protected void emitLoad(Type<?> type, int absoluteIndex)
public void emitStoreArgument(int index)
protected void emitStore(Type<?> type, int absoluteIndex)
public void emitLoadElement(Type<?> elementType)
public void emitStoreElement(Type<?> elementType)
public void getField(FieldInfo field)
public void putField(FieldInfo field)
public static boolean canEmitConstant(java.lang.Object value,
Type<?> type)
public void emitConstant(java.lang.Object value)
public void emitConstantArray(java.lang.Object array)
public void emitConstant(java.lang.Object value,
Type<?> type)
public void emitType(Type<?> value)
public void emitMethod(MethodBase value)
public void emitNull()
public void emitDefaultValue(Type<?> type)
public void emitBoolean(boolean value)
public void emitByte(byte value)
public void emitCharacter(char value)
public void emitShort(short value)
public void emitInteger(int value)
public void emitLong(long value)
public void emitFloat(float value)
public void emitDouble(double value)
public void emitString(java.lang.String value)
protected void emitLoadConstant(int token)
protected void emitLoadLongConstant(int token)
public void emitBox(Type<?> type)
public void emitUnbox(Type<?> type)
public void emitSwitch(int[] keys,
SwitchCallback callback)
public void emitSwitch(int[] keys,
SwitchCallback callback,
SwitchOptions options)
public <E extends java.lang.Enum<E>> void emitSwitch(E[] keys,
EnumSwitchCallback<E> callback)
public <E extends java.lang.Enum<E>> void emitSwitch(E[] keys,
EnumSwitchCallback<E> callback,
SwitchOptions options)
public void emitSwitch(java.lang.String[] keys,
StringSwitchCallback callback)
public void emitSwitch(java.lang.String[] keys,
StringSwitchCallback callback,
SwitchOptions options)