com.sun.org.apache.bcel.internal.generic.Instruction Java Examples

The following examples show how to use com.sun.org.apache.bcel.internal.generic.Instruction. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MethodGenerator.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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);
    }
}
 
Example #2
Source File: MethodGenerator.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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);
    }
}
 
Example #3
Source File: VariableBase.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * Returns an instruction for storing a value from the JVM stack
 * into this variable.
 */
public Instruction storeInstruction() {
    if (_storeInstruction == null) {
        _storeInstruction = _type.STORE(_local.getIndex());
    }
    return _storeInstruction;
}
 
Example #4
Source File: CompareGenerator.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public Instruction loadIterator() {
    return _aloadIterator;
}
 
Example #5
Source File: CompareGenerator.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public Instruction storeCurrentNode() {
    return _istoreCurrent;
}
 
Example #6
Source File: MethodGenerator.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public final Instruction reset() {
    return _reset;
}
 
Example #7
Source File: ResultTreeType.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public Instruction LOAD(int slot) {
    return new ALOAD(slot);
}
 
Example #8
Source File: TestGenerator.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public Instruction loadDOM() {
    return _aloadDom;
}
 
Example #9
Source File: CompareGenerator.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public Instruction loadDOM() {
    return _aloadDom;
}
 
Example #10
Source File: MatchGenerator.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Get index of the register where the DOM is stored.
 */
public Instruction loadDOM() {
    return _aloadDom;
}
 
Example #11
Source File: IntType.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public Instruction STORE(int slot) {
    return new ISTORE(slot);
}
 
Example #12
Source File: MethodGenerator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public Instruction storeIterator() {
    return _astoreIterator;
}
 
Example #13
Source File: AttributeSetMethodGenerator.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public Instruction storeParameter(int index) {
    return new ASTORE(index + PARAM_START_INDEX);
}
 
Example #14
Source File: RealType.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public Instruction REM() {
    return InstructionConstants.DREM;
}
 
Example #15
Source File: BooleanType.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public Instruction LOAD(int slot) {
    return new ILOAD(slot);
}
 
Example #16
Source File: TestGenerator.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
/** by default context node is the same as current node. MK437 */
public Instruction loadContextNode() {
    return _iloadContext;
}
 
Example #17
Source File: CompareGenerator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public Instruction loadDOM() {
    return _aloadDom;
}
 
Example #18
Source File: RealType.java    From Bytecoder with Apache License 2.0 4 votes vote down vote up
public Instruction DIV() {
    return InstructionConst.DDIV;
}
 
Example #19
Source File: TestGenerator.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public Instruction storeIterator() {
    return _astoreIterator;
}
 
Example #20
Source File: MethodGenerator.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
public Instruction loadHandler() {
    return _aloadHandler;
}
 
Example #21
Source File: IntType.java    From Bytecoder with Apache License 2.0 4 votes vote down vote up
public Instruction NEG() {
    return InstructionConst.INEG;
}
 
Example #22
Source File: MethodGenerator.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
public Instruction storeDOM() {
    return _astoreDom;
}
 
Example #23
Source File: TestGenerator.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public Instruction storeContextNode() {
    return _istoreContext;
}
 
Example #24
Source File: MethodGenerator.java    From JDKSourceCode1.8 with MIT License 4 votes vote down vote up
public Instruction storeContextNode() {
    return storeCurrentNode();
}
 
Example #25
Source File: Type.java    From JDKSourceCode1.8 with MIT License 4 votes vote down vote up
public Instruction LOAD(int slot) {
    return null;            // should never be called
}
 
Example #26
Source File: MethodGenerator.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public Instruction storeIterator() {
    return _astoreIterator;
}
 
Example #27
Source File: NamedMethodGenerator.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public Instruction storeParameter(int index) {
    return new ASTORE(index + PARAM_START_INDEX);
}
 
Example #28
Source File: Param.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
/**
 * 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;
}
 
Example #29
Source File: MethodGenerator.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public Instruction storeCurrentNode() {
    return _istoreCurrent != null
        ? _istoreCurrent
        : (_istoreCurrent = new ISTORE(getLocalIndex("current")));
}
 
Example #30
Source File: RealType.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public Instruction SUB() {
    return InstructionConstants.DSUB;
}