/** * Update the value graph to account for a given ASTORE instruction. * * <p><b>PRECONDITION:</b> <code> AStore.conforms(s); </code> Make sure we have value graph nodes * for a constant value * * @param s the instruction in question */ private void processAStore(Instruction s) { Operand value = AStore.getValue(s); if (value.isConstant()) { findOrCreateVertex((ConstantOperand) value); } Operand index = AStore.getIndex(s); if (index.isConstant()) { findOrCreateVertex((ConstantOperand) index); } }
/** * Update the value graph to account for a given ALOAD instruction. * * <p><b>PRECONDITION:</b> <code> ALoad.conforms(s); </code> Make sure we have value graph nodes * for a constant value * * @param s the instruction in question */ private void processALoad(Instruction s) { Operand index = ALoad.getIndex(s); if (index.isConstant()) { findOrCreateVertex((ConstantOperand) index); } }
/** * Update the value graph to account for a given PUTSTATIC instruction. * * <p><b>PRECONDITION:</b> <code> PutStatic.conforms(s); </code> Make sure we have value graph * nodes for a constant value * * @param s the instruction in question */ private void processPutStatic(Instruction s) { Operand value = PutStatic.getValue(s); if (value.isConstant()) { findOrCreateVertex((ConstantOperand) value); } }
/** * Add a node to the value graph for every symbolic register. * * <p><b>PRECONDITION:</b> register lists are computed and valid * * @param ir the governing IR */ private void addRegisterNodes(IR ir) { for (Register reg = ir.regpool.getFirstSymbolicRegister(); reg != null; reg = reg.getNext()) { findOrCreateVertex(reg); } }