// pass 2)
ControlFlowGraph cfg = new ControlFlowGraph(mg);
// Build the initial frame situation for this method.
Frame f = new Frame(mg.getMaxLocals(), mg.getMaxStack());
if (!mg.isStatic()) {
if (mg.getName().equals(Constants.CONSTRUCTOR_NAME)) {
Frame._this = new UninitializedObjectType(new ObjectType(jc.getClassName()));
f.getLocals().set(0, Frame._this);
} else {
Frame._this = null;
f.getLocals().set(0, new ObjectType(jc.getClassName()));
}
}
Type[] argtypes = mg.getArgumentTypes();
int twoslotoffset = 0;
for (int j = 0; j < argtypes.length; j++) {
if (argtypes[j] == Type.SHORT || argtypes[j] == Type.BYTE
|| argtypes[j] == Type.CHAR
|| argtypes[j] == Type.BOOLEAN)
{
argtypes[j] = Type.INT;
}
f.getLocals().set(twoslotoffset + j
+ (mg.isStatic() ? 0 : 1),
argtypes[j]);
if (argtypes[j].getSize() == 2) {
twoslotoffset++;
f.getLocals().set(twoslotoffset + j
+ (mg.isStatic() ? 0 : 1),
Type.UNKNOWN);
}
}
circulationPump(cfg, cfg.contextOf(mg.getInstructionList()