public override void Visit(IFillMemoryStatement fillMemoryStatement) { if (Process(fillMemoryStatement)) { visitor.Visit(fillMemoryStatement); } base.Visit(fillMemoryStatement); }
public override void TraverseChildren(IFillMemoryStatement fillMemoryStatement) { sourceEmitterOutput.WriteLine("Intrinsic.FillMemory("); this.Traverse(fillMemoryStatement.TargetAddress); this.sourceEmitterOutput.Write(", "); this.Traverse(fillMemoryStatement.FillValue); this.sourceEmitterOutput.Write(", "); this.Traverse(fillMemoryStatement.NumberOfBytesToFill); this.sourceEmitterOutput.Write(")"); }
/// <summary> /// Returns a shallow copy of the given fill memory block statement. /// </summary> /// <param name="fillMemoryStatement"></param> public FillMemoryStatement Copy(IFillMemoryStatement fillMemoryStatement) { return new FillMemoryStatement(fillMemoryStatement); }
public void Visit(IFillMemoryStatement fillMemoryStatement) { this.result = this.copier.Copy(fillMemoryStatement); }
/// <summary> /// Makes a shallow copy of a statement that represents initblk IL instruction, which fills a block of memory with repeated copies of a given fill value. /// </summary> /// <param name="fillMemoryStatement">The IFillMemoryStatement instance to copy.</param> public FillMemoryStatement(IFillMemoryStatement fillMemoryStatement) : base(fillMemoryStatement) { this.targetAddress = fillMemoryStatement.TargetAddress; this.fillValue = fillMemoryStatement.FillValue; this.numberOfBytesToFill = fillMemoryStatement.NumberOfBytesToFill; }
/// <summary> /// Visits the specified fill memory statement. /// </summary> /// <param name="fillMemoryStatement">The fill memory statement.</param> public override void Visit(IFillMemoryStatement fillMemoryStatement) { FillMemoryStatement mutableFillMemoryStatement = fillMemoryStatement as FillMemoryStatement; if (alwaysMakeACopy || mutableFillMemoryStatement == null) mutableFillMemoryStatement = new FillMemoryStatement(fillMemoryStatement); this.resultStatement = this.myCodeMutator.Visit(mutableFillMemoryStatement); }
/// <summary> /// Traverses the children of the fill memory statement. /// </summary> public virtual void TraverseChildren(IFillMemoryStatement fillMemoryStatement) { Contract.Requires(fillMemoryStatement != null); this.TraverseChildren((IStatement)fillMemoryStatement); if (this.StopTraversal) return; this.Traverse(fillMemoryStatement.TargetAddress); if (this.StopTraversal) return; this.Traverse(fillMemoryStatement.FillValue); if (this.StopTraversal) return; this.Traverse(fillMemoryStatement.NumberOfBytesToFill); }
public void Visit(IFillMemoryStatement fillMemoryStatement) { this.result = this.rewriter.Rewrite(fillMemoryStatement); }
/// <summary> /// Returns a shallow copy of the given fill memory block statement. /// </summary> /// <param name="fillMemoryStatement"></param> public FillMemoryStatement Copy(IFillMemoryStatement fillMemoryStatement) { Contract.Requires(fillMemoryStatement != null); Contract.Ensures(Contract.Result<FillMemoryStatement>() != null); return new FillMemoryStatement(fillMemoryStatement); }
/// <summary> /// Performs some computation with the given fill memory block statement. /// </summary> /// <param name="fillMemoryStatement"></param> public virtual void Visit(IFillMemoryStatement fillMemoryStatement) { }
/// <summary> /// Rewrites the given fill memory statement. /// </summary> /// <param name="fillMemoryStatement"></param> public virtual IStatement Rewrite(IFillMemoryStatement fillMemoryStatement) { return fillMemoryStatement; }
/// <summary> /// Returns a deep copy of the given fill memory block statement. /// </summary> /// <param name="fillMemoryStatement"></param> public FillMemoryStatement Copy(IFillMemoryStatement fillMemoryStatement) { Contract.Requires(fillMemoryStatement != null); Contract.Ensures(Contract.Result<FillMemoryStatement>() != null); var mutableCopy = this.shallowCopier.Copy(fillMemoryStatement); mutableCopy.TargetAddress = this.Copy(mutableCopy.TargetAddress); mutableCopy.FillValue = this.Copy(mutableCopy.FillValue); mutableCopy.NumberOfBytesToFill = this.Copy(mutableCopy.NumberOfBytesToFill); return mutableCopy; }
public override void Visit(IFillMemoryStatement fillMemoryStatement) { allElements.Add(new InvokInfo(Traverser, "IFillMemoryStatement", fillMemoryStatement)); }
/// <summary> /// Generates IL for the specified fill memory statement. /// </summary> /// <param name="fillMemoryStatement">The fill memory statement.</param> public override void TraverseChildren(IFillMemoryStatement fillMemoryStatement) { this.EmitSequencePoint(fillMemoryStatement.Locations); this.Traverse(fillMemoryStatement.TargetAddress); this.Traverse(fillMemoryStatement.FillValue); this.Traverse(fillMemoryStatement.NumberOfBytesToFill); this.generator.Emit(OperationCode.Initblk); }
public override void Visit(IFillMemoryStatement fillMemoryStatement) { if(Process(fillMemoryStatement)){visitor.Visit(fillMemoryStatement);} base.Visit(fillMemoryStatement); }
public override void TraverseChildren(IFillMemoryStatement fillMemoryStatement) { MethodEnter(fillMemoryStatement); base.TraverseChildren(fillMemoryStatement); MethodExit(); }
/// <summary> /// Performs some computation with the given fill memory statement. /// </summary> /// <param name="fillMemoryStatement"></param> public virtual void Visit(IFillMemoryStatement fillMemoryStatement) { }
//^ ensures this.path.Count == old(this.path.Count); /// <summary> /// Traverses the given fill memory statement. /// </summary> /// <param name="fillMemoryStatement"></param> public virtual void Visit(IFillMemoryStatement fillMemoryStatement) { if (this.stopTraversal) return; //^ int oldCount = this.path.Count; this.path.Push(fillMemoryStatement); this.Visit(fillMemoryStatement.TargetAddress); this.Visit(fillMemoryStatement.FillValue); this.Visit(fillMemoryStatement.NumberOfBytesToFill); //^ 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(); }
/// <summary> /// Performs some computation with the given fill memory statement. /// </summary> /// <param name="fillMemoryStatement"></param> public virtual void Visit(IFillMemoryStatement fillMemoryStatement) { this.Visit((IStatement)fillMemoryStatement); }
/// <summary> /// Traverses the fill memory statement. /// </summary> /// <param name="fillMemoryStatement"></param> public void Traverse(IFillMemoryStatement fillMemoryStatement) { Contract.Requires(fillMemoryStatement != null); if (this.preorderVisitor != null) this.preorderVisitor.Visit(fillMemoryStatement); if (this.StopTraversal) return; this.TraverseChildren(fillMemoryStatement); if (this.StopTraversal) return; if (this.postorderVisitor != null) this.postorderVisitor.Visit(fillMemoryStatement); }
public void Visit(IFillMemoryStatement fillMemoryStatement) { throw new NotImplementedException(); }
public void Visit(IFillMemoryStatement fillMemoryStatement) { this.traverser.Traverse(fillMemoryStatement); }
/// <summary> /// Rewrites the given fill memory statement. /// </summary> /// <param name="fillMemoryStatement"></param> public virtual IStatement Rewrite(IFillMemoryStatement fillMemoryStatement) { var mutableFillMemoryStatement = fillMemoryStatement as FillMemoryStatement; if (mutableFillMemoryStatement == null) return fillMemoryStatement; this.RewriteChildren(mutableFillMemoryStatement); return mutableFillMemoryStatement; }
public void Visit(IFillMemoryStatement fillMemoryStatement) { Contract.Requires(fillMemoryStatement != null); throw new NotImplementedException(); }
/// <summary> /// Performs some computation with the given fill memory block statement. /// </summary> /// <param name="fillMemoryStatement"></param> public override void Visit(IFillMemoryStatement fillMemoryStatement) { FillMemoryStatement mutableFillMemoryStatement = new FillMemoryStatement(fillMemoryStatement); this.resultStatement = this.myCodeCopier.DeepCopy(mutableFillMemoryStatement); }
/// <summary> /// Returns a deep copy of the given fill memory block statement. /// </summary> /// <param name="fillMemoryStatement"></param> public FillMemoryStatement Copy(IFillMemoryStatement fillMemoryStatement) { var mutableCopy = this.shallowCopier.Copy(fillMemoryStatement); mutableCopy.TargetAddress = this.Copy(mutableCopy.TargetAddress); mutableCopy.FillValue = this.Copy(mutableCopy.FillValue); mutableCopy.NumberOfBytesToFill = this.Copy(mutableCopy.NumberOfBytesToFill); return mutableCopy; }
/// <summary> /// Performs some computation with the given fill memory statement. /// </summary> /// <param name="fillMemoryStatement"></param> public override void Visit(IFillMemoryStatement fillMemoryStatement) { FillMemoryStatement mutableFillMemoryStatement = fillMemoryStatement as FillMemoryStatement; if (mutableFillMemoryStatement == null) { this.resultStatement = fillMemoryStatement; return; } this.resultStatement = this.myCodeMutator.Visit(mutableFillMemoryStatement); }