public IEGraph Join(IEGraph g2, CfgBlock joinPoint, out bool resultIsomorphicToThis) { IMergeInfo minfo; IEGraph result = Join(g2, joinPoint, out minfo); resultIsomorphicToThis = !minfo.Changed; return(result); }
/// <summary> /// Returns null, if result of Join is the same as atMerge. /// </summary> public static ExposureState Join(ExposureState atMerge, ExposureState incoming, CfgBlock joinPoint) { bool unchanged; IEGraph merged = atMerge.egraph.Join(incoming.egraph, joinPoint, out unchanged); TypeNode currentException = (atMerge.currentException != null)? ((incoming.currentException != null)? CciHelper.LeastCommonAncestor(atMerge.currentException, incoming.currentException) : null) : null; if (atMerge.currentException != currentException || !unchanged) { return(new ExposureState(merged, currentException, atMerge.typeSystem)); } return(null); }
public IEGraph Join(IEGraph g2, CfgBlock joinPoint, out IMergeInfo mergeInfo) { EGraph eg1 = this; EGraph eg2 = (EGraph)g2; int updateSize; EGraph common = ComputeCommonTail(eg1, eg2, out updateSize); EGraph result; bool doReplay = true; if (common == null) { doReplay = false; result = new EGraph(eg1.elementLattice); result.Block = joinPoint; } else { result = new EGraph(common, joinPoint); } if (Analyzer.Debug) { Console.WriteLine("Last common symbol: {0}", common.idCounter); } if (Analyzer.Statistics) { Console.WriteLine("G1:{0} G2:{1} Tail:{2} UpdateSize:{3}", eg1.historySize, eg2.historySize, result.historySize, updateSize); } MergeState ms = new MergeState(result, eg1, eg2); // Heuristic for using Replay vs. full update doReplay &= (common != eg1.root); doReplay &= (eg1.historySize > 3); doReplay &= (eg2.historySize > 3); if (doReplay) { ms.Replay(common); } else { ms.AddMapping(eg1.constRoot, eg2.constRoot, result.constRoot); ms.JoinSymbolicValue(eg1.constRoot, eg2.constRoot, result.constRoot); } mergeInfo = ms; return(result); }
/// <summary> /// Copy Constructor /// </summary> /// <param name="old"></param> public InitializedVariables(InitializedVariables old) { this.analyzer = old.analyzer; this.egraph = (IEGraph)old.egraph.Clone(); this.referenceStatus = old.referenceStatus; }
private InitializedVariables(Analyzer analyzer, IEGraph egraph, IMap referenceStatus) { this.analyzer = analyzer; this.egraph = egraph; this.referenceStatus = referenceStatus; }
/// <summary> /// Constructor /// </summary> public InitializedVariables(Analyzer analyzer) { this.analyzer = analyzer; this.egraph = new EGraph(DefAssignLattice.It); this.referenceStatus = new HashedMap(); }
private ExposureState(IEGraph egraph, TypeNode currentException, TypeSystem t) { this.typeSystem = t; this.egraph = egraph; this.currentException = currentException; }
public ExposureState(TypeSystem t) { this.typeSystem = t; this.egraph = new EGraph(Lattice.It); this.currentException = null; }
public ExposureState(ExposureState old) { this.typeSystem = old.typeSystem; this.egraph = (IEGraph)old.egraph.Clone(); this.currentException = old.currentException; }
public IEGraph Join(IEGraph g2, CfgBlock joinPoint, out IMergeInfo mergeInfo) { EGraph eg1 = this; EGraph eg2 = (EGraph)g2; int updateSize; EGraph common = ComputeCommonTail(eg1, eg2, out updateSize); EGraph result; bool doReplay = true; if (common == null) { doReplay = false; result = new EGraph(eg1.elementLattice); result.Block = joinPoint; } else { result = new EGraph(common, joinPoint); } if (Analyzer.Debug) { Console.WriteLine("Last common symbol: {0}", common.idCounter); } if (Analyzer.Statistics) { Console.WriteLine("G1:{0} G2:{1} Tail:{2} UpdateSize:{3}", eg1.historySize, eg2.historySize, result.historySize, updateSize); } MergeState ms = new MergeState(result, eg1, eg2); // Heuristic for using Replay vs. full update doReplay &= (common != eg1.root); doReplay &= (eg1.historySize > 3); doReplay &= (eg2.historySize > 3); if (doReplay) { ms.Replay(common); } else { ms.AddMapping(eg1.constRoot, eg2.constRoot, result.constRoot); ms.JoinSymbolicValue(eg1.constRoot, eg2.constRoot, result.constRoot); } mergeInfo = ms; return result; }
public IEGraph Join(IEGraph g2, CfgBlock joinPoint, out bool resultIsomorphicToThis) { IMergeInfo minfo; IEGraph result = Join(g2, joinPoint, out minfo); resultIsomorphicToThis = !minfo.Changed; return result; }
public ExposureState(ExposureState old){ this.typeSystem = old.typeSystem; this.egraph = (IEGraph)old.egraph.Clone(); this.currentException = old.currentException; }
public NonNullState(TypeSystem t, IDelayInfo ieinfo) { this.typeSystem = t; this.egraph = new EGraph(Lattice.It); this.currentException = null; existDelayInfo = ieinfo; // materialize the null symbol early on so // all derived states share it. ISymValue nullsym = this.Null; }
public NonNullState(NonNullState old){ this.typeSystem = old.typeSystem; this.egraph = (IEGraph)old.egraph.Clone(); this.currentException = old.currentException; // this.existDelayInfo = old.ExistDelayInfo; }