public Instruction STORE(int slot) { return new ASTORE(slot); } }
return; int varIndex = ((ASTORE)ih.getInstruction()).getIndex(); firstInstruction = ih.getNext(); if(firstInstruction == null) {
public Instruction STORE(int slot) { return new ASTORE(slot); } }
public Instruction STORE(int slot) { return new ASTORE(slot); } }
ASTORE astore = (ASTORE) first.getInstruction(); BitSet liveStoreSet = dataflow.getFactAtLocation(new Location(first, block)); if (!liveStoreSet.get(astore.getIndex())) {
public Instruction STORE(int slot) { return new ASTORE(slot); } }
/** Checks if the constraints of operands of the said instruction(s) are satisfied. */ public void visitASTORE(ASTORE o){ int idx = o.getIndex(); if (idx < 0){ constraintViolated(o, "Index '"+idx+"' must be non-negative."); } else{ int maxminus1 = max_locals()-1; if (idx > maxminus1){ constraintViolated(o, "Index '"+idx+"' must not be greater than max_locals-1 '"+maxminus1+"'."); } } }
public Instruction STORE(int slot) { return new ASTORE(slot); } }
/** Checks if the constraints of operands of the said instruction(s) are satisfied. */ @Override public void visitASTORE(final ASTORE o) { final int idx = o.getIndex(); if (idx < 0) { constraintViolated(o, "Index '"+idx+"' must be non-negative."); } else{ final int maxminus1 = max_locals()-1; if (idx > maxminus1) { constraintViolated(o, "Index '"+idx+"' must not be greater than max_locals-1 '"+maxminus1+"'."); } } }
public Instruction storeParameter(int index) { return new ASTORE(index + PARAM_START_INDEX); } }
/** Symbolically executes the corresponding Java Virtual Machine instruction. */ @Override public void visitASTORE(final ASTORE o) { locals().set(o.getIndex(), stack().pop()); //System.err.println("TODO-DEBUG: set LV '"+o.getIndex()+"' to '"+locals().get(o.getIndex())+"'."); }
public RtMethodGenerator(int access_flags, Type return_type, Type[] arg_types, String[] arg_names, String method_name, String class_name, InstructionList il, ConstantPoolGen cp) { super(access_flags, return_type, arg_types, arg_names, method_name, class_name, il, cp); _astoreHandler = new ASTORE(HANDLER_INDEX); _aloadHandler = new ALOAD(HANDLER_INDEX); }
/** Symbolically executes the corresponding Java Virtual Machine instruction. */ public void visitASTORE(ASTORE o){ locals().set(o.getIndex(), stack().pop()); //System.err.println("TODO-DEBUG: set LV '"+o.getIndex()+"' to '"+locals().get(o.getIndex())+"'."); }
public AttributeSetMethodGenerator(String methodName, ClassGen classGen) { super(org.apache.bcel.Constants.ACC_PRIVATE, org.apache.bcel.generic.Type.VOID, argTypes, argNames, methodName, classGen.getClassName(), new InstructionList(), classGen.getConstantPool()); _aloadDom = new ALOAD(DOM_INDEX); _astoreDom = new ASTORE(DOM_INDEX); _astoreIterator = new ASTORE(ITERATOR_INDEX); _aloadIterator = new ALOAD(ITERATOR_INDEX); _astoreHandler = new ASTORE(HANDLER_INDEX); _aloadHandler = new ALOAD(HANDLER_INDEX); }
/** * Adds a new JSR or JSR_W that has this subroutine as its target. */ public void addEnteringJsrInstruction(final InstructionHandle jsrInst) { if ( (jsrInst == null) || (! (jsrInst.getInstruction() instanceof JsrInstruction))) { throw new AssertionViolatedException("Expecting JsrInstruction InstructionHandle."); } if (localVariable == UNSET) { throw new AssertionViolatedException("Set the localVariable first!"); } // Something is wrong when an ASTORE is targeted that does not operate on the same local variable than the rest of the // JsrInstruction-targets and the RET. // (We don't know out leader here so we cannot check if we're really targeted!) if (localVariable != ((ASTORE) (((JsrInstruction) jsrInst.getInstruction()).getTarget().getInstruction())).getIndex()) { throw new AssertionViolatedException("Setting a wrong JsrInstruction."); } theJSRs.add(jsrInst); }
public TestGenerator(int access_flags, Type return_type, Type[] arg_types, String[] arg_names, String method_name, String class_name, InstructionList il, ConstantPoolGen cp) { super(access_flags, return_type, arg_types, arg_names, method_name, class_name, il, cp); _iloadCurrent = new ILOAD(CURRENT_NODE_INDEX); _istoreCurrent = new ISTORE(CURRENT_NODE_INDEX); _iloadContext = new ILOAD(CONTEXT_NODE_INDEX); _istoreContext = new ILOAD(CONTEXT_NODE_INDEX); _astoreIterator = new ASTORE(ITERATOR_INDEX); _aloadIterator = new ALOAD(ITERATOR_INDEX); }
/** * Adds a new JSR or JSR_W that has this subroutine as its target. */ public void addEnteringJsrInstruction(InstructionHandle jsrInst){ if ( (jsrInst == null) || (! (jsrInst.getInstruction() instanceof JsrInstruction))){ throw new AssertionViolatedException("Expecting JsrInstruction InstructionHandle."); } if (localVariable == UNSET){ throw new AssertionViolatedException("Set the localVariable first!"); } else{ // Something is wrong when an ASTORE is targeted that does not operate on the same local variable than the rest of the // JsrInstruction-targets and the RET. // (We don't know out leader here so we cannot check if we're really targeted!) if (localVariable != ((ASTORE) (((JsrInstruction) jsrInst.getInstruction()).getTarget().getInstruction())).getIndex()){ throw new AssertionViolatedException("Setting a wrong JsrInstruction."); } } theJSRs.add(jsrInst); }
/** * 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); } }