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(")");
 }
Exemple #3
0
 /// <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);
 }
Exemple #4
0
 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;
 }
Exemple #6
0
 /// <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);
 }
Exemple #7
0
 /// <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);
 }
Exemple #8
0
 public void Visit(IFillMemoryStatement fillMemoryStatement)
 {
     this.result = this.rewriter.Rewrite(fillMemoryStatement);
 }
Exemple #9
0
    /// <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);
    }
Exemple #10
0
 /// <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;
 }
Exemple #12
0
    /// <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;
    }
Exemple #13
0
 public override void Visit(IFillMemoryStatement fillMemoryStatement)
 {
     allElements.Add(new InvokInfo(Traverser, "IFillMemoryStatement", fillMemoryStatement));
 }
Exemple #14
0
 /// <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)
 {
 }
Exemple #18
0
 //^ 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();
 }
Exemple #19
0
 /// <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);
 }
Exemple #20
0
 /// <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);
 }
Exemple #21
0
 public void Visit(IFillMemoryStatement fillMemoryStatement)
 {
     throw new NotImplementedException();
 }
Exemple #22
0
 public void Visit(IFillMemoryStatement fillMemoryStatement)
 {
     this.traverser.Traverse(fillMemoryStatement);
 }
Exemple #23
0
 /// <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;
 }
Exemple #24
0
 public void Visit(IFillMemoryStatement fillMemoryStatement)
 {
     Contract.Requires(fillMemoryStatement != null);
       throw new NotImplementedException();
 }
Exemple #25
0
 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(")");
 }
Exemple #26
0
 /// <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);
 }
Exemple #27
0
 /// <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;
 }
Exemple #28
0
 public override void TraverseChildren(IFillMemoryStatement fillMemoryStatement)
 {
     MethodEnter(fillMemoryStatement);
     base.TraverseChildren(fillMemoryStatement);
     MethodExit();
 }
Exemple #29
0
 /// <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);
 }