当前位置: 首页>>代码示例>>Java>>正文


Java Instruction类代码示例

本文整理汇总了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);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:31,代码来源:MethodGenerator.java

示例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);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:31,代码来源:MethodGenerator.java

示例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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:12,代码来源:VariableBase.java

示例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;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:BCELFactory.java

示例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;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:VariableBase.java

示例6: SUB

import com.sun.org.apache.bcel.internal.generic.Instruction; //导入依赖的package包/类
public Instruction SUB() {
    return InstructionConst.DSUB;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:4,代码来源:RealType.java

示例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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:Param.java

示例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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:Param.java

示例9: STORE

import com.sun.org.apache.bcel.internal.generic.Instruction; //导入依赖的package包/类
public Instruction STORE(int slot) {
    return new ASTORE(slot);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:4,代码来源:StringType.java

示例10: POP

import com.sun.org.apache.bcel.internal.generic.Instruction; //导入依赖的package包/类
public Instruction POP() {
    return NOP;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:4,代码来源:VoidType.java

示例11: ADD

import com.sun.org.apache.bcel.internal.generic.Instruction; //导入依赖的package包/类
public Instruction ADD() {
    return InstructionConstants.IADD;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:4,代码来源:IntType.java

示例12: MUL

import com.sun.org.apache.bcel.internal.generic.Instruction; //导入依赖的package包/类
public Instruction MUL() {
    return null;            // should never be called
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:4,代码来源:Type.java

示例13: STORE

import com.sun.org.apache.bcel.internal.generic.Instruction; //导入依赖的package包/类
public Instruction STORE(int slot) {
    return new DSTORE(slot);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:4,代码来源:RealType.java

示例14: REM

import com.sun.org.apache.bcel.internal.generic.Instruction; //导入依赖的package包/类
public Instruction REM() {
    return InstructionConstants.IREM;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:4,代码来源:IntType.java

示例15: NEG

import com.sun.org.apache.bcel.internal.generic.Instruction; //导入依赖的package包/类
public Instruction NEG() {
    return InstructionConstants.INEG;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:4,代码来源:IntType.java


注:本文中的com.sun.org.apache.bcel.internal.generic.Instruction类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。