use of org.hotswap.agent.javassist.CtPrimitiveType in project HotswapAgent by HotswapProjects.
the class Expr method storeStack0.
private static void storeStack0(int i, int n, CtClass[] params, int regno, Bytecode bytecode) {
if (i >= n)
return;
else {
CtClass c = params[i];
int size;
if (c instanceof CtPrimitiveType)
size = ((CtPrimitiveType) c).getDataSize();
else
size = 1;
storeStack0(i + 1, n, params, regno + size, bytecode);
bytecode.addStore(regno, c);
}
}
use of org.hotswap.agent.javassist.CtPrimitiveType in project HotswapAgent by HotswapProjects.
the class Javac method makeDefaultBody.
private static void makeDefaultBody(Bytecode b, CtClass type) {
int op;
int value;
if (type instanceof CtPrimitiveType) {
CtPrimitiveType pt = (CtPrimitiveType) type;
op = pt.getReturnOp();
if (op == Opcode.DRETURN)
value = Opcode.DCONST_0;
else if (op == Opcode.FRETURN)
value = Opcode.FCONST_0;
else if (op == Opcode.LRETURN)
value = Opcode.LCONST_0;
else if (op == Opcode.RETURN)
value = Opcode.NOP;
else
value = Opcode.ICONST_0;
} else {
op = Opcode.ARETURN;
value = Opcode.ACONST_NULL;
}
if (value != Opcode.NOP)
b.addOpcode(value);
b.addOpcode(op);
}
Aggregations