2
0
Эх сурвалжийг харах

* fixed arg. area calculation

florian 21 жил өмнө
parent
commit
06a33abebd

+ 9 - 3
compiler/ncal.pas

@@ -2439,13 +2439,16 @@ type
          { calculate the parameter info for the procdef }
          { calculate the parameter info for the procdef }
          if not procdefinition.has_paraloc_info then
          if not procdefinition.has_paraloc_info then
            begin
            begin
-             paramanager.create_paraloc_info(procdefinition,callerside);
+             procdefinition.requiredargarea:=paramanager.create_paraloc_info(procdefinition,callerside);
              procdefinition.has_paraloc_info:=true;
              procdefinition.has_paraloc_info:=true;
            end;
            end;
 
 
+         current_procinfo.maxpushedparasize:=max(current_procinfo.maxpushedparasize,procdefinition.requiredargarea);
+
          { calculate the parameter info for varargs }
          { calculate the parameter info for varargs }
          if assigned(varargsparas) then
          if assigned(varargsparas) then
-           paramanager.create_varargs_paraloc_info(procdefinition,varargsparas);
+           current_procinfo.maxpushedparasize:=max(current_procinfo.maxpushedparasize,
+             paramanager.create_varargs_paraloc_info(procdefinition,varargsparas));
 
 
          { work trough all parameters to get the register requirements }
          { work trough all parameters to get the register requirements }
          if assigned(left) then
          if assigned(left) then
@@ -2716,7 +2719,10 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.225  2004-02-13 15:42:21  peter
+  Revision 1.226  2004-02-19 17:07:42  florian
+    * fixed arg. area calculation
+
+  Revision 1.225  2004/02/13 15:42:21  peter
     * compare_defs_ext has now a options argument
     * compare_defs_ext has now a options argument
     * fixes for variants
     * fixes for variants
 
 

+ 8 - 4
compiler/nobj.pas

@@ -623,7 +623,7 @@ implementation
                                { compare only if the definition is not hidden }
                                { compare only if the definition is not hidden }
                                if not procdefcoll^.hidden then
                                if not procdefcoll^.hidden then
                                 begin
                                 begin
-                                  { check that all methods have overload directive } 
+                                  { check that all methods have overload directive }
                                   if not(m_fpc in aktmodeswitches) and
                                   if not(m_fpc in aktmodeswitches) and
                                      (_class=pd._class) and
                                      (_class=pd._class) and
                                      (procdefcoll^.data._class=pd._class) and
                                      (procdefcoll^.data._class=pd._class) and
@@ -634,7 +634,7 @@ implementation
                                       include(procdefcoll^.data.procoptions,po_overload);
                                       include(procdefcoll^.data.procoptions,po_overload);
                                       include(pd.procoptions,po_overload);
                                       include(pd.procoptions,po_overload);
                                     end;
                                     end;
-                                    
+
                                   { check if one of the two methods has virtual }
                                   { check if one of the two methods has virtual }
                                   if (po_virtualmethod in procdefcoll^.data.procoptions) or
                                   if (po_virtualmethod in procdefcoll^.data.procoptions) or
                                      (po_virtualmethod in pd.procoptions) then
                                      (po_virtualmethod in pd.procoptions) then
@@ -1340,6 +1340,7 @@ implementation
          dataSegment.concat(Tai_symbol_end.Createname(_class.vmt_mangledname));
          dataSegment.concat(Tai_symbol_end.Createname(_class.vmt_mangledname));
       end;
       end;
 
 
+
   procedure tclassheader.adjustselfvalue(procdef: tprocdef;ioffset: aword);
   procedure tclassheader.adjustselfvalue(procdef: tprocdef;ioffset: aword);
     var
     var
       hsym : tsym;
       hsym : tsym;
@@ -1349,7 +1350,7 @@ implementation
       { calculate the parameter info for the procdef }
       { calculate the parameter info for the procdef }
       if not procdef.has_paraloc_info then
       if not procdef.has_paraloc_info then
         begin
         begin
-          paramanager.create_paraloc_info(procdef,callerside);
+          procdef.requiredargarea:=paramanager.create_paraloc_info(procdef,callerside);
           procdef.has_paraloc_info:=true;
           procdef.has_paraloc_info:=true;
         end;
         end;
       hsym:=tsym(procdef.parast.search('self'));
       hsym:=tsym(procdef.parast.search('self'));
@@ -1379,7 +1380,10 @@ initialization
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.61  2004-02-13 15:41:24  peter
+  Revision 1.62  2004-02-19 17:07:42  florian
+    * fixed arg. area calculation
+
+  Revision 1.61  2004/02/13 15:41:24  peter
     * overload directive checking for methods is now done
     * overload directive checking for methods is now done
       when the vmt is generated
       when the vmt is generated
 
 

+ 5 - 1
compiler/powerpc/cpupara.pas

@@ -406,6 +406,7 @@ unit cpupara;
          curfloatreg:=nextfloatreg;
          curfloatreg:=nextfloatreg;
          curmmreg:=nextmmreg;
          curmmreg:=nextmmreg;
          cur_stack_offset:=stack_offset;
          cur_stack_offset:=stack_offset;
+         result:=cur_stack_offset;
       end;
       end;
 
 
 
 
@@ -453,7 +454,10 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.58  2004-02-11 23:18:59  florian
+  Revision 1.59  2004-02-19 17:07:42  florian
+    * fixed arg. area calculation
+
+  Revision 1.58  2004/02/11 23:18:59  florian
     * fixed to compile the rtl again
     * fixed to compile the rtl again
 
 
   Revision 1.57  2004/01/17 15:55:11  jonas
   Revision 1.57  2004/01/17 15:55:11  jonas

+ 6 - 3
compiler/powerpc/cpupi.pas

@@ -36,8 +36,6 @@ unit cpupi;
        tppcprocinfo = class(tcgprocinfo)
        tppcprocinfo = class(tcgprocinfo)
           { offset where the frame pointer from the outer procedure is stored. }
           { offset where the frame pointer from the outer procedure is stored. }
           parent_framepointer_offset : longint;
           parent_framepointer_offset : longint;
-          { max. of space need for parameters, currently used by the PowerPC port only }
-          maxpushedparasize : aword;
           constructor create(aparent:tprocinfo);override;
           constructor create(aparent:tprocinfo);override;
           procedure set_first_temp_offset;override;
           procedure set_first_temp_offset;override;
           procedure allocate_push_parasize(size: longint);override;
           procedure allocate_push_parasize(size: longint);override;
@@ -75,6 +73,8 @@ unit cpupi;
                 ofs:=align(maxpushedparasize+LinkageAreaSizeAIX,16);
                 ofs:=align(maxpushedparasize+LinkageAreaSizeAIX,16);
               abi_powerpc_sysv:
               abi_powerpc_sysv:
                 ofs:=align(maxpushedparasize+LinkageAreaSizeSYSV,16);
                 ofs:=align(maxpushedparasize+LinkageAreaSizeSYSV,16);
+              else
+                internalerror(200402191);
             end;
             end;
             tg.setfirsttemp(ofs);
             tg.setfirsttemp(ofs);
           end
           end
@@ -145,7 +145,10 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.33  2003-12-29 14:17:50  jonas
+  Revision 1.34  2004-02-19 17:07:42  florian
+    * fixed arg. area calculation
+
+  Revision 1.33  2003/12/29 14:17:50  jonas
     * fixed saving/restoring of volatile fpu registers under sysv
     * fixed saving/restoring of volatile fpu registers under sysv
     + better provisions for abi differences regarding fpu registers that have
     + better provisions for abi differences regarding fpu registers that have
       to be saved
       to be saved

+ 7 - 1
compiler/procinfo.pas

@@ -93,6 +93,9 @@ unit procinfo;
           { Data (like jump tables) that belongs to this routine }
           { Data (like jump tables) that belongs to this routine }
           aktlocaldata : taasmoutput;
           aktlocaldata : taasmoutput;
 
 
+          { max. of space need for parameters }
+          maxpushedparasize : aword;
+
           constructor create(aparent:tprocinfo);virtual;
           constructor create(aparent:tprocinfo);virtual;
           destructor destroy;override;
           destructor destroy;override;
 
 
@@ -178,7 +181,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.11  2003-12-26 14:02:30  peter
+  Revision 1.12  2004-02-19 17:07:42  florian
+    * fixed arg. area calculation
+
+  Revision 1.11  2003/12/26 14:02:30  peter
     * sparc updates
     * sparc updates
     * use registertype in spill_register
     * use registertype in spill_register
 
 

+ 5 - 2
compiler/psub.pas

@@ -674,7 +674,7 @@ implementation
               code of the ppc (and possibly other processors)               }
               code of the ppc (and possibly other processors)               }
             if not procdef.has_paraloc_info then
             if not procdef.has_paraloc_info then
               begin
               begin
-                paramanager.create_paraloc_info(procdef,callerside);
+                procdef.requiredargarea:=paramanager.create_paraloc_info(procdef,callerside);
                 procdef.has_paraloc_info:=true;
                 procdef.has_paraloc_info:=true;
               end;
               end;
 
 
@@ -1345,7 +1345,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.185  2004-02-08 18:08:59  jonas
+  Revision 1.186  2004-02-19 17:07:42  florian
+    * fixed arg. area calculation
+
+  Revision 1.185  2004/02/08 18:08:59  jonas
     * fixed regvars support. Needs -doldregvars to activate. Only tested with
     * fixed regvars support. Needs -doldregvars to activate. Only tested with
       ppc, other processors should however only require maxregvars and
       ppc, other processors should however only require maxregvars and
       maxfpuregvars constants in cpubase.pas. Remember to take scratch-
       maxfpuregvars constants in cpubase.pas. Remember to take scratch-

+ 8 - 4
compiler/symdef.pas

@@ -443,6 +443,7 @@ interface
           proctypeoption  : tproctypeoption;
           proctypeoption  : tproctypeoption;
           proccalloption  : tproccalloption;
           proccalloption  : tproccalloption;
           procoptions     : tprocoptions;
           procoptions     : tprocoptions;
+          requiredargarea : aword;
           maxparacount,
           maxparacount,
           minparacount    : byte;
           minparacount    : byte;
 {$ifdef i386}
 {$ifdef i386}
@@ -5325,15 +5326,15 @@ implementation
                              internalerror(200402171);
                              internalerror(200402171);
                            inc(address,tvarsym(hp^.sym).fieldoffset);
                            inc(address,tvarsym(hp^.sym).fieldoffset);
                            def:=tvarsym(hp^.sym).vartype.def;
                            def:=tvarsym(hp^.sym).vartype.def;
-                         end;  
+                         end;
                        sl_vec :
                        sl_vec :
                          begin
                          begin
                            if not(assigned(def) and (def.deftype=arraydef)) then
                            if not(assigned(def) and (def.deftype=arraydef)) then
                              internalerror(200402172);
                              internalerror(200402172);
                            def:=tarraydef(def).elementtype.def;
                            def:=tarraydef(def).elementtype.def;
                            inc(address,def.size*hp^.value);
                            inc(address,def.size*hp^.value);
-                         end;  
-                     end;      
+                         end;
+                     end;
                      hp:=hp^.next;
                      hp:=hp^.next;
                   end;
                   end;
                 rttiList.concat(Tai_const.Create_32bit(address));
                 rttiList.concat(Tai_const.Create_32bit(address));
@@ -6117,7 +6118,10 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.219  2004-02-17 15:57:49  peter
+  Revision 1.220  2004-02-19 17:07:42  florian
+    * fixed arg. area calculation
+
+  Revision 1.219  2004/02/17 15:57:49  peter
   - fix rtti generation for properties containing sl_vec
   - fix rtti generation for properties containing sl_vec
   - fix crash when overloaded operator is not available
   - fix crash when overloaded operator is not available
   - fix record alignment for C style variant records
   - fix record alignment for C style variant records