Browse Source

* a_call_ref removed

peter 22 years ago
parent
commit
e248f1b570
2 changed files with 12 additions and 38 deletions
  1. 8 28
      compiler/cgobj.pas
  2. 4 10
      compiler/x86/cgx86.pas

+ 8 - 28
compiler/cgobj.pas

@@ -160,12 +160,13 @@ unit cgobj;
 
 
           {# Emits instruction to call the method specified by symbol name.
           {# Emits instruction to call the method specified by symbol name.
              This routine must be overriden for each new target cpu.
              This routine must be overriden for each new target cpu.
+
+             There is no a_call_ref because loading the reference will use
+             a temp register on most cpu's resulting in conflicts with the
+             registers used for the parameters (PFV)
           }
           }
           procedure a_call_name(list : taasmoutput;const s : string);virtual; abstract;
           procedure a_call_name(list : taasmoutput;const s : string);virtual; abstract;
-          procedure a_call_ref(list : taasmoutput;const ref : treference);virtual;
           procedure a_call_reg(list : taasmoutput;reg : tregister);virtual;abstract;
           procedure a_call_reg(list : taasmoutput;reg : tregister);virtual;abstract;
-          procedure a_call_loc(list : taasmoutput;const loc:tlocation);
-
 
 
           { move instructions }
           { move instructions }
           procedure a_load_const_reg(list : taasmoutput;size : tcgsize;a : aword;register : tregister);virtual; abstract;
           procedure a_load_const_reg(list : taasmoutput;size : tcgsize;a : aword;register : tregister);virtual; abstract;
@@ -752,30 +753,6 @@ unit cgobj;
       end;
       end;
 
 
 
 
-    procedure tcg.a_call_ref(list : taasmoutput;const ref:treference);
-      var
-        tmpreg: tregister;
-      begin
-        tmpreg:=rg.getaddressregister(list);
-        a_load_ref_reg(list,OS_ADDR,OS_ADDR,ref,tmpreg);
-        a_call_reg(list,tmpreg);
-        rg.ungetaddressregister(list,tmpreg);
-      end;
-
-
-    procedure tcg.a_call_loc(list : taasmoutput;const loc:tlocation);
-      begin
-        case loc.loc of
-           LOC_REGISTER,LOC_CREGISTER:
-             cg.a_call_reg(list,loc.register);
-           LOC_REFERENCE,LOC_CREFERENCE :
-             cg.a_call_ref(list,loc.reference);
-           else
-             internalerror(200203311);
-        end;
-      end;
-
-
     function tcg.optimize_op_const_reg(list: taasmoutput; var op: topcg; var a : aword; var reg:tregister): boolean;
     function tcg.optimize_op_const_reg(list: taasmoutput; var op: topcg; var a : aword; var reg:tregister): boolean;
       var
       var
         powerval : longint;
         powerval : longint;
@@ -1575,7 +1552,10 @@ finalization
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.123  2003-09-25 21:26:24  peter
+  Revision 1.124  2003-09-28 13:40:13  peter
+    * a_call_ref removed
+
+  Revision 1.123  2003/09/25 21:26:24  peter
     * remove obsolete tparalocation.sp_fixup
     * remove obsolete tparalocation.sp_fixup
 
 
   Revision 1.122  2003/09/23 20:37:16  peter
   Revision 1.122  2003/09/23 20:37:16  peter

+ 4 - 10
compiler/x86/cgx86.pas

@@ -50,10 +50,8 @@ unit cgx86;
         procedure a_paramaddr_ref(list : taasmoutput;const r : treference;const locpara : tparalocation);override;
         procedure a_paramaddr_ref(list : taasmoutput;const r : treference;const locpara : tparalocation);override;
 
 
         procedure a_call_name(list : taasmoutput;const s : string);override;
         procedure a_call_name(list : taasmoutput;const s : string);override;
-        procedure a_call_ref(list : taasmoutput;const ref : treference);override;
         procedure a_call_reg(list : taasmoutput;reg : tregister);override;
         procedure a_call_reg(list : taasmoutput;reg : tregister);override;
 
 
-
         procedure a_op_const_reg(list : taasmoutput; Op: TOpCG; size: TCGSize; a: AWord; reg: TRegister); override;
         procedure a_op_const_reg(list : taasmoutput; Op: TOpCG; size: TCGSize; a: AWord; reg: TRegister); override;
         procedure a_op_const_ref(list : taasmoutput; Op: TOpCG; size: TCGSize; a: AWord; const ref: TReference); override;
         procedure a_op_const_ref(list : taasmoutput; Op: TOpCG; size: TCGSize; a: AWord; const ref: TReference); override;
         procedure a_op_reg_reg(list : taasmoutput; Op: TOpCG; size: TCGSize; src, dst: TRegister); override;
         procedure a_op_reg_reg(list : taasmoutput; Op: TOpCG; size: TCGSize; src, dst: TRegister); override;
@@ -500,14 +498,7 @@ unit cgx86;
       end;
       end;
 
 
 
 
-    procedure tcgx86.a_call_ref(list : taasmoutput;const ref : treference);
-      begin
-        list.concat(taicpu.op_ref(A_CALL,S_NO,ref));
-      end;
-
-
     procedure tcgx86.a_call_reg(list : taasmoutput;reg : tregister);
     procedure tcgx86.a_call_reg(list : taasmoutput;reg : tregister);
-
       begin
       begin
         list.concat(taicpu.op_reg(A_CALL,S_NO,reg));
         list.concat(taicpu.op_reg(A_CALL,S_NO,reg));
       end;
       end;
@@ -1607,7 +1598,10 @@ unit cgx86;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.66  2003-09-25 21:29:16  peter
+  Revision 1.67  2003-09-28 13:37:19  peter
+    * a_call_ref removed
+
+  Revision 1.66  2003/09/25 21:29:16  peter
     * change push/pop in getreg/ungetreg
     * change push/pop in getreg/ungetreg
 
 
   Revision 1.65  2003/09/25 13:13:32  florian
   Revision 1.65  2003/09/25 13:13:32  florian