本文整理汇总了Java中com.sun.org.apache.bcel.internal.generic.Instruction类的典型用法代码示例。如果您正苦于以下问题:Java Instruction类的具体用法?Java Instruction怎么用?Java Instruction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Instruction类属于com.sun.org.apache.bcel.internal.generic包,在下文中一共展示了Instruction类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadLocal
import com.sun.org.apache.bcel.internal.generic.Instruction; //导入依赖的package包/类
/**
* Helper method to generate an instance of a subclass of
* {@link LoadInstruction} based on the specified {@link Type} that will
* load the specified local variable
* @param index the JVM stack frame index of the variable that is to be
* loaded
* @param type the {@link Type} of the variable
* @return the generated {@link LoadInstruction}
*/
private static Instruction loadLocal(int index, Type type) {
if (type == Type.BOOLEAN) {
return new ILOAD(index);
} else if (type == Type.INT) {
return new ILOAD(index);
} else if (type == Type.SHORT) {
return new ILOAD(index);
} else if (type == Type.LONG) {
return new LLOAD(index);
} else if (type == Type.BYTE) {
return new ILOAD(index);
} else if (type == Type.CHAR) {
return new ILOAD(index);
} else if (type == Type.FLOAT) {
return new FLOAD(index);
} else if (type == Type.DOUBLE) {
return new DLOAD(index);
} else {
return new ALOAD(index);
}
}
示例2: storeLocal
import com.sun.org.apache.bcel.internal.generic.Instruction; //导入依赖的package包/类
/**
* Helper method to generate an instance of a subclass of
* {@link StoreInstruction} based on the specified {@link Type} that will
* store a value in the specified local variable
* @param index the JVM stack frame index of the variable that is to be
* stored
* @param type the {@link Type} of the variable
* @return the generated {@link StoredInstruction}
*/
private static Instruction storeLocal(int index, Type type) {
if (type == Type.BOOLEAN) {
return new ISTORE(index);
} else if (type == Type.INT) {
return new ISTORE(index);
} else if (type == Type.SHORT) {
return new ISTORE(index);
} else if (type == Type.LONG) {
return new LSTORE(index);
} else if (type == Type.BYTE) {
return new ISTORE(index);
} else if (type == Type.CHAR) {
return new ISTORE(index);
} else if (type == Type.FLOAT) {
return new FSTORE(index);
} else if (type == Type.DOUBLE) {
return new DSTORE(index);
} else {
return new ASTORE(index);
}
}
示例3: storeInstruction
import com.sun.org.apache.bcel.internal.generic.Instruction; //导入依赖的package包/类
/**
* Returns an instruction for storing a value from the JVM stack
* into this variable.
*/
public Instruction storeInstruction() {
final Instruction instr = _storeInstruction;
if (_storeInstruction == null) {
_storeInstruction = _type.STORE(_local.getIndex());
}
return _storeInstruction;
}
示例4: visitInstruction
import com.sun.org.apache.bcel.internal.generic.Instruction; //导入依赖的package包/类
private boolean visitInstruction( final Instruction i ) {
final short opcode = i.getOpcode();
if ((InstructionConst.getInstruction(opcode) != null)
&& !(i instanceof ConstantPushInstruction) && !(i instanceof ReturnInstruction)) { // Handled below
_out.println("il.append(InstructionConst."
+ i.getName().toUpperCase(Locale.ENGLISH) + ");");
return true;
}
return false;
}
示例5: loadInstruction
import com.sun.org.apache.bcel.internal.generic.Instruction; //导入依赖的package包/类
/**
* Returns an instruction for loading the value of this variable onto
* the JVM stack.
*/
public Instruction loadInstruction() {
if (_loadInstruction == null) {
_loadInstruction = _type.LOAD(_local.getIndex());
}
return _loadInstruction;
}
示例6: SUB
import com.sun.org.apache.bcel.internal.generic.Instruction; //导入依赖的package包/类
public Instruction SUB() {
return InstructionConst.DSUB;
}
示例7: setLoadInstruction
import com.sun.org.apache.bcel.internal.generic.Instruction; //导入依赖的package包/类
/**
* Set the instruction for loading the value of this variable onto the
* JVM stack and returns the old instruction.
*/
public Instruction setLoadInstruction(Instruction instruction) {
Instruction tmp = _loadInstruction;
_loadInstruction = instruction;
return tmp;
}
示例8: setStoreInstruction
import com.sun.org.apache.bcel.internal.generic.Instruction; //导入依赖的package包/类
/**
* Set the instruction for storing a value from the stack into this
* variable and returns the old instruction.
*/
public Instruction setStoreInstruction(Instruction instruction) {
Instruction tmp = _storeInstruction;
_storeInstruction = instruction;
return tmp;
}
示例9: STORE
import com.sun.org.apache.bcel.internal.generic.Instruction; //导入依赖的package包/类
public Instruction STORE(int slot) {
return new ASTORE(slot);
}
示例10: POP
import com.sun.org.apache.bcel.internal.generic.Instruction; //导入依赖的package包/类
public Instruction POP() {
return NOP;
}
示例11: ADD
import com.sun.org.apache.bcel.internal.generic.Instruction; //导入依赖的package包/类
public Instruction ADD() {
return InstructionConstants.IADD;
}
示例12: MUL
import com.sun.org.apache.bcel.internal.generic.Instruction; //导入依赖的package包/类
public Instruction MUL() {
return null; // should never be called
}
示例13: STORE
import com.sun.org.apache.bcel.internal.generic.Instruction; //导入依赖的package包/类
public Instruction STORE(int slot) {
return new DSTORE(slot);
}
示例14: REM
import com.sun.org.apache.bcel.internal.generic.Instruction; //导入依赖的package包/类
public Instruction REM() {
return InstructionConstants.IREM;
}
示例15: NEG
import com.sun.org.apache.bcel.internal.generic.Instruction; //导入依赖的package包/类
public Instruction NEG() {
return InstructionConstants.INEG;
}