Java 类com.sun.org.apache.bcel.internal.generic.Instruction 实例源码

项目:OpenJSharp    文件:MethodGenerator.java   
/**
 * 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);
    }
}
项目:OpenJSharp    文件:MethodGenerator.java   
/**
 * 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);
    }
}
项目:OpenJSharp    文件:VariableBase.java   
/**
 * 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;
}
项目:openjdk-jdk10    文件:BCELFactory.java   
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;
}
项目:openjdk-jdk10    文件:VariableBase.java   
/**
 * 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;
}
项目:openjdk-jdk10    文件:RealType.java   
public Instruction SUB() {
    return InstructionConst.DSUB;
}
项目:OpenJSharp    文件:Param.java   
/**
 * 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;
}
项目:OpenJSharp    文件:Param.java   
/**
 * 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;
}
项目:OpenJSharp    文件:StringType.java   
public Instruction STORE(int slot) {
    return new ASTORE(slot);
}
项目:OpenJSharp    文件:VoidType.java   
public Instruction POP() {
    return NOP;
}
项目:OpenJSharp    文件:IntType.java   
public Instruction ADD() {
    return InstructionConstants.IADD;
}
项目:openjdk-jdk10    文件:Type.java   
public Instruction MUL() {
    return null;            // should never be called
}
项目:openjdk-jdk10    文件:ReferenceType.java   
public Instruction STORE(int slot) {
    return new ASTORE(slot);
}
项目:openjdk-jdk10    文件:RealType.java   
public Instruction STORE(int slot) {
    return new DSTORE(slot);
}
项目:OpenJSharp    文件:IntType.java   
public Instruction REM() {
    return InstructionConstants.IREM;
}
项目:OpenJSharp    文件:IntType.java   
public Instruction NEG() {
    return InstructionConstants.INEG;
}
项目:openjdk-jdk10    文件:MethodGenerator.java   
public Instruction storeContextNode() {
    return storeCurrentNode();
}
项目:openjdk-jdk10    文件:AttributeSetMethodGenerator.java   
public Instruction loadParameter(int index) {
    return new ALOAD(index + PARAM_START_INDEX);
}
项目:OpenJSharp    文件:AttributeSetMethodGenerator.java   
public Instruction loadParameter(int index) {
    return new ALOAD(index + PARAM_START_INDEX);
}
项目:OpenJSharp    文件:AttributeSetMethodGenerator.java   
public Instruction storeParameter(int index) {
    return new ASTORE(index + PARAM_START_INDEX);
}
项目:OpenJSharp    文件:ObjectType.java   
public Instruction LOAD(int slot) {
    return new ALOAD(slot);
}
项目:OpenJSharp    文件:ObjectType.java   
public Instruction STORE(int slot) {
    return new ASTORE(slot);
}
项目:OpenJSharp    文件:RealType.java   
public Instruction ADD() {
    return InstructionConstants.DADD;
}
项目:OpenJSharp    文件:RealType.java   
public Instruction SUB() {
    return InstructionConstants.DSUB;
}
项目:OpenJSharp    文件:RealType.java   
public Instruction MUL() {
    return InstructionConstants.DMUL;
}
项目:openjdk-jdk10    文件:BooleanType.java   
public Instruction STORE(int slot) {
    return new ISTORE(slot);
}
项目:OpenJSharp    文件:RealType.java   
public Instruction REM() {
    return InstructionConstants.DREM;
}
项目:openjdk-jdk10    文件:NodeType.java   
public Instruction STORE(int slot) {
    return new ISTORE(slot);
}
项目:OpenJSharp    文件:RealType.java   
public Instruction LOAD(int slot) {
    return new DLOAD(slot);
}
项目:openjdk-jdk10    文件:TestGenerator.java   
public Instruction loadIterator() {
    return _aloadIterator;
}
项目:openjdk-jdk10    文件:CompareGenerator.java   
public Instruction loadIterator() {
    return _aloadIterator;
}
项目:OpenJSharp    文件:RealType.java   
public Instruction CMP(boolean less) {
    return less ? InstructionConstants.DCMPG : InstructionConstants.DCMPL;
}
项目:OpenJSharp    文件:RealType.java   
public Instruction DUP() {
    return DUP2;
}
项目:openjdk-jdk10    文件:Type.java   
public Instruction POP() {
    return POP;
}
项目:openjdk-jdk10    文件:Param.java   
/**
 * 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;
}
项目:OpenJSharp    文件:Type.java   
public Instruction MUL() {
    return null;            // should never be called
}
项目:OpenJSharp    文件:Type.java   
public Instruction DIV() {
    return null;            // should never be called
}
项目:OpenJSharp    文件:Type.java   
public Instruction REM() {
    return null;            // should never be called
}
项目:openjdk-jdk10    文件:IntType.java   
public Instruction DIV() {
    return InstructionConst.IDIV;
}
项目:OpenJSharp    文件:Type.java   
public Instruction LOAD(int slot) {
    return null;            // should never be called
}