本文整理了Java中javassist.bytecode.Bytecode.addAstore()
方法的一些代码示例,展示了Bytecode.addAstore()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bytecode.addAstore()
方法的具体详情如下:
包路径:javassist.bytecode.Bytecode
类名称:Bytecode
方法名:addAstore
[英]Appends ASTORE or (WIDE) ASTORE_<n>
[中]附加ASTORE或(宽)ASTORE
代码示例来源:origin: redisson/redisson
static final void storeStack(CtClass[] params, boolean isStaticCall,
int regno, Bytecode bytecode) {
storeStack0(0, params.length, params, regno + 1, bytecode);
if (isStaticCall)
bytecode.addOpcode(ACONST_NULL);
bytecode.addAstore(regno);
}
代码示例来源:origin: org.javassist/javassist
static final void storeStack(CtClass[] params, boolean isStaticCall,
int regno, Bytecode bytecode) {
storeStack0(0, params.length, params, regno + 1, bytecode);
if (isStaticCall)
bytecode.addOpcode(ACONST_NULL);
bytecode.addAstore(regno);
}
代码示例来源:origin: redisson/redisson
addAstore(n);
代码示例来源:origin: redisson/redisson
protected void makeCode(CtClass[] paramTypes, ConstPool cp) {
Bytecode save = new Bytecode(cp, 0, 0);
Bytecode load = new Bytecode(cp, 0, 0);
int var = maxLocals;
int len = (paramTypes == null) ? 0 : paramTypes.length;
load.addAload(var);
makeCode2(save, load, 0, len, paramTypes, var + 1);
save.addAstore(var);
saveCode = save.get();
loadCode = load.get();
}
代码示例来源:origin: redisson/redisson
protected boolean doit(Bytecode b, int opcode) {
switch (opcode) {
case Opcode.RETURN :
break;
case ARETURN :
b.addAstore(var);
break;
case IRETURN :
b.addIstore(var);
break;
case LRETURN :
b.addLstore(var);
break;
case DRETURN :
b.addDstore(var);
break;
case FRETURN :
b.addFstore(var);
break;
default :
throw new RuntimeException("fatal");
}
b.addOpcode(Opcode.GOTO);
b.addIndex(target - b.currentPc() + 3);
return true;
}
}
代码示例来源:origin: org.javassist/javassist
addAstore(n);
代码示例来源:origin: org.javassist/javassist
protected void makeCode(CtClass[] paramTypes, ConstPool cp) {
Bytecode save = new Bytecode(cp, 0, 0);
Bytecode load = new Bytecode(cp, 0, 0);
int var = maxLocals;
int len = (paramTypes == null) ? 0 : paramTypes.length;
load.addAload(var);
makeCode2(save, load, 0, len, paramTypes, var + 1);
save.addAstore(var);
saveCode = save.get();
loadCode = load.get();
}
代码示例来源:origin: redisson/redisson
code.addAnewarray("java.lang.reflect.Method");
final int varArray = 0;
code.addAstore(varArray);
"forName", "(Ljava/lang/String;)Ljava/lang/Class;");
final int varClass = 1;
code.addAstore(varClass);
代码示例来源:origin: org.javassist/javassist
@Override
protected boolean doit(Bytecode b, int opcode) {
switch (opcode) {
case Opcode.RETURN :
break;
case ARETURN :
b.addAstore(var);
break;
case IRETURN :
b.addIstore(var);
break;
case LRETURN :
b.addLstore(var);
break;
case DRETURN :
b.addDstore(var);
break;
case FRETURN :
b.addFstore(var);
break;
default :
throw new RuntimeException("fatal");
}
b.addOpcode(Opcode.GOTO);
b.addIndex(target - b.currentPc() + 3);
return true;
}
}
代码示例来源:origin: redisson/redisson
int arrayVar = args + 1;
code.addGetstatic(thisClassName, HOLDER, HOLDER_TYPE);
code.addAstore(arrayVar);
代码示例来源:origin: redisson/redisson
b.incMaxLocals(1);
int pc = b.currentPc();
b.addAstore(var); // store an exception
if (rtype.isPrimitive()) {
char c = ((CtPrimitiveType)rtype).getDescriptor();
b.addAstore(returnVarNo);
b.addAstore(returnVarNo);
代码示例来源:origin: redisson/redisson
bytecode.addAstore(varNo);
else if (varType == DOUBLE)
bytecode.addDstore(varNo);
bytecode.addLstore(varNo);
else if (isRefType(varType))
bytecode.addAstore(varNo);
else
bytecode.addIstore(varNo);
代码示例来源:origin: redisson/redisson
bc.addExceptionHandler(start, end, bc.currentPc(), type);
bc.growStack(1);
bc.addAstore(var);
hasReturned = false;
if (block != null)
bc.addExceptionHandler(start, pcAnyCatch, pcAnyCatch, 0);
bc.growStack(1);
bc.addAstore(var);
hasReturned = false;
finallyBlock.accept(this);
代码示例来源:origin: redisson/redisson
private int insertAfterAdvice(Bytecode code, Javac jv, String src,
ConstPool cp, CtClass rtype, int varNo)
throws CompileError
{
int pc = code.currentPc();
if (rtype == CtClass.voidType) {
code.addOpcode(Opcode.ACONST_NULL);
code.addAstore(varNo);
jv.compileStmnt(src);
code.addOpcode(Opcode.RETURN);
if (code.getMaxLocals() < 1)
code.setMaxLocals(1);
}
else {
code.addStore(varNo, rtype);
jv.compileStmnt(src);
code.addLoad(varNo, rtype);
if (rtype.isPrimitive())
code.addOpcode(((CtPrimitiveType)rtype).getReturnOp());
else
code.addOpcode(Opcode.ARETURN);
}
return code.currentPc() - pc;
}
代码示例来源:origin: redisson/redisson
break;
case ARETURN :
b.addAstore(getVar(1));
jsrJmp(b);
b.addAload(var);
代码示例来源:origin: org.javassist/javassist
private int insertAfterAdvice(Bytecode code, Javac jv, String src,
ConstPool cp, CtClass rtype, int varNo)
throws CompileError
{
int pc = code.currentPc();
if (rtype == CtClass.voidType) {
code.addOpcode(Opcode.ACONST_NULL);
code.addAstore(varNo);
jv.compileStmnt(src);
code.addOpcode(Opcode.RETURN);
if (code.getMaxLocals() < 1)
code.setMaxLocals(1);
}
else {
code.addStore(varNo, rtype);
jv.compileStmnt(src);
code.addLoad(varNo, rtype);
if (rtype.isPrimitive())
code.addOpcode(((CtPrimitiveType)rtype).getReturnOp());
else
code.addOpcode(Opcode.ARETURN);
}
return code.currentPc() - pc;
}
代码示例来源:origin: redisson/redisson
bytecode.addAstore(retVar);
代码示例来源:origin: redisson/redisson
int var = jv.recordVariable(type, EXCEPTION_NAME);
jv.recordReturnType(type, false);
b.addAstore(var);
jv.compileStmnt(src);
b.addAload(var);
代码示例来源:origin: redisson/redisson
bc.incMaxLocals(1);
bc.addOpcode(DUP);
bc.addAstore(var);
bc.addOpcode(MONITORENTER);
代码示例来源:origin: redisson/redisson
Modifier.isStatic(getModifiers()));
int var = jv.recordVariable(exceptionType, exceptionName);
b.addAstore(var);
jv.compileStmnt(src);
内容来源于网络,如有侵权,请联系作者删除!