Browse Source

* several rg.allocexplicitregistersint/rg.deallocexplicitregistersint
pairs round calls to helpers

Jonas Maebe 22 năm trước cách đây
mục cha
commit
355f84758e
5 tập tin đã thay đổi với 234 bổ sung27 xóa
  1. 70 10
      compiler/cgobj.pas
  2. 19 3
      compiler/ncgcal.pas
  3. 107 7
      compiler/ncgflw.pas
  4. 12 2
      compiler/ncginl.pas
  5. 26 5
      compiler/ncgmem.pas

+ 70 - 10
compiler/cgobj.pas

@@ -1394,10 +1394,16 @@ unit cgobj;
         if delsource then
         if delsource then
          reference_release(list,source);
          reference_release(list,source);
         a_param_const(list,OS_INT,len,paramanager.getintparaloc(list,1));
         a_param_const(list,OS_INT,len,paramanager.getintparaloc(list,1));
-        a_call_name(list,'FPC_SHORTSTR_ASSIGN');
         paramanager.freeintparaloc(list,3);
         paramanager.freeintparaloc(list,3);
         paramanager.freeintparaloc(list,2);
         paramanager.freeintparaloc(list,2);
         paramanager.freeintparaloc(list,1);
         paramanager.freeintparaloc(list,1);
+{$ifdef newra}
+        rg.allocexplicitregistersint(list,VOLATILE_INTREGISTERS);
+{$endif newra}
+        a_call_name(list,'FPC_SHORTSTR_ASSIGN');
+{$ifdef newra}
+        rg.deallocexplicitregistersint(list,VOLATILE_INTREGISTERS);
+{$endif newra}
       end;
       end;
 
 
 
 
@@ -1423,7 +1429,14 @@ unit cgobj;
           begin
           begin
             { these functions get the pointer by value }
             { these functions get the pointer by value }
             a_param_ref(list,OS_ADDR,ref,paramanager.getintparaloc(list,1));
             a_param_ref(list,OS_ADDR,ref,paramanager.getintparaloc(list,1));
+            paramanager.freeintparaloc(list,1);
+{$ifdef newra}
+            rg.allocexplicitregistersint(list,VOLATILE_INTREGISTERS);
+{$endif newra}
             a_call_name(list,incrfunc);
             a_call_name(list,incrfunc);
+{$ifdef newra}
+            rg.deallocexplicitregistersint(list,VOLATILE_INTREGISTERS);
+{$endif newra}
           end
           end
          else
          else
           begin
           begin
@@ -1433,10 +1446,16 @@ unit cgobj;
               a_param_ref(list,OS_ADDR,ref,paramanager.getintparaloc(list,1))
               a_param_ref(list,OS_ADDR,ref,paramanager.getintparaloc(list,1))
             else
             else
               a_paramaddr_ref(list,ref,paramanager.getintparaloc(list,1));
               a_paramaddr_ref(list,ref,paramanager.getintparaloc(list,1));
-            a_call_name(list,'FPC_ADDREF');
+            paramanager.freeintparaloc(list,1);
             paramanager.freeintparaloc(list,2);
             paramanager.freeintparaloc(list,2);
+{$ifdef newra}
+            rg.allocexplicitregistersint(list,VOLATILE_INTREGISTERS);
+{$endif newra}
+            a_call_name(list,'FPC_ADDREF');
+{$ifdef newra}
+            rg.deallocexplicitregistersint(list,VOLATILE_INTREGISTERS);
+{$endif newra}
          end;
          end;
-        paramanager.freeintparaloc(list,1);
       end;
       end;
 
 
 
 
@@ -1472,7 +1491,14 @@ unit cgobj;
               a_param_ref(list,OS_ADDR,ref,paramanager.getintparaloc(list,1))
               a_param_ref(list,OS_ADDR,ref,paramanager.getintparaloc(list,1))
             else
             else
               a_paramaddr_ref(list,ref,paramanager.getintparaloc(list,1));
               a_paramaddr_ref(list,ref,paramanager.getintparaloc(list,1));
+            paramanager.freeintparaloc(list,1);
+{$ifdef newra}
+            rg.allocexplicitregistersint(list,VOLATILE_INTREGISTERS);
+{$endif newra}
             a_call_name(list,decrfunc);
             a_call_name(list,decrfunc);
+{$ifdef newra}
+            rg.deallocexplicitregistersint(list,VOLATILE_INTREGISTERS);
+{$endif newra}
             if needrtti then
             if needrtti then
               paramanager.freeintparaloc(list,2);
               paramanager.freeintparaloc(list,2);
           end
           end
@@ -1484,10 +1510,16 @@ unit cgobj;
               a_param_ref(list,OS_ADDR,ref,paramanager.getintparaloc(list,1))
               a_param_ref(list,OS_ADDR,ref,paramanager.getintparaloc(list,1))
             else
             else
               a_paramaddr_ref(list,ref,paramanager.getintparaloc(list,1));
               a_paramaddr_ref(list,ref,paramanager.getintparaloc(list,1));
-            a_call_name(list,'FPC_DECREF');
+            paramanager.freeintparaloc(list,1);
             paramanager.freeintparaloc(list,2);
             paramanager.freeintparaloc(list,2);
+{$ifdef newra}
+            rg.allocexplicitregistersint(list,VOLATILE_INTREGISTERS);
+{$endif newra}
+            a_call_name(list,'FPC_DECREF');
+{$ifdef newra}
+            rg.deallocexplicitregistersint(list,VOLATILE_INTREGISTERS);
+{$endif newra}
          end;
          end;
-        paramanager.freeintparaloc(list,1);
       end;
       end;
 
 
 
 
@@ -1507,9 +1539,15 @@ unit cgobj;
                 a_param_ref(list,OS_ADDR,ref,paramanager.getintparaloc(list,1))
                 a_param_ref(list,OS_ADDR,ref,paramanager.getintparaloc(list,1))
               else
               else
                 a_paramaddr_ref(list,ref,paramanager.getintparaloc(list,1));
                 a_paramaddr_ref(list,ref,paramanager.getintparaloc(list,1));
-              a_call_name(list,'FPC_INITIALIZE');
               paramanager.freeintparaloc(list,1);
               paramanager.freeintparaloc(list,1);
               paramanager.freeintparaloc(list,2);
               paramanager.freeintparaloc(list,2);
+{$ifdef newra}
+              rg.allocexplicitregistersint(list,VOLATILE_INTREGISTERS);
+{$endif newra}
+              a_call_name(list,'FPC_INITIALIZE');
+{$ifdef newra}
+              rg.deallocexplicitregistersint(list,VOLATILE_INTREGISTERS);
+{$endif newra}
            end;
            end;
       end;
       end;
 
 
@@ -1530,9 +1568,15 @@ unit cgobj;
                 a_param_ref(list,OS_ADDR,ref,paramanager.getintparaloc(list,1))
                 a_param_ref(list,OS_ADDR,ref,paramanager.getintparaloc(list,1))
               else
               else
                 a_paramaddr_ref(list,ref,paramanager.getintparaloc(list,1));
                 a_paramaddr_ref(list,ref,paramanager.getintparaloc(list,1));
-              a_call_name(list,'FPC_FINALIZE');
               paramanager.freeintparaloc(list,1);
               paramanager.freeintparaloc(list,1);
               paramanager.freeintparaloc(list,2);
               paramanager.freeintparaloc(list,2);
+{$ifdef newra}
+              rg.allocexplicitregistersint(list,VOLATILE_INTREGISTERS);
+{$endif newra}
+              a_call_name(list,'FPC_FINALIZE');
+{$ifdef newra}
+              rg.deallocexplicitregistersint(list,VOLATILE_INTREGISTERS);
+{$endif newra}
            end;
            end;
       end;
       end;
 
 
@@ -1710,16 +1754,28 @@ unit cgobj;
            reference_reset_symbol(hrefvmt,objectlibrary.newasmsymboldata(objdef.vmt_mangledname),0);
            reference_reset_symbol(hrefvmt,objectlibrary.newasmsymboldata(objdef.vmt_mangledname),0);
            a_paramaddr_ref(list,hrefvmt,paramanager.getintparaloc(list,2));
            a_paramaddr_ref(list,hrefvmt,paramanager.getintparaloc(list,2));
            a_param_reg(list,OS_ADDR,reg,paramanager.getintparaloc(list,1));
            a_param_reg(list,OS_ADDR,reg,paramanager.getintparaloc(list,1));
-           a_call_name(list,'FPC_CHECK_OBJECT_EXT');
            paramanager.freeintparaloc(list,2);
            paramanager.freeintparaloc(list,2);
            paramanager.freeintparaloc(list,1);
            paramanager.freeintparaloc(list,1);
+{$ifdef newra}
+           rg.allocexplicitregistersint(list,VOLATILE_INTREGISTERS);
+{$endif newra}
+           a_call_name(list,'FPC_CHECK_OBJECT_EXT');
+{$ifdef newra}
+           rg.deallocexplicitregistersint(list,VOLATILE_INTREGISTERS);
+{$endif newra}
          end
          end
         else
         else
          if (cs_check_range in aktlocalswitches) then
          if (cs_check_range in aktlocalswitches) then
           begin
           begin
             a_param_reg(list,OS_ADDR,reg,paramanager.getintparaloc(list,1));
             a_param_reg(list,OS_ADDR,reg,paramanager.getintparaloc(list,1));
-            a_call_name(list,'FPC_CHECK_OBJECT');
             paramanager.freeintparaloc(list,1);
             paramanager.freeintparaloc(list,1);
+{$ifdef newra}
+            rg.allocexplicitregistersint(list,VOLATILE_INTREGISTERS);
+{$endif newra}
+            a_call_name(list,'FPC_CHECK_OBJECT');
+{$ifdef newra}
+            rg.deallocexplicitregistersint(list,VOLATILE_INTREGISTERS);
+{$endif newra}
           end;
           end;
       end;
       end;
 
 
@@ -1795,7 +1851,11 @@ finalization
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.114  2003-07-06 17:58:22  peter
+  Revision 1.115  2003-07-23 11:01:14  jonas
+    * several rg.allocexplicitregistersint/rg.deallocexplicitregistersint
+      pairs round calls to helpers
+
+  Revision 1.114  2003/07/06 17:58:22  peter
     * framepointer fixes for sparc
     * framepointer fixes for sparc
     * parent framepointer code more generic
     * parent framepointer code more generic
 
 

+ 19 - 3
compiler/ncgcal.pas

@@ -1092,8 +1092,14 @@ implementation
            begin
            begin
               reference_reset_symbol(href,iolabel,0);
               reference_reset_symbol(href,iolabel,0);
               cg.a_paramaddr_ref(exprasmlist,href,paramanager.getintparaloc(exprasmlist,1));
               cg.a_paramaddr_ref(exprasmlist,href,paramanager.getintparaloc(exprasmlist,1));
-              cg.a_call_name(exprasmlist,'FPC_IOCHECK');
               paramanager.freeintparaloc(exprasmlist,1);
               paramanager.freeintparaloc(exprasmlist,1);
+{$ifdef newra}
+              rg.allocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
+{$endif newra}
+              cg.a_call_name(exprasmlist,'FPC_IOCHECK');
+{$ifdef newra}
+              rg.deallocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
+{$endif newra}
            end;
            end;
 
 
          { restore registers }
          { restore registers }
@@ -1446,8 +1452,14 @@ implementation
            begin
            begin
               reference_reset_symbol(href,iolabel,0);
               reference_reset_symbol(href,iolabel,0);
               cg.a_paramaddr_ref(exprasmlist,href,paramanager.getintparaloc(exprasmlist,1));
               cg.a_paramaddr_ref(exprasmlist,href,paramanager.getintparaloc(exprasmlist,1));
-              cg.a_call_name(exprasmlist,'FPC_IOCHECK');
               paramanager.freeintparaloc(exprasmlist,1);
               paramanager.freeintparaloc(exprasmlist,1);
+{$ifdef newra}
+              rg.allocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
+{$endif newra}
+              cg.a_call_name(exprasmlist,'FPC_IOCHECK');
+{$ifdef newra}
+              rg.deallocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
+{$endif newra}
            end;
            end;
 
 
          { restore registers }
          { restore registers }
@@ -1531,7 +1543,11 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.102  2003-07-21 13:51:50  jonas
+  Revision 1.103  2003-07-23 11:01:14  jonas
+    * several rg.allocexplicitregistersint/rg.deallocexplicitregistersint
+      pairs round calls to helpers
+
+  Revision 1.102  2003/07/21 13:51:50  jonas
     * fixed 64bit int results with -dnewra (you can't free both registers and
     * fixed 64bit int results with -dnewra (you can't free both registers and
       then allocate two new ones, because then the registers could be reversed
       then allocate two new ones, because then the registers could be reversed
       afterwards -> you get something like "movl %eax, %edx; movl %edx,%eax")
       afterwards -> you get something like "movl %eax, %edx; movl %edx,%eax")

+ 107 - 7
compiler/ncgflw.pas

@@ -860,15 +860,27 @@ implementation
                 exit;
                 exit;
 {$endif not callparatemp}
 {$endif not callparatemp}
               cg.a_param_loc(exprasmlist,left.location,paramanager.getintparaloc(exprasmlist,1));
               cg.a_param_loc(exprasmlist,left.location,paramanager.getintparaloc(exprasmlist,1));
-              cg.a_call_name(exprasmlist,'FPC_RAISEEXCEPTION');
               paramanager.freeintparaloc(exprasmlist,3);
               paramanager.freeintparaloc(exprasmlist,3);
               paramanager.freeintparaloc(exprasmlist,2);
               paramanager.freeintparaloc(exprasmlist,2);
               paramanager.freeintparaloc(exprasmlist,1);
               paramanager.freeintparaloc(exprasmlist,1);
+{$ifdef newra}
+              rg.allocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
+{$endif newra}
+              cg.a_call_name(exprasmlist,'FPC_RAISEEXCEPTION');
+{$ifdef newra}
+              rg.deallocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
+{$endif newra}
            end
            end
          else
          else
            begin
            begin
+{$ifdef newra}
+              rg.allocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
+{$endif newra}
               cg.a_call_name(exprasmlist,'FPC_POPADDRSTACK');
               cg.a_call_name(exprasmlist,'FPC_POPADDRSTACK');
               cg.a_call_name(exprasmlist,'FPC_RERAISE');
               cg.a_call_name(exprasmlist,'FPC_RERAISE');
+{$ifdef newra}
+              rg.deallocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
+{$endif newra}
            end;
            end;
        end;
        end;
 
 
@@ -909,12 +921,24 @@ implementation
     var r:Tregister;
     var r:Tregister;
 
 
       begin
       begin
+{$ifdef newra}
+         rg.allocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
+{$endif newra}
          cg.a_call_name(exprasmlist,'FPC_POPOBJECTSTACK');
          cg.a_call_name(exprasmlist,'FPC_POPOBJECTSTACK');
+{$ifdef newra}
+         rg.deallocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
+{$endif newra}
          r.enum:=R_INTREGISTER;
          r.enum:=R_INTREGISTER;
          r.number:=NR_FUNCTION_RESULT_REG;
          r.number:=NR_FUNCTION_RESULT_REG;
          cg.a_param_reg(exprasmlist,OS_ADDR,r,paramanager.getintparaloc(exprasmlist,1));
          cg.a_param_reg(exprasmlist,OS_ADDR,r,paramanager.getintparaloc(exprasmlist,1));
-         cg.a_call_name(exprasmlist,'FPC_DESTROYEXCEPTION');
          paramanager.freeintparaloc(exprasmlist,1);
          paramanager.freeintparaloc(exprasmlist,1);
+{$ifdef newra}
+         rg.allocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
+{$endif newra}
+         cg.a_call_name(exprasmlist,'FPC_DESTROYEXCEPTION');
+{$ifdef newra}
+         rg.deallocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
+{$endif newra}
       end;
       end;
 
 
 
 
@@ -1019,8 +1043,14 @@ implementation
                 'default handler' flag (=-1)
                 'default handler' flag (=-1)
               }
               }
               cg.a_param_const(exprasmlist,OS_ADDR,aword(-1),paramanager.getintparaloc(exprasmlist,1));
               cg.a_param_const(exprasmlist,OS_ADDR,aword(-1),paramanager.getintparaloc(exprasmlist,1));
-              cg.a_call_name(exprasmlist,'FPC_CATCHES');
               paramanager.freeintparaloc(exprasmlist,1);
               paramanager.freeintparaloc(exprasmlist,1);
+{$ifdef newra}
+              rg.allocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
+{$endif newra}
+              cg.a_call_name(exprasmlist,'FPC_CATCHES');
+{$ifdef newra}
+              rg.deallocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
+{$endif newra}
 
 
               { the destruction of the exception object must be also }
               { the destruction of the exception object must be also }
               { guarded by an exception frame                        }
               { guarded by an exception frame                        }
@@ -1038,13 +1068,25 @@ implementation
 
 
               try_free_exception(exprasmlist,tempbuf,tempaddr,href,0,doobjectdestroy,false);
               try_free_exception(exprasmlist,tempbuf,tempaddr,href,0,doobjectdestroy,false);
 
 
+{$ifdef newra}
+              rg.allocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
+{$endif newra}
               cg.a_call_name(exprasmlist,'FPC_POPSECONDOBJECTSTACK');
               cg.a_call_name(exprasmlist,'FPC_POPSECONDOBJECTSTACK');
+{$ifdef newra}
+              rg.deallocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
+{$endif newra}
 
 
               r.enum:=R_INTREGISTER;
               r.enum:=R_INTREGISTER;
               r.number:=NR_FUNCTION_RESULT_REG;
               r.number:=NR_FUNCTION_RESULT_REG;
               cg.a_param_reg(exprasmlist, OS_ADDR, r, paramanager.getintparaloc(exprasmlist,1));
               cg.a_param_reg(exprasmlist, OS_ADDR, r, paramanager.getintparaloc(exprasmlist,1));
-              cg.a_call_name(exprasmlist,'FPC_DESTROYEXCEPTION');
               paramanager.freeintparaloc(exprasmlist,1);
               paramanager.freeintparaloc(exprasmlist,1);
+{$ifdef newra}
+              rg.allocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
+{$endif newra}
+              cg.a_call_name(exprasmlist,'FPC_DESTROYEXCEPTION');
+{$ifdef newra}
+              rg.deallocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
+{$endif newra}
               { we don't need to restore esi here because reraise never }
               { we don't need to restore esi here because reraise never }
               { returns                                                 }
               { returns                                                 }
               cg.a_call_name(exprasmlist,'FPC_RERAISE');
               cg.a_call_name(exprasmlist,'FPC_RERAISE');
@@ -1065,7 +1107,13 @@ implementation
               cg.a_label(exprasmlist,exitexceptlabel);
               cg.a_label(exprasmlist,exitexceptlabel);
               { we must also destroy the address frame which guards }
               { we must also destroy the address frame which guards }
               { exception object                                    }
               { exception object                                    }
+{$ifdef newra}
+              rg.allocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
+{$endif newra}
               cg.a_call_name(exprasmlist,'FPC_POPADDRSTACK');
               cg.a_call_name(exprasmlist,'FPC_POPADDRSTACK');
+{$ifdef newra}
+              rg.deallocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
+{$endif newra}
               cg.g_exception_reason_load(exprasmlist,href);
               cg.g_exception_reason_load(exprasmlist,href);
               cleanupobjectstack;
               cleanupobjectstack;
               cg.a_jmp_always(exprasmlist,oldaktexitlabel);
               cg.a_jmp_always(exprasmlist,oldaktexitlabel);
@@ -1076,7 +1124,13 @@ implementation
               cg.a_label(exprasmlist,breakexceptlabel);
               cg.a_label(exprasmlist,breakexceptlabel);
               { we must also destroy the address frame which guards }
               { we must also destroy the address frame which guards }
               { exception object                                    }
               { exception object                                    }
+{$ifdef newra}
+              rg.allocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
+{$endif newra}
               cg.a_call_name(exprasmlist,'FPC_POPADDRSTACK');
               cg.a_call_name(exprasmlist,'FPC_POPADDRSTACK');
+{$ifdef newra}
+              rg.deallocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
+{$endif newra}
               cg.g_exception_reason_load(exprasmlist,href);
               cg.g_exception_reason_load(exprasmlist,href);
               cleanupobjectstack;
               cleanupobjectstack;
               cg.a_jmp_always(exprasmlist,oldaktbreaklabel);
               cg.a_jmp_always(exprasmlist,oldaktbreaklabel);
@@ -1087,7 +1141,13 @@ implementation
               cg.a_label(exprasmlist,continueexceptlabel);
               cg.a_label(exprasmlist,continueexceptlabel);
               { we must also destroy the address frame which guards }
               { we must also destroy the address frame which guards }
               { exception object                                    }
               { exception object                                    }
+{$ifdef newra}
+              rg.allocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
+{$endif newra}
               cg.a_call_name(exprasmlist,'FPC_POPADDRSTACK');
               cg.a_call_name(exprasmlist,'FPC_POPADDRSTACK');
+{$ifdef newra}
+              rg.deallocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
+{$endif newra}
               cg.g_exception_reason_load(exprasmlist,href);
               cg.g_exception_reason_load(exprasmlist,href);
               cleanupobjectstack;
               cleanupobjectstack;
               cg.a_jmp_always(exprasmlist,oldaktcontinuelabel);
               cg.a_jmp_always(exprasmlist,oldaktcontinuelabel);
@@ -1097,7 +1157,13 @@ implementation
            begin
            begin
               { do some magic for exit in the try block }
               { do some magic for exit in the try block }
               cg.a_label(exprasmlist,exittrylabel);
               cg.a_label(exprasmlist,exittrylabel);
+{$ifdef newra}
+              rg.allocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
+{$endif newra}
               cg.a_call_name(exprasmlist,'FPC_POPADDRSTACK');
               cg.a_call_name(exprasmlist,'FPC_POPADDRSTACK');
+{$ifdef newra}
+              rg.deallocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
+{$endif newra}
               cg.g_exception_reason_load(exprasmlist,href);
               cg.g_exception_reason_load(exprasmlist,href);
               cg.a_jmp_always(exprasmlist,oldaktexitlabel);
               cg.a_jmp_always(exprasmlist,oldaktexitlabel);
            end;
            end;
@@ -1105,7 +1171,13 @@ implementation
          if fc_break in tryflowcontrol then
          if fc_break in tryflowcontrol then
            begin
            begin
               cg.a_label(exprasmlist,breaktrylabel);
               cg.a_label(exprasmlist,breaktrylabel);
+{$ifdef newra}
+              rg.allocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
+{$endif newra}
               cg.a_call_name(exprasmlist,'FPC_POPADDRSTACK');
               cg.a_call_name(exprasmlist,'FPC_POPADDRSTACK');
+{$ifdef newra}
+              rg.deallocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
+{$endif newra}
               cg.g_exception_reason_load(exprasmlist,href);
               cg.g_exception_reason_load(exprasmlist,href);
               cg.a_jmp_always(exprasmlist,oldaktbreaklabel);
               cg.a_jmp_always(exprasmlist,oldaktbreaklabel);
            end;
            end;
@@ -1113,7 +1185,13 @@ implementation
          if fc_continue in tryflowcontrol then
          if fc_continue in tryflowcontrol then
            begin
            begin
               cg.a_label(exprasmlist,continuetrylabel);
               cg.a_label(exprasmlist,continuetrylabel);
+{$ifdef newra}
+              rg.allocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
+{$endif newra}
               cg.a_call_name(exprasmlist,'FPC_POPADDRSTACK');
               cg.a_call_name(exprasmlist,'FPC_POPADDRSTACK');
+{$ifdef newra}
+              rg.deallocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
+{$endif newra}
               cg.g_exception_reason_load(exprasmlist,href);
               cg.g_exception_reason_load(exprasmlist,href);
               cg.a_jmp_always(exprasmlist,oldaktcontinuelabel);
               cg.a_jmp_always(exprasmlist,oldaktcontinuelabel);
            end;
            end;
@@ -1165,8 +1243,14 @@ implementation
          { send the vmt parameter }
          { send the vmt parameter }
          reference_reset_symbol(href2,objectlibrary.newasmsymboldata(excepttype.vmt_mangledname),0);
          reference_reset_symbol(href2,objectlibrary.newasmsymboldata(excepttype.vmt_mangledname),0);
          cg.a_paramaddr_ref(exprasmlist,href2,paramanager.getintparaloc(exprasmlist,1));
          cg.a_paramaddr_ref(exprasmlist,href2,paramanager.getintparaloc(exprasmlist,1));
-         cg.a_call_name(exprasmlist,'FPC_CATCHES');
          paramanager.freeintparaloc(exprasmlist,1);
          paramanager.freeintparaloc(exprasmlist,1);
+{$ifdef newra}
+         rg.allocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
+{$endif newra}
+         cg.a_call_name(exprasmlist,'FPC_CATCHES');
+{$ifdef newra}
+         rg.deallocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
+{$endif newra}
 
 
          { is it this catch? No. go to next onlabel }
          { is it this catch? No. go to next onlabel }
          r.enum:=R_INTREGISTER;
          r.enum:=R_INTREGISTER;
@@ -1209,10 +1293,22 @@ implementation
 
 
          try_free_exception(exprasmlist,tempbuf,tempaddr,href,0,doobjectdestroy,false);
          try_free_exception(exprasmlist,tempbuf,tempaddr,href,0,doobjectdestroy,false);
 
 
+{$ifdef newra}
+         rg.allocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
+{$endif newra}
          cg.a_call_name(exprasmlist,'FPC_POPSECONDOBJECTSTACK');
          cg.a_call_name(exprasmlist,'FPC_POPSECONDOBJECTSTACK');
+{$ifdef newra}
+         rg.deallocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
+{$endif newra}
          cg.a_param_reg(exprasmlist, OS_ADDR, r, paramanager.getintparaloc(exprasmlist,1));
          cg.a_param_reg(exprasmlist, OS_ADDR, r, paramanager.getintparaloc(exprasmlist,1));
-         cg.a_call_name(exprasmlist,'FPC_DESTROYEXCEPTION');
          paramanager.freeintparaloc(exprasmlist,1);
          paramanager.freeintparaloc(exprasmlist,1);
+{$ifdef newra}
+         rg.allocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
+{$endif newra}
+         cg.a_call_name(exprasmlist,'FPC_DESTROYEXCEPTION');
+{$ifdef newra}
+         rg.deallocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
+{$endif newra}
          { we don't need to restore esi here because reraise never }
          { we don't need to restore esi here because reraise never }
          { returns                                                 }
          { returns                                                 }
          cg.a_call_name(exprasmlist,'FPC_RERAISE');
          cg.a_call_name(exprasmlist,'FPC_RERAISE');
@@ -1443,7 +1539,11 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.72  2003-06-13 21:19:30  peter
+  Revision 1.73  2003-07-23 11:01:14  jonas
+    * several rg.allocexplicitregistersint/rg.deallocexplicitregistersint
+      pairs round calls to helpers
+
+  Revision 1.72  2003/06/13 21:19:30  peter
     * current_procdef removed, use current_procinfo.procdef instead
     * current_procdef removed, use current_procinfo.procdef instead
 
 
   Revision 1.71  2003/06/09 14:38:52  jonas
   Revision 1.71  2003/06/09 14:38:52  jonas

+ 12 - 2
compiler/ncginl.pas

@@ -207,11 +207,17 @@ implementation
        secondpass(tcallparanode(tcallparanode(left).right).left);
        secondpass(tcallparanode(tcallparanode(left).right).left);
        cg.a_paramaddr_ref(exprasmlist,tcallparanode(tcallparanode(left).right).left.location.reference,paramanager.getintparaloc(exprasmlist,1));
        cg.a_paramaddr_ref(exprasmlist,tcallparanode(tcallparanode(left).right).left.location.reference,paramanager.getintparaloc(exprasmlist,1));
        { call }
        { call }
-       cg.a_call_name(exprasmlist,'FPC_ASSERT');
        paramanager.freeintparaloc(exprasmlist,4);
        paramanager.freeintparaloc(exprasmlist,4);
        paramanager.freeintparaloc(exprasmlist,3);
        paramanager.freeintparaloc(exprasmlist,3);
        paramanager.freeintparaloc(exprasmlist,2);
        paramanager.freeintparaloc(exprasmlist,2);
        paramanager.freeintparaloc(exprasmlist,1);
        paramanager.freeintparaloc(exprasmlist,1);
+{$ifdef newra}
+       rg.allocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
+{$endif newra}
+       cg.a_call_name(exprasmlist,'FPC_ASSERT');
+{$ifdef newra}
+       rg.deallocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
+{$endif newra}
        cg.a_label(exprasmlist,truelabel);
        cg.a_label(exprasmlist,truelabel);
        truelabel:=otlabel;
        truelabel:=otlabel;
        falselabel:=oflabel;
        falselabel:=oflabel;
@@ -686,7 +692,11 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.38  2003-07-05 20:07:24  jonas
+  Revision 1.39  2003-07-23 11:01:14  jonas
+    * several rg.allocexplicitregistersint/rg.deallocexplicitregistersint
+      pairs round calls to helpers
+
+  Revision 1.38  2003/07/05 20:07:24  jonas
     * fixed range check errors
     * fixed range check errors
 
 
   Revision 1.37  2003/06/13 21:19:30  peter
   Revision 1.37  2003/06/13 21:19:30  peter

+ 26 - 5
compiler/ncgmem.pas

@@ -259,8 +259,14 @@ implementation
             (not tpointerdef(left.resulttype.def).is_far) then
             (not tpointerdef(left.resulttype.def).is_far) then
           begin
           begin
             cg.a_param_reg(exprasmlist, OS_ADDR,location.reference.base,paramanager.getintparaloc(exprasmlist,1));
             cg.a_param_reg(exprasmlist, OS_ADDR,location.reference.base,paramanager.getintparaloc(exprasmlist,1));
-            cg.a_call_name(exprasmlist,'FPC_CHECKPOINTER');
             paramanager.freeintparaloc(exprasmlist,1);
             paramanager.freeintparaloc(exprasmlist,1);
+{$ifdef newra}
+            rg.allocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
+{$endif newra}
+            cg.a_call_name(exprasmlist,'FPC_CHECKPOINTER');
+{$ifdef newra}
+            rg.deallocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
+{$endif newra}
           end;
           end;
       end;
       end;
 
 
@@ -307,8 +313,14 @@ implementation
                 not(cs_compilesystem in aktmoduleswitches) then
                 not(cs_compilesystem in aktmoduleswitches) then
               begin
               begin
                 cg.a_param_reg(exprasmlist, OS_ADDR,location.reference.base,paramanager.getintparaloc(exprasmlist,1));
                 cg.a_param_reg(exprasmlist, OS_ADDR,location.reference.base,paramanager.getintparaloc(exprasmlist,1));
-                cg.a_call_name(exprasmlist,'FPC_CHECKPOINTER');
                 paramanager.freeintparaloc(exprasmlist,1);
                 paramanager.freeintparaloc(exprasmlist,1);
+{$ifdef newra}
+                rg.allocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
+{$endif newra}
+                cg.a_call_name(exprasmlist,'FPC_CHECKPOINTER');
+{$ifdef newra}
+                rg.deallocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
+{$endif newra}
               end;
               end;
            end
            end
          else if is_interfacecom(left.resulttype.def) then
          else if is_interfacecom(left.resulttype.def) then
@@ -321,8 +333,14 @@ implementation
                 not(cs_compilesystem in aktmoduleswitches) then
                 not(cs_compilesystem in aktmoduleswitches) then
               begin
               begin
                 cg.a_param_reg(exprasmlist, OS_ADDR,location.reference.base,paramanager.getintparaloc(exprasmlist,1));
                 cg.a_param_reg(exprasmlist, OS_ADDR,location.reference.base,paramanager.getintparaloc(exprasmlist,1));
-                cg.a_call_name(exprasmlist,'FPC_CHECKPOINTER');
                 paramanager.freeintparaloc(exprasmlist,1);
                 paramanager.freeintparaloc(exprasmlist,1);
+{$ifdef newra}
+                rg.allocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
+{$endif newra}
+                cg.a_call_name(exprasmlist,'FPC_CHECKPOINTER');
+{$ifdef newra}
+                rg.allocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
+{$endif newra}
               end;
               end;
 
 
            end
            end
@@ -522,7 +540,6 @@ implementation
                cg.a_param_loc(exprasmlist,left.location,paramanager.getintparaloc(exprasmlist,1));
                cg.a_param_loc(exprasmlist,left.location,paramanager.getintparaloc(exprasmlist,1));
             {$ifdef newra}
             {$ifdef newra}
                rg.allocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
                rg.allocexplicitregistersint(exprasmlist,VOLATILE_INTREGISTERS);
-
             {$else}
             {$else}
                rg.saveintregvars(exprasmlist,VOLATILE_INTREGISTERS);
                rg.saveintregvars(exprasmlist,VOLATILE_INTREGISTERS);
             {$endif}
             {$endif}
@@ -881,7 +898,11 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.66  2003-07-06 21:50:33  jonas
+  Revision 1.67  2003-07-23 11:01:14  jonas
+    * several rg.allocexplicitregistersint/rg.deallocexplicitregistersint
+      pairs round calls to helpers
+
+  Revision 1.66  2003/07/06 21:50:33  jonas
     * fixed ppc compilation problems and changed VOLATILE_REGISTERS for x86
     * fixed ppc compilation problems and changed VOLATILE_REGISTERS for x86
       so that it doesn't include ebp and esp anymore
       so that it doesn't include ebp and esp anymore