@Override public void VisitSetterNode(GtSetterNode Node) { Node.RecvNode.Accept(this); /*local*/ int TargetReg = this.PopRegister(); /*local*/ ArrayList<GtFieldInfo> FieldList = this.ClassFieldMap.get(Node.RecvNode.Type); /*local*/ int Offset = this.GetFieldOffset(FieldList, Node.NativeName); Node.ValueNode.Accept(this); this.VisitingBuilder.Append( "XNMOV " + "REG" + TargetReg + ", " + Offset + ", REG" + this.PopRegister() + "\n"); }
@Override public void VisitUnaryNode(GtUnaryNode Node) { /*local*/ int TargetReg = this.ReserveRegister(1 /*ArgumentSize*/ + CallParameters); /*local*/ int CallReg = TargetReg - ReturnIndex + ThisIndex; Node.RecvNode.Accept(this); this.VisitingBuilder.Append( "NMOV " + "REG" + (CallReg + 1) + ", REG" + this.PopRegister() + "\n"); /*local*/ String Op = Node.Token.ParsedText; // Node.NativeName this.VisitingBuilder.Append( "NSET " + "REG" + (CallReg + MethodIndex) + ", METHOD\"" + Op + "\"\n"); this.VisitingBuilder.Append("CALL " + "REG" + CallReg + ", " + 1 /*ArgumentSize*/ + "\n"); this.PushRegister(TargetReg); this.FreeRegister(TargetReg + 1); }
@Override public void VisitPrefixInclNode(GtPrefixInclNode Node) { /*FIXME*/ /*local*/ int TargetReg = this.ReserveRegister(2 /*ArgumentSize*/ + CallParameters); /*local*/ int CallReg = TargetReg - ReturnIndex + ThisIndex; Node.RecvNode.Accept(this); this.VisitingBuilder.Append( "NMOV " + "REG" + (CallReg + 1) + ", REG" + this.PopRegister() + "\n"); /*local*/ int Index = this.AddConstant(new Long(1)); this.VisitingBuilder.Append("NSET " + "REG" + (CallReg + 2) + ", " + "CONST" + Index + "\n"); this.VisitingBuilder.Append("NSET " + "REG" + (CallReg + MethodIndex) + ", METHOD\"\"\n"); this.VisitingBuilder.Append("CALL " + "REG" + CallReg + ", " + 2 /*ArgumentSize*/ + "\n"); this.PushRegister(TargetReg); this.FreeRegister(TargetReg + 1); }
@Override public void VisitGetIndexNode(GtGetIndexNode Node) { /*local*/ int TargetReg = this.ReserveRegister(2 /*ArgumentSize*/ + CallParameters); /*local*/ int CallReg = TargetReg - ReturnIndex + ThisIndex; Node.RecvNode.Accept(this); this.VisitingBuilder.Append( "NMOV " + "REG" + (CallReg + 1) + ", REG" + this.PopRegister() + "\n"); Node.IndexNode.Accept(this); this.VisitingBuilder.Append( "NMOV " + "REG" + (CallReg + 2) + ", REG" + this.PopRegister() + "\n"); this.VisitingBuilder.Append( "NSET " + "REG" + (CallReg + MethodIndex) + ", METHOD\"GetIndex\"\n"); this.VisitingBuilder.Append("CALL " + "REG" + CallReg + ", " + 2 /*ArgumentSize*/ + "\n"); this.PushRegister(TargetReg); this.FreeRegister(TargetReg + 1); }