本文整理了Java中javassist.bytecode.Bytecode.addPutstatic()
方法的一些代码示例,展示了Bytecode.addPutstatic()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bytecode.addPutstatic()
方法的具体详情如下:
包路径:javassist.bytecode.Bytecode
类名称:Bytecode
方法名:addPutstatic
[英]Appends PUTSTATIC.
[中]附加物。
代码示例来源:origin: redisson/redisson
int compileIfStatic(CtClass type, String name, Bytecode code,
Javac drv) throws CannotCompileException
{
int s = code.addMultiNewarray(type, dim);
code.addPutstatic(Bytecode.THIS, name, Descriptor.of(type));
return s; // stack size
}
}
代码示例来源:origin: redisson/redisson
int compileIfStatic(CtClass type, String name, Bytecode code,
Javac drv) throws CannotCompileException
{
code.addLdc2w(value);
code.addPutstatic(Bytecode.THIS, name, Descriptor.of(type));
return 2; // stack size
}
代码示例来源:origin: redisson/redisson
int compileIfStatic(CtClass type, String name, Bytecode code,
Javac drv) throws CannotCompileException
{
code.addLdc(value);
code.addPutstatic(Bytecode.THIS, name, Descriptor.of(type));
return 1; // stack size
}
代码示例来源:origin: redisson/redisson
int compileIfStatic(CtClass type, String name, Bytecode code,
Javac drv) throws CannotCompileException
{
addNewarray(code);
code.addPutstatic(Bytecode.THIS, name, Descriptor.of(type));
return 1; // stack size
}
}
代码示例来源:origin: redisson/redisson
int compileIfStatic(CtClass type, String name, Bytecode code,
Javac drv) throws CannotCompileException
{
code.addLdc2w(value);
code.addPutstatic(Bytecode.THIS, name, Descriptor.of(type));
return 2; // stack size
}
代码示例来源:origin: redisson/redisson
int compileIfStatic(CtClass type, String name, Bytecode code,
Javac drv) throws CannotCompileException
{
code.addIconst(value);
code.addPutstatic(Bytecode.THIS, name, Descriptor.of(type));
return 1; // stack size
}
代码示例来源:origin: redisson/redisson
int compileIfStatic(CtClass type, String name, Bytecode code,
Javac drv) throws CannotCompileException
{
code.addFconst(value);
code.addPutstatic(Bytecode.THIS, name, Descriptor.of(type));
return 2; // stack size
}
代码示例来源:origin: org.javassist/javassist
@Override
int compileIfStatic(CtClass type, String name, Bytecode code,
Javac drv) throws CannotCompileException
{
code.addFconst(value);
code.addPutstatic(Bytecode.THIS, name, Descriptor.of(type));
return 2; // stack size
}
代码示例来源:origin: org.javassist/javassist
@Override
int compileIfStatic(CtClass type, String name, Bytecode code,
Javac drv) throws CannotCompileException
{
code.addLdc2w(value);
code.addPutstatic(Bytecode.THIS, name, Descriptor.of(type));
return 2; // stack size
}
代码示例来源:origin: org.javassist/javassist
@Override
int compileIfStatic(CtClass type, String name, Bytecode code,
Javac drv) throws CannotCompileException
{
code.addLdc2w(value);
code.addPutstatic(Bytecode.THIS, name, Descriptor.of(type));
return 2; // stack size
}
代码示例来源:origin: org.javassist/javassist
@Override
int compileIfStatic(CtClass type, String name, Bytecode code,
Javac drv) throws CannotCompileException
{
int s = code.addMultiNewarray(type, dim);
code.addPutstatic(Bytecode.THIS, name, Descriptor.of(type));
return s; // stack size
}
}
代码示例来源:origin: org.javassist/javassist
@Override
int compileIfStatic(CtClass type, String name, Bytecode code,
Javac drv) throws CannotCompileException
{
code.addLdc(value);
code.addPutstatic(Bytecode.THIS, name, Descriptor.of(type));
return 1; // stack size
}
代码示例来源:origin: org.javassist/javassist
@Override
int compileIfStatic(CtClass type, String name, Bytecode code,
Javac drv) throws CannotCompileException
{
addNewarray(code);
code.addPutstatic(Bytecode.THIS, name, Descriptor.of(type));
return 1; // stack size
}
}
代码示例来源:origin: org.javassist/javassist
@Override
int compileIfStatic(CtClass type, String name, Bytecode code,
Javac drv) throws CannotCompileException
{
code.addIconst(value);
code.addPutstatic(Bytecode.THIS, name, Descriptor.of(type));
return 1; // stack size
}
代码示例来源:origin: redisson/redisson
int compileIfStatic(CtClass type, String name, Bytecode code,
Javac drv) throws CannotCompileException
{
try {
compileExpr(drv);
code.addPutstatic(Bytecode.THIS, name, Descriptor.of(type));
return code.getMaxStack();
}
catch (CompileError e) {
throw new CannotCompileException(e);
}
}
代码示例来源:origin: redisson/redisson
/**
* Produces codes for a static field.
*/
int compileIfStatic(CtClass type, String name, Bytecode code,
Javac drv) throws CannotCompileException
{
String desc;
int stacksize = 1;
if (stringParams == null)
desc = "()";
else {
desc = "([Ljava/lang/String;)";
stacksize += compileStringParameter(code);
}
String typeDesc = Descriptor.of(type);
code.addInvokestatic(objectType, methodName, desc + typeDesc);
code.addPutstatic(Bytecode.THIS, name, typeDesc);
return stacksize;
}
}
代码示例来源:origin: org.javassist/javassist
@Override
int compileIfStatic(CtClass type, String name, Bytecode code,
Javac drv) throws CannotCompileException
{
try {
compileExpr(drv);
code.addPutstatic(Bytecode.THIS, name, Descriptor.of(type));
return code.getMaxStack();
}
catch (CompileError e) {
throw new CannotCompileException(e);
}
}
代码示例来源:origin: redisson/redisson
/**
* Produces codes for a static field.
*/
int compileIfStatic(CtClass type, String name, Bytecode code,
Javac drv) throws CannotCompileException
{
String desc;
code.addNew(objectType);
code.add(Bytecode.DUP);
int stacksize = 2;
if (stringParams == null)
desc = "()V";
else {
desc = "([Ljava/lang/String;)V";
stacksize += compileStringParameter(code);
}
code.addInvokespecial(objectType, "<init>", desc);
code.addPutstatic(Bytecode.THIS, name, Descriptor.of(type));
return stacksize;
}
代码示例来源:origin: redisson/redisson
code.addPutstatic(classname, HOLDER, HOLDER_TYPE);
code.addPutstatic(classname, SERIAL_VERSION_UID_FIELD, SERIAL_VERSION_UID_TYPE);
code.addOpcode(Bytecode.RETURN);
minfo.setCodeAttribute(code.toCodeAttribute());
代码示例来源:origin: redisson/redisson
code.addPutstatic(Bytecode.THIS, fieldName, fieldType);
内容来源于网络,如有侵权,请联系作者删除!