Top Inners Fields Constructors Methods
javassist.compiler

public abstract Class CodeGen

extends Visitor
implements Opcode, TokenId
Class Inheritance
All Implemented Interfaces
javassist.compiler.TokenId, javassist.bytecode.Opcode
Known Direct Subclasses
javassist.compiler.MemberCodeGen
Imports
java.util.ArrayList, .Arrays, .List, javassist.bytecode.Bytecode, .Opcode, javassist.compiler.ast.ASTList, .ASTree, .ArrayInit, .AssignExpr, .BinExpr, .CallExpr, .CastExpr, .CondExpr, .Declarator, .DoubleConst, .Expr, .FieldDecl, .InstanceOfExpr, .IntConst, .Keyword, .Member, .MethodDecl, .NewExpr, .Pair, .Stmnt, .StringL, .Symbol, .Variable, .Visitor

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected abstract static class
CodeGen.ReturnHook

doit() in ReturnHook is called from atReturn().

Field Summary

Modifier and TypeField and Description
protected int
pack-priv static final int[]
protected List<Integer>
protected Bytecode
private static final int[]
protected String
protected List<Integer>
protected int
protected boolean
hasReturned

true if the last visited node is a return statement.

private static final int[]
private static final int[]
public boolean
inStaticMethod

Must be true if compilation is for a static method.

pack-priv static final String
pack-priv static final String
pack-priv static final String
pack-priv static final String
private static final int
private static final int
private static final int
private static final int
private static final int
protected CodeGen.ReturnHook
private int
pack-priv TypeChecker

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
arrayAccess(ASTree array, ASTree index)

private void
atArithBinExpr(Expr expr, int token, int index, int type1)

private void
atArrayAssign(Expr expr, int op, Expr array, ASTree right, boolean doDup)

public abstract void
public void
atArrayPlusPlus(int token, boolean isPost, Expr expr, boolean doDup)

public void
atArrayRead(ASTree array, ASTree index)

protected abstract void
atArrayVariableAssign(ArrayInit init, int varType, int varArray, String varClass)

protected void
atAssignCore(Expr expr, int op, ASTree right, int type, int dim, String cname)

public void
protected void
atAssignExpr(AssignExpr expr, boolean doDup)

public void
public void
private void
atBreakStmnt(Stmnt st, boolean notCont)

public abstract void
public void
public void
protected void
public void
public void
public void
public void
protected abstract void
atFieldAssign(Expr expr, int op, ASTree left, ASTree right, boolean doDup)

public void
protected abstract void
atFieldPlusPlus(int token, boolean isPost, ASTree oprand, Expr expr, boolean doDup)

protected abstract void
private void
private void
public void
public void
public void
public abstract void
public void
atMethodBody(Stmnt s, boolean
true if super() must be called. false if the method is a class initializer.
isCons
,
boolean isVoid)

public void
public abstract void
pack-priv void
atNumCastExpr(int srcType, int destType)

public void
private void
atPlusPlus(int token, ASTree oprand, Expr expr, boolean doDup)

protected void
atPlusPlusCore(int dup_code, boolean doDup, int token, boolean isPost, Expr expr)

protected void
protected final void
public void
private void
atStringConcatExpr(Expr expr, int type1, int dim1, String cname1)

public void
private void
atStringPlusEq(Expr expr, int type, int dim, String cname, ASTree right)

private void
public void
private void
private void
protected void
public void
private void
atVariableAssign(Expr expr, int op, Variable var, Declarator d, ASTree right, boolean doDup)

private void
atWhileStmnt(Stmnt st, boolean notDo)

protected static void
protected static void
badType(Expr expr)

protected static void
badTypes(Expr expr)

private boolean
booleanExpr(boolean branchIf, ASTree expr)

private String
private void
compareExpr(boolean branchIf, int token, int type1, BinExpr expr)

public boolean
compileBooleanExpr(boolean branchIf, ASTree expr)

public void
private int
private int
private int
computeStringLabel(ASTree expr, int tmpVar, List<Integer> gotoDefaults)

private void
convertOprandTypes(int type1, int type2, Expr expr)

private void
convToString(int type, int dim)

public void
protected static void
protected static int
getArrayReadOp(int type, int dim)

protected static int
getArrayWriteOp(int type, int dim)

pack-priv static int
private static int
protected int
public int
protected abstract String
getSuperName()

Returns the JVM-internal representation of this super class name.

protected int
getTempVar()

Returns a local variable that single or double words can be stored in.

protected abstract String
getThisName()

Returns the JVM-internal representation of this class name.

protected void
incMaxLocals(int size)

protected abstract void
private boolean
invalidDim(int srcType, int srcDim, String srcClass, int destType, int destDim, String destClass, boolean isCast)

public static boolean
is2word(int type, int dim)

private static boolean
isAlwaysBranch(ASTree expr, boolean branchIf)

pack-priv static boolean
isP_INT(int type)

private static boolean
protected static boolean
isRefType(int type)

pack-priv static int
lookupBinOp(int token)

private boolean
protected void
patchGoto(List<Integer> list, int targetPc)

protected abstract String
protected abstract String
resolveClassName(String jvmClassName)

pack-priv static boolean
rightIsStrong(int type1, int type2)

public void
setMaxLocals(int n)

public void
protected static String
toJvmArrayName(String
the JVM-internal representation. name is not exapnded to java.lang.*.
name
,
int dim)

protected static String
toJvmTypeName(int type, int dim)

private static int
typePrecedence(int type)