本文整理汇总了Java中org.apache.bcel.generic.LSTORE类的典型用法代码示例。如果您正苦于以下问题:Java LSTORE类的具体用法?Java LSTORE怎么用?Java LSTORE使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LSTORE类属于org.apache.bcel.generic包,在下文中一共展示了LSTORE类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: removeUnusedLocals
import org.apache.bcel.generic.LSTORE; //导入依赖的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);
}
}
}
}
}
示例2: createInstructionLstore
import org.apache.bcel.generic.LSTORE; //导入依赖的package包/类
@SuppressWarnings("unused")
// Called using reflection
private Instruction createInstructionLstore(Element inst) throws IllegalXMLVMException {
// BCEL's LSTORE creation instruction only takes an integer!!!
int idx = Integer.parseInt(inst.getAttributeValue("index"));
return new LSTORE(idx);
}
示例3: visitLSTORE
import org.apache.bcel.generic.LSTORE; //导入依赖的package包/类
/** Checks if the constraints of operands of the said instruction(s) are satisfied. */
public void visitLSTORE(LSTORE o){
int idx = o.getIndex();
if (idx < 0){
constraintViolated(o, "Index '"+idx+"' must be non-negative. [Constraint by JustIce as an analogon to the single-slot xLOAD/xSTORE instructions; may not happen anyway.]");
}
else{
int maxminus2 = max_locals()-2;
if (idx > maxminus2){
constraintViolated(o, "Index '"+idx+"' must not be greater than max_locals-2 '"+maxminus2+"'.");
}
}
}
示例4: initSpawnTargets
import org.apache.bcel.generic.LSTORE; //导入依赖的package包/类
void initSpawnTargets(InstructionList il) {
for (int i = 0; i < idTable.size(); i++) {
InstructionList storeIns = getStoreIns(i);
if (storeIns == null) {
continue;
}
if (isArrayStore(storeIns.getStart())) {
continue;
}
Instruction store = storeIns.getStart().getInstruction();
if (store instanceof LSTORE) {
il.insert(new LCONST(0));
il.append(il.getStart(), store);
} else if (store instanceof ISTORE) {
il.insert(new ICONST(0));
il.append(il.getStart(), store);
} else if (store instanceof FSTORE) {
il.insert(new FCONST((float) 0.0));
il.append(il.getStart(), store);
} else if (store instanceof DSTORE) {
il.insert(new DCONST(0.0));
il.append(il.getStart(), store);
} else if (store instanceof ASTORE) {
il.insert(new ACONST_NULL());
il.append(il.getStart(), store);
} else if (store instanceof PUTFIELD) {
// no need to init.
} else if (store instanceof PUTSTATIC) {
// no need to init.
} else if (store instanceof ALOAD) {
// no need to init.
} else {
System.err.println("WARNING: Unhandled store instruction in "
+ "initSpawnTargets, opcode = " + store.getOpcode()
+ " ins = " + store);
// System.exit(1);
}
}
}