public override void Visit(ICopyMemoryStatement copyMemoryStatement) { if (Process(copyMemoryStatement)) { visitor.Visit(copyMemoryStatement); } base.Visit(copyMemoryStatement); }
public override void TraverseChildren(ICopyMemoryStatement copyMemoryStatement) { sourceEmitterOutput.WriteLine("Intrinsic.CopyMemory("); this.Traverse(copyMemoryStatement.TargetAddress); this.sourceEmitterOutput.Write(", "); this.Traverse(copyMemoryStatement.SourceAddress); this.sourceEmitterOutput.Write(", "); this.Traverse(copyMemoryStatement.NumberOfBytesToCopy); this.sourceEmitterOutput.Write(")"); }
/// <summary> /// Performs some computation with the given copy memory statement. /// </summary> /// <param name="copyMemoryStatement"></param> public virtual void Visit(ICopyMemoryStatement copyMemoryStatement) { }
public void Visit(ICopyMemoryStatement copyMemoryBlock) { this.result = this.copier.Copy(copyMemoryBlock); }
public override void TraverseChildren(ICopyMemoryStatement copyMemoryStatement) { MethodEnter(copyMemoryStatement); base.TraverseChildren(copyMemoryStatement); MethodExit(); }
public override void Visit(ICopyMemoryStatement copyMemoryStatement) { if(Process(copyMemoryStatement)){visitor.Visit(copyMemoryStatement);} base.Visit(copyMemoryStatement); }
/// <summary> /// Returns a shallow copy of the given copy memory statement. /// </summary> /// <param name="copyMemoryStatement"></param> public CopyMemoryStatement Copy(ICopyMemoryStatement copyMemoryStatement) { return new CopyMemoryStatement(copyMemoryStatement); }
public void Visit(ICopyMemoryStatement copyMemoryStatement) { this.traverser.Traverse(copyMemoryStatement); }
public void Visit(ICopyMemoryStatement copyMemoryStatement) { Contract.Requires(copyMemoryStatement != null); throw new NotImplementedException(); }
/// <summary> /// Rewrites the given copy memory statement. /// </summary> /// <param name="copyMemoryStatement"></param> public virtual IStatement Rewrite(ICopyMemoryStatement copyMemoryStatement) { var mutableCopyMemoryStatement = copyMemoryStatement as CopyMemoryStatement; if (mutableCopyMemoryStatement == null) return copyMemoryStatement; this.RewriteChildren(mutableCopyMemoryStatement); return mutableCopyMemoryStatement; }
/// <summary> /// Returns a deep copy of the given copy memory statement. /// </summary> /// <param name="copyMemoryStatement"></param> public CopyMemoryStatement Copy(ICopyMemoryStatement copyMemoryStatement) { Contract.Requires(copyMemoryStatement != null); Contract.Ensures(Contract.Result<CopyMemoryStatement>() != null); var mutableCopy = this.shallowCopier.Copy(copyMemoryStatement); mutableCopy.TargetAddress = this.Copy(mutableCopy.TargetAddress); mutableCopy.SourceAddress = this.Copy(mutableCopy.SourceAddress); mutableCopy.NumberOfBytesToCopy = this.Copy(mutableCopy.NumberOfBytesToCopy); return mutableCopy; }
/// <summary> /// Returns a shallow copy of the given copy memory statement. /// </summary> /// <param name="copyMemoryStatement"></param> public CopyMemoryStatement Copy(ICopyMemoryStatement copyMemoryStatement) { Contract.Requires(copyMemoryStatement != null); Contract.Ensures(Contract.Result<CopyMemoryStatement>() != null); return new CopyMemoryStatement(copyMemoryStatement); }
/// <summary> /// Rewrites the given copy memory statement. /// </summary> /// <param name="copyMemoryStatement"></param> public virtual IStatement Rewrite(ICopyMemoryStatement copyMemoryStatement) { return copyMemoryStatement; }
public override void Visit(ICopyMemoryStatement copyMemoryStatement) { allElements.Add(new InvokInfo(Traverser, "ICopyMemoryStatement", copyMemoryStatement)); }
/// <summary> /// Generates IL for the specified copy memory statement. /// </summary> /// <param name="copyMemoryStatement">The copy memory statement.</param> public override void TraverseChildren(ICopyMemoryStatement copyMemoryStatement) { this.EmitSequencePoint(copyMemoryStatement.Locations); this.Traverse(copyMemoryStatement.TargetAddress); this.Traverse(copyMemoryStatement.SourceAddress); this.Traverse(copyMemoryStatement.NumberOfBytesToCopy); this.generator.Emit(OperationCode.Cpblk); }
/// <summary> /// Traverses the copy memory statement. /// </summary> /// <param name="copyMemoryStatement"></param> public void Traverse(ICopyMemoryStatement copyMemoryStatement) { Contract.Requires(copyMemoryStatement != null); if (this.preorderVisitor != null) this.preorderVisitor.Visit(copyMemoryStatement); if (this.StopTraversal) return; this.TraverseChildren(copyMemoryStatement); if (this.StopTraversal) return; if (this.postorderVisitor != null) this.postorderVisitor.Visit(copyMemoryStatement); }
public void Visit(ICopyMemoryStatement copyMemoryBlock) { throw new NotImplementedException(); }
/// <summary> /// Traverses the children of the copy memory statement. /// </summary> public virtual void TraverseChildren(ICopyMemoryStatement copyMemoryStatement) { Contract.Requires(copyMemoryStatement != null); this.TraverseChildren((IStatement)copyMemoryStatement); if (this.StopTraversal) return; this.Traverse(copyMemoryStatement.TargetAddress); if (this.StopTraversal) return; this.Traverse(copyMemoryStatement.SourceAddress); if (this.StopTraversal) return; this.Traverse(copyMemoryStatement.NumberOfBytesToCopy); }
/// <summary> /// Makes a shallow copy of a statement that represents cpblk IL instruction, which copies a block of memory from one address to another. /// </summary> /// <param name="copyMemoryStatement"></param> public CopyMemoryStatement(ICopyMemoryStatement copyMemoryStatement) : base(copyMemoryStatement) { this.targetAddress = copyMemoryStatement.TargetAddress; this.sourceAddress = copyMemoryStatement.SourceAddress; this.numberOfBytesToCopy = copyMemoryStatement.NumberOfBytesToCopy; }
/// <summary> /// Performs some computation with the given copy memory statement. /// </summary> /// <param name="copyMemoryStatement"></param> public virtual void Visit(ICopyMemoryStatement copyMemoryStatement) { this.Visit((IStatement)copyMemoryStatement); }
/// <summary> /// Visits the specified copy memory statement. /// </summary> /// <param name="copyMemoryStatement">The copy memory statement.</param> public override void Visit(ICopyMemoryStatement copyMemoryStatement) { CopyMemoryStatement mutableCopyMemoryStatement = copyMemoryStatement as CopyMemoryStatement; if (alwaysMakeACopy || mutableCopyMemoryStatement == null) mutableCopyMemoryStatement = new CopyMemoryStatement(copyMemoryStatement); this.resultStatement = this.myCodeMutator.Visit(mutableCopyMemoryStatement); }
//^ ensures this.path.Count == old(this.path.Count); /// <summary> /// Traverses the given copy memory statement. /// </summary> /// <param name="copyMemoryStatement"></param> public virtual void Visit(ICopyMemoryStatement copyMemoryStatement) { if (this.stopTraversal) return; //^ int oldCount = this.path.Count; this.path.Push(copyMemoryStatement); this.Visit(copyMemoryStatement.TargetAddress); this.Visit(copyMemoryStatement.SourceAddress); this.Visit(copyMemoryStatement.NumberOfBytesToCopy); //^ assume this.path.Count == oldCount+1; //True because all of the virtual methods of this class promise not to decrease this.path.Count. this.path.Pop(); }
public void Visit(ICopyMemoryStatement copyMemoryBlock) { this.result = this.rewriter.Rewrite(copyMemoryBlock); }
/// <summary> /// Performs some computation with the given copy memory statement. /// </summary> /// <param name="copyMemoryStatement"></param> public override void Visit(ICopyMemoryStatement copyMemoryStatement) { CopyMemoryStatement mutableCopyMemoryStatement = new CopyMemoryStatement(copyMemoryStatement); this.resultStatement = this.myCodeCopier.DeepCopy(mutableCopyMemoryStatement); }
/// <summary> /// Returns a deep copy of the given copy memory statement. /// </summary> /// <param name="copyMemoryStatement"></param> public CopyMemoryStatement Copy(ICopyMemoryStatement copyMemoryStatement) { var mutableCopy = this.shallowCopier.Copy(copyMemoryStatement); mutableCopy.TargetAddress = this.Copy(mutableCopy.TargetAddress); mutableCopy.SourceAddress = this.Copy(mutableCopy.SourceAddress); mutableCopy.NumberOfBytesToCopy = this.Copy(mutableCopy.NumberOfBytesToCopy); return mutableCopy; }
/// <summary> /// Performs some computation with the given copy memory statement. /// </summary> /// <param name="copyMemoryStatement"></param> public override void Visit(ICopyMemoryStatement copyMemoryStatement) { CopyMemoryStatement mutableCopyMemoryStatement = copyMemoryStatement as CopyMemoryStatement; if (mutableCopyMemoryStatement == null) { this.resultStatement = copyMemoryStatement; return; } this.resultStatement = this.myCodeMutator.Visit(mutableCopyMemoryStatement); }