2 import IR.MethodDescriptor;
4 public class FlatCall extends FlatNode {
6 TempDescriptor this_temp;
8 MethodDescriptor method;
10 public FlatCall(MethodDescriptor md, TempDescriptor dst, TempDescriptor this_temp, TempDescriptor[] args) {
13 this.this_temp=this_temp;
17 public MethodDescriptor getMethod() {
21 public TempDescriptor getThis() {
25 public TempDescriptor getReturnTemp() {
29 public int numArgs() {
33 public TempDescriptor getArg(int i) {
37 public String toString() {
43 st+=method.getSymbol()+"(";
45 st+=dst+"="+method.getSymbol()+"(";
46 if (this_temp!=null) {
52 for(int i=0;i<args.length;i++) {
53 st+=args[i].toString();
54 if ((i+1)<args.length)
61 return FKind.FlatCall;
64 public TempDescriptor [] readsTemps() {
68 TempDescriptor [] t=new TempDescriptor[size];
71 t[offset++]=this_temp;
72 for(int i=0;i<args.length;i++)
77 public TempDescriptor [] writesTemps() {
79 return new TempDescriptor[] {dst};
81 return new TempDescriptor[0];