本文整理了Java中javassist.bytecode.Bytecode.addIload()
方法的一些代码示例,展示了Bytecode.addIload()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bytecode.addIload()
方法的具体详情如下:
包路径:javassist.bytecode.Bytecode
类名称:Bytecode
方法名:addIload
[英]Appends ILOAD or (WIDE) ILOAD_<n>
[中]附加ILOAD或(宽)ILOAD
代码示例来源:origin: redisson/redisson
private static int addLoad(Bytecode code, int n, Class type) {
if (type.isPrimitive()) {
if (type == Long.TYPE) {
code.addLload(n);
return 2;
}
else if (type == Float.TYPE)
code.addFload(n);
else if (type == Double.TYPE) {
code.addDload(n);
return 2;
}
else
code.addIload(n);
}
else
code.addAload(n);
return 1;
}
代码示例来源:origin: org.javassist/javassist
private static int addLoad(Bytecode code, int n, Class<?> type) {
if (type.isPrimitive()) {
if (type == Long.TYPE) {
code.addLload(n);
return 2;
}
else if (type == Float.TYPE)
code.addFload(n);
else if (type == Double.TYPE) {
code.addDload(n);
return 2;
}
else
code.addIload(n);
}
else
code.addAload(n);
return 1;
}
代码示例来源:origin: redisson/redisson
|| type == CtClass.byteType || type == CtClass.shortType
|| type == CtClass.intType)
addIload(n);
else if (type == CtClass.longType) {
addLload(n);
代码示例来源:origin: org.javassist/javassist
|| type == CtClass.byteType || type == CtClass.shortType
|| type == CtClass.intType)
addIload(n);
else if (type == CtClass.longType) {
addLload(n);
代码示例来源:origin: redisson/redisson
public void atVariable(Variable v) throws CompileError {
Declarator d = v.getDeclarator();
exprType = d.getType();
arrayDim = d.getArrayDim();
className = d.getClassName();
int var = getLocalVar(d);
if (arrayDim > 0)
bytecode.addAload(var);
else
switch (exprType) {
case CLASS :
bytecode.addAload(var);
break;
case LONG :
bytecode.addLload(var);
break;
case FLOAT :
bytecode.addFload(var);
break;
case DOUBLE :
bytecode.addDload(var);
break;
default : // BOOLEAN, BYTE, CHAR, SHORT, INT
bytecode.addIload(var);
break;
}
}
代码示例来源:origin: org.javassist/javassist
@Override
public void atVariable(Variable v) throws CompileError {
Declarator d = v.getDeclarator();
exprType = d.getType();
arrayDim = d.getArrayDim();
className = d.getClassName();
int var = getLocalVar(d);
if (arrayDim > 0)
bytecode.addAload(var);
else
switch (exprType) {
case CLASS :
bytecode.addAload(var);
break;
case LONG :
bytecode.addLload(var);
break;
case FLOAT :
bytecode.addFload(var);
break;
case DOUBLE :
bytecode.addDload(var);
break;
default : // BOOLEAN, BYTE, CHAR, SHORT, INT
bytecode.addIload(var);
break;
}
}
代码示例来源:origin: hibernate/hibernate-orm
code.addIload( 3 );
代码示例来源:origin: redisson/redisson
b.addIstore(getVar(1));
jsrJmp(b);
b.addIload(var);
break;
case LRETURN :
代码示例来源:origin: org.javassist/javassist
b.addIstore(getVar(1));
jsrJmp(b);
b.addIload(var);
break;
case LRETURN :
代码示例来源:origin: redisson/redisson
bytecode.addIload(var);
bytecode.addIload(var);
代码示例来源:origin: org.javassist/javassist
bytecode.addIload(var);
bytecode.addIload(var);
代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core
private static void addTypeDependDataLoad(Bytecode code, String typeName,
int i) {
if ((typeName.charAt(0) == 'L')
&& (typeName.charAt(typeName.length() - 1) == ';')
|| (typeName.charAt(0) == '[')) {
// reference type
code.addAload(i);
} else if (typeName.equals("Z") || typeName.equals("B")
|| typeName.equals("C") || typeName.equals("I")
|| typeName.equals("S")) {
// boolean, byte, char, int, short
code.addIload(i);
} else if (typeName.equals("D")) {
// double
code.addDload(i);
} else if (typeName.equals("F")) {
// float
code.addFload(i);
} else if (typeName.equals("J")) {
// long
code.addLload(i);
} else {
// bad type
throw new RuntimeException("bad type: " + typeName);
}
}
代码示例来源:origin: org.hibernate/com.springsource.org.hibernate
private static void addTypeDependDataLoad(Bytecode code, String typeName,
int i) {
if ((typeName.charAt(0) == 'L')
&& (typeName.charAt(typeName.length() - 1) == ';')
|| (typeName.charAt(0) == '[')) {
// reference type
code.addAload(i);
} else if (typeName.equals("Z") || typeName.equals("B")
|| typeName.equals("C") || typeName.equals("I")
|| typeName.equals("S")) {
// boolean, byte, char, int, short
code.addIload(i);
} else if (typeName.equals("D")) {
// double
code.addDload(i);
} else if (typeName.equals("F")) {
// float
code.addFload(i);
} else if (typeName.equals("J")) {
// long
code.addLload(i);
} else {
// bad type
throw new RuntimeException("bad type: " + typeName);
}
}
代码示例来源:origin: com.google.code.maven-play-plugin.org.playframework/play
static Bytecode makeBytecodeForLVStore(CtMethod method, String sig, String name, int slot) {
Bytecode b = new Bytecode(method.getMethodInfo().getConstPool());
b.addLdc(name);
if ("I".equals(sig) || "B".equals(sig) || "C".equals(sig) || "S".equals(sig) || "Z".equals(sig))
b.addIload(slot);
else if ("F".equals(sig))
b.addFload(slot);
else if ("J".equals(sig))
b.addLload(slot);
else if ("D".equals(sig))
b.addDload(slot);
else
b.addAload(slot);
String localVarDescriptor = sig;
if (!"B".equals(sig) && !"C".equals(sig) && !"D".equals(sig) && !"F".equals(sig) && !"I".equals(sig) && !"J".equals(sig)
&& !"S".equals(sig) && !"Z".equals(sig))
localVarDescriptor = "Ljava/lang/Object;";
Logger.trace("for variable '%s' in slot=%s, sig was '%s' and is now '%s'", name, slot, sig, localVarDescriptor);
b.addInvokestatic("play.classloading.enhancers.LocalvariablesNamesEnhancer$LocalVariablesNamesTracer", "addVariable",
"(Ljava/lang/String;" + localVarDescriptor + ")V");
return b;
}
代码示例来源:origin: org.jboss.seam/jboss-seam
private static int addLoad(Bytecode code, int n, Class type) {
if (type.isPrimitive()) {
if (type == Long.TYPE) {
code.addLload(n);
return 2;
}
else if (type == Float.TYPE)
code.addFload(n);
else if (type == Double.TYPE) {
code.addDload(n);
return 2;
}
else
code.addIload(n);
}
else
code.addAload(n);
return 1;
}
代码示例来源:origin: org.jboss/javassist
private static int addLoad(Bytecode code, int n, Class type) {
if (type.isPrimitive()) {
if (type == Long.TYPE) {
code.addLload(n);
return 2;
}
else if (type == Float.TYPE)
code.addFload(n);
else if (type == Double.TYPE) {
code.addDload(n);
return 2;
}
else
code.addIload(n);
}
else
code.addAload(n);
return 1;
}
代码示例来源:origin: hstaudacher/osgi-jax-rs-connector
private static int addLoad(Bytecode code, int n, Class type) {
if (type.isPrimitive()) {
if (type == Long.TYPE) {
code.addLload(n);
return 2;
}
else if (type == Float.TYPE)
code.addFload(n);
else if (type == Double.TYPE) {
code.addDload(n);
return 2;
}
else
code.addIload(n);
}
else
code.addAload(n);
return 1;
}
代码示例来源:origin: hstaudacher/osgi-jax-rs-connector
private static int addLoad(Bytecode code, int n, Class type) {
if (type.isPrimitive()) {
if (type == Long.TYPE) {
code.addLload(n);
return 2;
}
else if (type == Float.TYPE)
code.addFload(n);
else if (type == Double.TYPE) {
code.addDload(n);
return 2;
}
else
code.addIload(n);
}
else
code.addAload(n);
return 1;
}
代码示例来源:origin: org.jboss.javassist/com.springsource.javassist
private static int addLoad(Bytecode code, int n, Class type) {
if (type.isPrimitive()) {
if (type == Long.TYPE) {
code.addLload(n);
return 2;
}
else if (type == Float.TYPE)
code.addFload(n);
else if (type == Double.TYPE) {
code.addDload(n);
return 2;
}
else
code.addIload(n);
}
else
code.addAload(n);
return 1;
}
代码示例来源:origin: com.eclipsesource.jaxrs/jersey-all
private static int addLoad(Bytecode code, int n, Class type) {
if (type.isPrimitive()) {
if (type == Long.TYPE) {
code.addLload(n);
return 2;
}
else if (type == Float.TYPE)
code.addFload(n);
else if (type == Double.TYPE) {
code.addDload(n);
return 2;
}
else
code.addIload(n);
}
else
code.addAload(n);
return 1;
}
内容来源于网络,如有侵权,请联系作者删除!