private HashSet<Integer> getAAStoreNewIds(OperandStack stack) { int currentSizeOfStack = stack.getCurrentSize(); GCType type = (GCType) stack.get(currentSizeOfStack - 3); HashSet<Integer> toRet = type.getAllNewIds(); toRet.remove(-1); return toRet; }
/** * Should be called Before virtual execution of instructions putfield and putstatic so that all * corresponding getFields are set dirty. Similarly should also be called before virtual execution * of instructions AASTORE so that corresponding AALOAD are set dirty. * * @param method * @param callingParms * @param instr * @param stack * @param localVariables */ public void fixOrderRelatedInstrs( MethodInfo method, Vector callingParms, GCInstruction instr, GCOperandStack stack, GCLocalVariables localVariables) { if (!isFieldIsObjectBased(instr)) { return; } String methodStr = oracle.getMethodOrFieldString(method); if (instr.getOpCode() == JavaInstructionsOpcodes.PUTSTATIC || instr.getOpCode() == JavaInstructionsOpcodes.PUTFIELD || instr.getOpCode() == JavaInstructionsOpcodes.AASTORE) { GCType type = (GCType) stack.peep(); if (!type.isReference()) { return; } HashSet<TTReference> refSet = type.getReferences(); if (refSet.size() == 1) { TTReference ref = refSet.iterator().next(); if (ref.getClassThisPointer() == Type.NULL || ref.getNewId() < 0) { return; } } debugPrint("\n\n++++++++++ ", "fix-Order"); debugPrint("method Str =", oracle.getMethodOrFieldString(method)); debugPrint("instr =", instr); handlePutRecalls(new MethodCallInfo(method, callingParms), instr, stack); } }
private HashSet<Integer> getAALOADNewIds(OperandStack stack) { HashSet<Integer> toRet = new HashSet<Integer>(); try { int currentSizeOfStack = stack.getNumberOfTypesInStack(); GCType type = (GCType) stack.get(currentSizeOfStack - 2); toRet = type.getAllNewIds(); toRet.remove(-1); } catch (Exception d) { d.printStackTrace(); System.exit(1); } return toRet; }