/// <summary> /// Assigns the given memory entry into all collected indexes in the collector. /// Must indexes are strongly updated may indexes weakly. /// </summary> /// <param name="collector">The collector.</param> /// <param name="value">The value.</param> internal void Assign(AssignCollector collector, AnalysisFramework.Memory.MemoryEntry value) { CollectComposedValuesVisitor composedValues = new CollectComposedValuesVisitor(); composedValues.VisitMemoryEntry(value); foreach (MemoryIndex mustIndex in collector.MustIndexes) { assignMust(mustIndex, composedValues); } foreach (MemoryIndex mayIndex in collector.MayIndexes) { assignMay(mayIndex, composedValues); } if (snapshot.CurrentMode == SnapshotMode.InfoLevel) { InfoLocationVisitor mustVisitor = new InfoLocationVisitor(snapshot, value, true); foreach (ValueLocation mustLocation in collector.MustLocation) { mustLocation.Accept(mustVisitor); } InfoLocationVisitor mayVisitor = new InfoLocationVisitor(snapshot, value, false); foreach (ValueLocation mustLocation in collector.MayLocaton) { mustLocation.Accept(mayVisitor); } } }
/// <inheritdoc /> public void WriteWithoutCopy(Snapshot snapshot, Memory.MemoryPath path, AnalysisFramework.Memory.MemoryEntry value) { AssignCollector collector = new AssignCollector(snapshot); collector.ProcessPath(path); AssignWithoutCopyWorker worker = new AssignWithoutCopyWorker(Factories, snapshot); worker.Assign(collector, value); }
/// <inheritdoc /> public void Assign(Snapshot snapshot, Memory.MemoryPath path, AnalysisFramework.Memory.MemoryEntry value, bool forceStrongWrite) { AssignCollector collector = new AssignCollector(snapshot); collector.ProcessPath(path); if (forceStrongWrite) { collector.SetAllToMust(); } AssignWithoutCopyWorker worker = new AssignWithoutCopyWorker(Factories, snapshot); worker.Assign(collector, value); }
/// <inheritdoc /> public void Assign(Snapshot snapshot, Memory.MemoryPath path, AnalysisFramework.Memory.MemoryEntry value, bool forceStrongWrite) { TemporaryIndex temporaryIndex = snapshot.CreateTemporary(); MergeWithinSnapshotWorker mergeWorker = new MergeWithinSnapshotWorker(snapshot); mergeWorker.MergeMemoryEntry(temporaryIndex, value); AssignCollector collector = new AssignCollector(snapshot); collector.ProcessPath(path); if (forceStrongWrite) { collector.SetAllToMust(); } AssignWorker worker = new AssignWorker(snapshot); worker.Assign(collector, temporaryIndex); snapshot.ReleaseTemporary(temporaryIndex); }