private InstructionHandle getLoadInstruction(InstructionList il, SpawnableCall spawnableCall) throws SyncInsertionProposalFailure { InstructionHandle ih = spawnableCall.getInvokeInstruction(); while ((ih = ih.getNext()) != null) { try { LoadInstruction loadInstruction = (LoadInstruction) (ih.getInstruction()); if (spawnableCall.storesIn(loadInstruction.getIndex(), ih)) { return ih; } } catch (ClassCastException e) { } } throw new SyncInsertionProposalFailure(); }
@Override public void handleLoadInstruction(LoadInstruction obj) { int numProduced = obj.produceStack(cpg); if (numProduced == Constants.UNPREDICTABLE) { throw new InvalidBytecodeException("Unpredictable stack production"); } int index = obj.getIndex() + numProduced; while (numProduced-- > 0) { Taint value = getFrame().getValue(--index); assert value.hasValidVariableIndex() : "index not set in " + methodDescriptor; assert index == value.getVariableIndex() : "bad index in " + methodDescriptor; getFrame().pushValue(new Taint(value)); } }
public void visitLoadInstruction(LoadInstruction l) { // log.log(" visit load", Project.MSG_DEBUG); Type t = l.getType(poolGen); log.log(" instr(loadinstr)=" + t, Project.MSG_DEBUG); String type = t.toString(); design.checkClass(type); }
private boolean isLoad(Location location) { Instruction ins = location.getHandle().getInstruction(); return (ins instanceof LoadInstruction) || (ins instanceof IINC); }
public void visitLoadInstruction(LoadInstruction aInstruction) { mLocalVariableBitSet.set(aInstruction.getIndex()); }
static boolean isLocalLoad(Instruction ins) { return (ins instanceof LoadInstruction); }
/** Tests whether an instruction loads to a local variable with a certain * index. * * When the load is used for an array store or a putfield, the result will * be false. It * uses {@link #isUsedForArrayStore(InstructionHandle)} and {@link * #isUsedForPutField(InstructionHandle)}. * * @param ih The instruction that is tested to load to a local variable * index. * @param localVarIndex The local variable index to which the instruction * may load * * @return true if the instruction loads to the local variable index, false * otherwise. * * @see #isUsedForArrayStore(InstructionHandle) * @see #isUsedForPutField(InstructionHandle) */ public boolean instructionLoadsTo(InstructionHandle ih, int localVarIndex) { try { LoadInstruction loadInstruction = (LoadInstruction) (ih.getInstruction()); return loadInstruction.getIndex() == localVarIndex && !isUsedForArrayLength(ih) && !isUsedForArrayStore(ih) && !isUsedForPutField(ih); } catch(ClassCastException e) { return false; } }
/** * Is instruction at given location a load? * * @param location * the location * @return true if instruction at given location is a load, false if not */ private boolean isLoad(Location location) { Instruction ins = location.getHandle().getInstruction(); return (ins instanceof LoadInstruction) || (ins instanceof IINC); }