@Override @SuppressWarnings("MethodDoesntCallSuperMethod") public ListStack<T> clone() { ListStack<T> copy = new ListStack<>(this); copy.pointer = this.pointer; return copy; }
public void insertByOffset(int offset, T item) { this.add(pointer + offset, item); pointer++; }
public DataPoint copy() { DataPoint point = new DataPoint(); point.setLocalVariables(new ArrayList<>(localVariables)); point.setStack(stack.clone()); return point; }
public IfExprent(int ifType, ListStack<Exprent> stack, Set<Integer> bytecodeOffsets) { this(null, bytecodeOffsets); if (ifType <= IF_LE) { stack.push(new ConstExprent(0, true, null)); } else if (ifType <= IF_NONNULL) { stack.push(new ConstExprent(VarType.VARTYPE_NULL, null, null)); } if (ifType == IF_VALUE) { condition = stack.pop(); } else { condition = new FunctionExprent(FUNC_TYPES[ifType], stack, bytecodeOffsets); } }
stack.push(new VarType(CodeConstants.TYPE_NULL, 0, null)); break; case CodeConstants.opc_ldc: switch (constant.type) { case CodeConstants.CONSTANT_Integer: stack.push(new VarType(CodeConstants.TYPE_INT)); break; case CodeConstants.CONSTANT_Float: stack.push(new VarType(CodeConstants.TYPE_FLOAT)); break; case CodeConstants.CONSTANT_Long: stack.push(new VarType(CodeConstants.TYPE_LONG)); stack.push(new VarType(CodeConstants.TYPE_GROUP2EMPTY)); break; case CodeConstants.CONSTANT_Double: stack.push(new VarType(CodeConstants.TYPE_DOUBLE)); stack.push(new VarType(CodeConstants.TYPE_GROUP2EMPTY)); break; case CodeConstants.CONSTANT_String: stack.push(new VarType(CodeConstants.TYPE_OBJECT, 0, "java/lang/String")); break; case CodeConstants.CONSTANT_Class: stack.push(new VarType(CodeConstants.TYPE_OBJECT, 0, "java/lang/Class")); break; case CodeConstants.CONSTANT_MethodHandle: stack.push(new VarType(((LinkConstant)constant).descriptor)); break;
public T pop(int count) { T o = null; for (int i = count; i > 0; i--) { o = this.pop(); } return o; }
stack.removeMultiple(depth); stack.push(new VarType(type)); if (type == CodeConstants.TYPE_LONG || type == CodeConstants.TYPE_DOUBLE) { stack.push(new VarType(CodeConstants.TYPE_GROUP2EMPTY));
var = stack.getByOffset(-1); point.getStack().push(new VarType(CodeConstants.TYPE_OBJECT, 0, null));
public ExprentStack(ListStack<Exprent> list) { super(list); pointer = list.getPointer(); }
public T getByOffset(int offset) { return this.get(pointer + offset); }
public Exprent push(Exprent item) { super.push(item); return item; }
stack.push(new VarType(CodeConstants.TYPE_NULL, 0, null)); break; case CodeConstants.opc_ldc: switch (constant.type) { case CodeConstants.CONSTANT_Integer: stack.push(new VarType(CodeConstants.TYPE_INT)); break; case CodeConstants.CONSTANT_Float: stack.push(new VarType(CodeConstants.TYPE_FLOAT)); break; case CodeConstants.CONSTANT_Long: stack.push(new VarType(CodeConstants.TYPE_LONG)); stack.push(new VarType(CodeConstants.TYPE_GROUP2EMPTY)); break; case CodeConstants.CONSTANT_Double: stack.push(new VarType(CodeConstants.TYPE_DOUBLE)); stack.push(new VarType(CodeConstants.TYPE_GROUP2EMPTY)); break; case CodeConstants.CONSTANT_String: stack.push(new VarType(CodeConstants.TYPE_OBJECT, 0, "java/lang/String")); break; case CodeConstants.CONSTANT_Class: stack.push(new VarType(CodeConstants.TYPE_OBJECT, 0, "java/lang/Class")); break; case CodeConstants.CONSTANT_MethodHandle: stack.push(new VarType(((LinkConstant)constant).descriptor)); break;
private void visit(Statement stat) { lstack.push(stat); dfsnummap.put(stat, ncounter); lowmap.put(stat, ncounter); ncounter++; List<Statement> lstSuccs = stat.getNeighbours(StatEdge.TYPE_REGULAR, Statement.DIRECTION_FORWARD); // TODO: set? lstSuccs.removeAll(setProcessed); for (Statement succ : lstSuccs) { int secvalue; if (tset.contains(succ)) { secvalue = dfsnummap.get(succ); } else { tset.add(succ); visit(succ); secvalue = lowmap.get(succ); } lowmap.put(stat, Math.min(lowmap.get(stat), secvalue)); } if (lowmap.get(stat).intValue() == dfsnummap.get(stat).intValue()) { List<Statement> lst = new ArrayList<>(); Statement v; do { v = lstack.pop(); lst.add(v); } while (v != stat); components.add(lst); } }
private static List<Exprent> getDimensions(int arrayDim, ListStack<Exprent> stack) { List<Exprent> lstDims = new ArrayList<>(); for (int i = 0; i < arrayDim; i++) { lstDims.add(0, stack.pop()); } return lstDims; }
stack.removeMultiple(depth); for (int i = 0; i < write.length; i++) { int type = write[i]; stack.push(new VarType(type)); if (type == CodeConstants.TYPE_LONG || type == CodeConstants.TYPE_DOUBLE) { stack.push(new VarType(CodeConstants.TYPE_GROUP2EMPTY));
var = stack.getByOffset(-1); point.getStack().push(new VarType(CodeConstants.TYPE_OBJECT, 0, null));
public ExprentStack(ListStack<Exprent> list) { super(list); pointer = list.getPointer(); }
public T getByOffset(int offset) { return this.get(pointer + offset); }