本文整理汇总了Java中org.apache.bcel.generic.FLOAD类的典型用法代码示例。如果您正苦于以下问题:Java FLOAD类的具体用法?Java FLOAD怎么用?Java FLOAD使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FLOAD类属于org.apache.bcel.generic包,在下文中一共展示了FLOAD类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: pushParams
import org.apache.bcel.generic.FLOAD; //导入依赖的package包/类
InstructionHandle pushParams(InstructionList il, Method m) {
Type[] params = mtab.typesOfParams(m);
InstructionHandle pos = il.getStart();
for (int i = 0, param = 0; i < params.length; i++, param++) {
if (params[i].equals(Type.BOOLEAN) || params[i].equals(Type.BYTE)
|| params[i].equals(Type.SHORT) || params[i].equals(Type.CHAR)
|| params[i].equals(Type.INT)) {
il.insert(pos, new ILOAD(param));
} else if (params[i].equals(Type.FLOAT)) {
il.insert(pos, new FLOAD(param));
} else if (params[i].equals(Type.LONG)) {
il.insert(pos, new LLOAD(param));
param++;
} else if (params[i].equals(Type.DOUBLE)) {
il.insert(pos, new DLOAD(param));
param++;
} else {
il.insert(pos, new ALOAD(param));
}
}
return pos;
}
示例2: removeUnusedLocals
import org.apache.bcel.generic.FLOAD; //导入依赖的package包/类
void removeUnusedLocals(Method mOrig, MethodGen m) {
InstructionList il = m.getInstructionList();
InstructionHandle[] ins = il.getInstructionHandles();
for (int i = 0; i < ins.length; i++) {
Instruction in = ins[i].getInstruction();
if (in instanceof LocalVariableInstruction) {
LocalVariableInstruction curr = (LocalVariableInstruction) in;
if (mtab.getLocal(m, curr, ins[i].getPosition()) != null
&& curr.getIndex() < m.getMaxLocals() - 5
&& !mtab.isLocalUsedInInlet(mOrig, curr.getIndex())) {
if (curr instanceof IINC) {
ins[i].setInstruction(new NOP());
} else if (curr instanceof LSTORE || curr instanceof DSTORE) {
ins[i].setInstruction(new POP2());
} else if (curr instanceof StoreInstruction) {
ins[i].setInstruction(new POP());
} else if (curr instanceof ALOAD) {
ins[i].setInstruction(new ACONST_NULL());
} else if (curr instanceof FLOAD) {
ins[i].setInstruction(new FCONST((float) 0.0));
} else if (curr instanceof ILOAD) {
ins[i].setInstruction(new ICONST(0));
} else if (curr instanceof DLOAD) {
ins[i].setInstruction(new DCONST(0.0));
} else if (curr instanceof LLOAD) {
ins[i].setInstruction(new LCONST(0L));
} else {
System.out.println("unhandled ins in "
+ "removeUnusedLocals: " + curr);
System.exit(1);
}
}
}
}
}
示例3: visitFLOAD
import org.apache.bcel.generic.FLOAD; //导入依赖的package包/类
/** Checks if the constraints of operands of the said instruction(s) are satisfied. */
public void visitFLOAD(FLOAD o){
int idx = o.getIndex();
if (idx < 0){
constraintViolated(o, "Index '"+idx+"' must be non-negative.");
}
else{
int maxminus1 = max_locals()-1;
if (idx > maxminus1){
constraintViolated(o, "Index '"+idx+"' must not be greater than max_locals-1 '"+maxminus1+"'.");
}
}
}
示例4: createInstructionFload
import org.apache.bcel.generic.FLOAD; //导入依赖的package包/类
@SuppressWarnings("unused")
// Called using reflection
private Instruction createInstructionFload(Element inst) throws IllegalXMLVMException {
int idx = Integer.parseInt(inst.getAttributeValue("index"));
return new FLOAD(idx);
}