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); } }
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;
point.getStack().push(new VarType(CodeConstants.TYPE_OBJECT, 0, null));
public Exprent push(Exprent item) { super.push(item); return item; }
private void visit(Statement stat) { lstack.push(stat); dfsnummap.put(stat, ncounter); lowmap.put(stat, ncounter);
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;
point.getStack().push(new VarType(CodeConstants.TYPE_OBJECT, 0, null));