Example #1
0
 public void inherit(LGraph graph, NodeBlock other)
 {
     if (other == null)
     {
         stack_ = new AbstractStack(graph.nargs);
         for (int i = 0; i < graph.nargs; i++)
         {
             DDeclareLocal local = new DDeclareLocal(lir_.pc, null);
             local.setOffset((i * 4) + 12);
             add(local);
             stack_.init((i * 4) + 12, local);
         }
     }
     else if (stack_ == null)
     {
         //Debug.Assert(other.stack_ != null);
         stack_ = new AbstractStack(other.stack_);
     }
     else
     {
         // Right now we only create phis for pri/alt.
         joinRegs(Register.Pri, other.stack_.pri);
         joinRegs(Register.Alt, other.stack_.alt);
     }
 }
Example #2
0
 public AbstractStack(AbstractStack other)
 {
     stack_ = new List<StackEntry>();
     for (int i = 0; i < other.stack_.Count; i++)
         stack_.Add(new StackEntry(other.stack_[i].declaration, other.stack_[i].assignment));
     args_ = new StackEntry[other.args_.Length];
     for (int i = 0; i < args_.Length; i++)
         args_[i] = new StackEntry(other.args_[i].declaration, other.args_[i].assignment);
     pri_ = other.pri_;
     alt_ = other.alt_;
 }
Example #3
0
 public AbstractStack(AbstractStack other)
 {
     stack_ = new List <StackEntry>();
     for (int i = 0; i < other.stack_.Count; i++)
     {
         stack_.Add(new StackEntry(other.stack_[i].declaration, other.stack_[i].assignment));
     }
     args_ = new StackEntry[other.args_.Length];
     for (int i = 0; i < args_.Length; i++)
     {
         args_[i] = new StackEntry(other.args_[i].declaration, other.args_[i].assignment);
     }
     pri_ = other.pri_;
     alt_ = other.alt_;
 }
Example #4
0
 public void inherit(LGraph graph, NodeBlock other)
 {
     if (other == null)
     {
         stack_ = new AbstractStack(graph.nargs);
         for (int i = 0; i < graph.nargs; i++)
         {
             DDeclareLocal local = new DDeclareLocal(lir_.pc, null);
             local.setOffset((i * 4) + 12);
             add(local);
             stack_.init((i * 4) + 12, local);
         }
     }
     else if (stack_ == null)
     {
         //Debug.Assert(other.stack_ != null);
         stack_ = new AbstractStack(other.stack_);
     }
     else
     {
         // Right now we only create phis for pri/alt.
         joinRegs(Register.Pri, other.stack_.pri);
         joinRegs(Register.Alt, other.stack_.alt);
     }
 }