Browse Source

* memory optimization (3-4%) : cleanup of tai fields,
cleanup of tdef and tsym fields.
* make it work for m68k

carl 23 years ago
parent
commit
64655be168

+ 9 - 8
compiler/aasmbase.pas

@@ -65,9 +65,7 @@ interface
          { pointer to objectdata that is the owner of this symbol }
          { pointer to objectdata that is the owner of this symbol }
          objectdata : pointer;
          objectdata : pointer;
          { pointer to the tai that is the owner of this symbol }
          { pointer to the tai that is the owner of this symbol }
-         taiowner : pointer;
-         { TRUE if the symbol is local for a procedure/function }
-         proclocal : boolean;
+{         taiowner : pointer;}
          { Is the symbol in the used list }
          { Is the symbol in the used list }
          inusedlist : boolean;
          inusedlist : boolean;
          { assembler pass label is set, used for detecting multiple labels }
          { assembler pass label is set, used for detecting multiple labels }
@@ -254,6 +252,7 @@ implementation
 
 
     procedure tasmsymbol.reset;
     procedure tasmsymbol.reset;
       begin
       begin
+{        WriteLn(ClassName,' InstanceSize :',InstanceSize);}
         { reset section info }
         { reset section info }
         section:=sec_none;
         section:=sec_none;
         address:=0;
         address:=0;
@@ -261,9 +260,8 @@ implementation
         indexnr:=-1;
         indexnr:=-1;
         pass:=255;
         pass:=255;
         currbind:=AB_EXTERNAL;
         currbind:=AB_EXTERNAL;
-        proclocal:=false;
         altsymbol:=nil;
         altsymbol:=nil;
-        taiowner:=nil;
+{        taiowner:=nil;}
       end;
       end;
 
 
 
 
@@ -313,7 +311,6 @@ implementation
       begin;
       begin;
         labelnr:=nr;
         labelnr:=nr;
         inherited create(target_asm.labelprefix+tostr(labelnr),AB_LOCAL,AT_FUNCTION);
         inherited create(target_asm.labelprefix+tostr(labelnr),AB_LOCAL,AT_FUNCTION);
-        proclocal:=true;
         is_set:=false;
         is_set:=false;
         is_addr := false;
         is_addr := false;
       end;
       end;
@@ -329,7 +326,6 @@ implementation
           inherited create(target_asm.labelprefix+tostr(labelnr),AB_LOCAL,AT_DATA);
           inherited create(target_asm.labelprefix+tostr(labelnr),AB_LOCAL,AT_DATA);
         is_set:=false;
         is_set:=false;
         is_addr := false;
         is_addr := false;
-        proclocal := false;
         { write it always }
         { write it always }
         increfs;
         increfs;
       end;
       end;
@@ -888,7 +884,12 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.11  2002-11-15 16:29:30  peter
+  Revision 1.12  2002-11-17 16:31:55  carl
+    * memory optimization (3-4%) : cleanup of tai fields,
+       cleanup of tdef and tsym fields.
+    * make it work for m68k
+
+  Revision 1.11  2002/11/15 16:29:30  peter
     * made tasmsymbol.refs private (merged)
     * made tasmsymbol.refs private (merged)
 
 
   Revision 1.10  2002/11/15 01:58:45  peter
   Revision 1.10  2002/11/15 01:58:45  peter

+ 99 - 32
compiler/aasmtai.pas

@@ -150,6 +150,20 @@ interface
 {$endif GDB}
 {$endif GDB}
                    ,ait_regalloc, ait_tempalloc, ait_symbol_end];
                    ,ait_regalloc, ait_tempalloc, ait_symbol_end];
 
 
+{ ait_* types which do not have line information (and hence which are of type
+  tai, otherwise, they are of type tailineinfo }
+{ ait_* types which do not have line information (and hence which are of type
+  tai, otherwise, they are of type tailineinfo }
+      SkipLineInfo =[ait_label,
+                     ait_regalloc,ait_tempalloc,
+{$ifdef GDB}
+                  ait_stabn,ait_stabs,ait_stab_function_name,
+{$endif GDB}
+                  ait_cut,ait_marker,ait_align,ait_section,ait_comment,
+                  ait_const_8bit,ait_const_16bit,ait_const_32bit,
+                  ait_real_32bit,ait_real_64bit,ait_real_80bit,ait_comp_64bit
+                  ];
+
 
 
     type
     type
        { cut type, required for alphanumeric ordering of the assembler filenames }
        { cut type, required for alphanumeric ordering of the assembler filenames }
@@ -159,13 +173,15 @@ interface
                   AsmBlockStart,AsmBlockEnd,
                   AsmBlockStart,AsmBlockEnd,
                   InlineStart,InlineEnd);
                   InlineStart,InlineEnd);
 
 
-       { the short name makes typing easier }
+       { Buffer type used for alignment }
+       tfillbuffer = array[0..63] of char;
+
+       { abstract assembler item }
        tai = class(TLinkedListItem)
        tai = class(TLinkedListItem)
 {$ifndef NOOPT}
 {$ifndef NOOPT}
           { pointer to record with optimizer info about this tai object }
           { pointer to record with optimizer info about this tai object }
           optinfo  : pointer;
           optinfo  : pointer;
 {$endif NOOPT}
 {$endif NOOPT}
-          fileinfo : tfileposinfo;
           typ      : taitype;
           typ      : taitype;
           constructor Create;
           constructor Create;
           constructor ppuload(t:taitype;ppufile:tcompilerppufile);virtual;
           constructor ppuload(t:taitype;ppufile:tcompilerppufile);virtual;
@@ -175,12 +191,21 @@ interface
           procedure checkredefinesym(sym:tasmsymbol);
           procedure checkredefinesym(sym:tasmsymbol);
        end;
        end;
 
 
+       { abstract assembler item with line information }
+       tailineinfo = class(tai)
+        fileinfo : tfileposinfo;
+        constructor Create;
+        constructor ppuload(t:taitype;ppufile:tcompilerppufile);override;
+        procedure ppuwrite(ppufile:tcompilerppufile);override;
+       end;
+    
+
        taiclass = class of tai;
        taiclass = class of tai;
 
 
        taiclassarray = array[taitype] of taiclass;
        taiclassarray = array[taitype] of taiclass;
 
 
        { Generates an assembler string }
        { Generates an assembler string }
-       tai_string = class(tai)
+       tai_string = class(tailineinfo)
           str : pchar;
           str : pchar;
           { extra len so the string can contain an \0 }
           { extra len so the string can contain an \0 }
           len : longint;
           len : longint;
@@ -194,7 +219,7 @@ interface
        end;
        end;
 
 
        { Generates a common label }
        { Generates a common label }
-       tai_symbol = class(tai)
+       tai_symbol = class(tailineinfo)
           is_global : boolean;
           is_global : boolean;
           sym       : tasmsymbol;
           sym       : tasmsymbol;
           size      : longint;
           size      : longint;
@@ -208,7 +233,7 @@ interface
           procedure derefimpl;override;
           procedure derefimpl;override;
        end;
        end;
 
 
-       tai_symbol_end = class(tai)
+       tai_symbol_end = class(tailineinfo)
           sym : tasmsymbol;
           sym : tasmsymbol;
           constructor Create(_sym:tasmsymbol);
           constructor Create(_sym:tasmsymbol);
           constructor Createname(const _name : string);
           constructor Createname(const _name : string);
@@ -228,7 +253,7 @@ interface
        end;
        end;
 
 
        { Directly output data to final assembler file }
        { Directly output data to final assembler file }
-       tai_direct = class(tai)
+       tai_direct = class(tailineinfo)
           str : pchar;
           str : pchar;
           constructor Create(_str : pchar);
           constructor Create(_str : pchar);
           destructor Destroy; override;
           destructor Destroy; override;
@@ -258,7 +283,7 @@ interface
 
 
 
 
        { Generates an uninitializised data block }
        { Generates an uninitializised data block }
-       tai_datablock = class(tai)
+       tai_datablock = class(tailineinfo)
           is_global : boolean;
           is_global : boolean;
           sym       : tasmsymbol;
           sym       : tasmsymbol;
           size      : longint;
           size      : longint;
@@ -280,7 +305,7 @@ interface
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
        end;
        end;
 
 
-       tai_const_symbol = class(tai)
+       tai_const_symbol = class(tailineinfo)
           sym    : tasmsymbol;
           sym    : tasmsymbol;
           offset : longint;
           offset : longint;
           constructor Create(_sym:tasmsymbol);
           constructor Create(_sym:tasmsymbol);
@@ -376,7 +401,7 @@ interface
 
 
        { Class template for assembler instructions
        { Class template for assembler instructions
        }
        }
-       taicpu_abstract = class(tai)
+       taicpu_abstract = class(tailineinfo)
        protected
        protected
           procedure ppuloadoper(ppufile:tcompilerppufile;var o:toper);virtual;abstract;
           procedure ppuloadoper(ppufile:tcompilerppufile;var o:toper);virtual;abstract;
           procedure ppuwriteoper(ppufile:tcompilerppufile;const o:toper);virtual;abstract;
           procedure ppuwriteoper(ppufile:tcompilerppufile;const o:toper);virtual;abstract;
@@ -411,7 +436,6 @@ interface
 
 
        { alignment for operator }
        { alignment for operator }
        tai_align_abstract = class(tai)
        tai_align_abstract = class(tai)
-          buf       : array[0..63] of char; { buf used for fill }
           aligntype : byte;   { 1 = no align, 2 = word align, 4 = dword align }
           aligntype : byte;   { 1 = no align, 2 = word align, 4 = dword align }
           fillsize  : byte;   { real size to fill }
           fillsize  : byte;   { real size to fill }
           fillop    : byte;   { value to fill with - optional }
           fillop    : byte;   { value to fill with - optional }
@@ -420,7 +444,7 @@ interface
           constructor Create_op(b: byte; _op: byte);
           constructor Create_op(b: byte; _op: byte);
           constructor ppuload(t:taitype;ppufile:tcompilerppufile);override;
           constructor ppuload(t:taitype;ppufile:tcompilerppufile);override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
-          function getfillbuf:pchar;virtual;
+          function calculatefillbuf(var buf : tfillbuffer):pchar;virtual;
        end;
        end;
 
 
        taasmoutput = class(tlinkedlist)
        taasmoutput = class(tlinkedlist)
@@ -512,7 +536,6 @@ uses
 
 
     constructor tai.Create;
     constructor tai.Create;
       begin
       begin
-        fileinfo:=aktfilepos;
 {$ifndef NOOPT}
 {$ifndef NOOPT}
         optinfo:=nil;
         optinfo:=nil;
 {$endif NOOPT}
 {$endif NOOPT}
@@ -522,7 +545,6 @@ uses
     constructor tai.ppuload(t:taitype;ppufile:tcompilerppufile);
     constructor tai.ppuload(t:taitype;ppufile:tcompilerppufile);
       begin
       begin
         typ:=t;
         typ:=t;
-        ppufile.getposinfo(fileinfo);
 {$ifndef NOOPT}
 {$ifndef NOOPT}
         optinfo:=nil;
         optinfo:=nil;
 {$endif}
 {$endif}
@@ -531,7 +553,6 @@ uses
 
 
     procedure tai.ppuwrite(ppufile:tcompilerppufile);
     procedure tai.ppuwrite(ppufile:tcompilerppufile);
       begin
       begin
-        ppufile.putposinfo(fileinfo);
       end;
       end;
 
 
 
 
@@ -542,13 +563,37 @@ uses
 
 
     procedure tai.checkredefinesym(sym:tasmsymbol);
     procedure tai.checkredefinesym(sym:tasmsymbol);
       begin
       begin
-        if assigned(sym.taiowner) then
+{        if assigned(sym.taiowner) then
          begin
          begin
            Message1(asmw_e_redefined_label,sym.name);
            Message1(asmw_e_redefined_label,sym.name);
-           MessagePos(tai(sym.taiowner).fileinfo,asmw_e_first_defined_label);
          end
          end
         else
         else
-         sym.taiowner:=self;
+         sym.taiowner:=self;}
+      end;
+
+
+{****************************************************************************
+                              TAILINEINFO
+ ****************************************************************************}
+
+    constructor tailineinfo.create;
+     begin
+       inherited create;
+       fileinfo:=aktfilepos;
+     end;
+
+
+    constructor tailineinfo.ppuload(t:taitype;ppufile:tcompilerppufile);
+      begin
+        inherited ppuload(t,ppufile);
+        ppufile.getposinfo(fileinfo);
+      end;
+
+
+    procedure tailineinfo.ppuwrite(ppufile:tcompilerppufile);
+      begin
+        inherited ppuwrite(ppufile);
+        ppufile.putposinfo(fileinfo);
       end;
       end;
 
 
 
 
@@ -588,7 +633,7 @@ uses
          inherited Create;
          inherited Create;
          typ:=ait_datablock;
          typ:=ait_datablock;
          sym:=objectlibrary.newasmsymboltype(_name,AB_LOCAL,AT_DATA);
          sym:=objectlibrary.newasmsymboltype(_name,AB_LOCAL,AT_DATA);
-         checkredefinesym(sym);
+{         checkredefinesym(sym);}
          { keep things aligned }
          { keep things aligned }
          if _size<=0 then
          if _size<=0 then
            _size:=4;
            _size:=4;
@@ -602,7 +647,7 @@ uses
          inherited Create;
          inherited Create;
          typ:=ait_datablock;
          typ:=ait_datablock;
          sym:=objectlibrary.newasmsymboltype(_name,AB_GLOBAL,AT_DATA);
          sym:=objectlibrary.newasmsymboltype(_name,AB_GLOBAL,AT_DATA);
-         checkredefinesym(sym);
+{         checkredefinesym(sym);}
          { keep things aligned }
          { keep things aligned }
          if _size<=0 then
          if _size<=0 then
            _size:=4;
            _size:=4;
@@ -644,7 +689,7 @@ uses
          inherited Create;
          inherited Create;
          typ:=ait_symbol;
          typ:=ait_symbol;
          sym:=_sym;
          sym:=_sym;
-         checkredefinesym(sym);
+{         checkredefinesym(sym);}
          size:=siz;
          size:=siz;
          is_global:=(sym.defbind=AB_GLOBAL);
          is_global:=(sym.defbind=AB_GLOBAL);
       end;
       end;
@@ -654,7 +699,7 @@ uses
          inherited Create;
          inherited Create;
          typ:=ait_symbol;
          typ:=ait_symbol;
          sym:=objectlibrary.newasmsymboltype(_name,AB_LOCAL,AT_FUNCTION);
          sym:=objectlibrary.newasmsymboltype(_name,AB_LOCAL,AT_FUNCTION);
-         checkredefinesym(sym);
+{         checkredefinesym(sym);}
          size:=siz;
          size:=siz;
          is_global:=false;
          is_global:=false;
       end;
       end;
@@ -664,7 +709,7 @@ uses
          inherited Create;
          inherited Create;
          typ:=ait_symbol;
          typ:=ait_symbol;
          sym:=objectlibrary.newasmsymboltype(_name,AB_GLOBAL,AT_FUNCTION);
          sym:=objectlibrary.newasmsymboltype(_name,AB_GLOBAL,AT_FUNCTION);
-         checkredefinesym(sym);
+{         checkredefinesym(sym);}
          size:=siz;
          size:=siz;
          is_global:=true;
          is_global:=true;
       end;
       end;
@@ -674,7 +719,7 @@ uses
          inherited Create;
          inherited Create;
          typ:=ait_symbol;
          typ:=ait_symbol;
          sym:=objectlibrary.newasmsymboltype(_name,AB_LOCAL,AT_DATA);
          sym:=objectlibrary.newasmsymboltype(_name,AB_LOCAL,AT_DATA);
-         checkredefinesym(sym);
+{         checkredefinesym(sym);}
          size:=siz;
          size:=siz;
          is_global:=false;
          is_global:=false;
       end;
       end;
@@ -684,7 +729,7 @@ uses
          inherited Create;
          inherited Create;
          typ:=ait_symbol;
          typ:=ait_symbol;
          sym:=objectlibrary.newasmsymboltype(_name,AB_GLOBAL,AT_DATA);
          sym:=objectlibrary.newasmsymboltype(_name,AB_GLOBAL,AT_DATA);
-         checkredefinesym(sym);
+{         checkredefinesym(sym);}
          size:=siz;
          size:=siz;
          is_global:=true;
          is_global:=true;
       end;
       end;
@@ -1077,7 +1122,7 @@ uses
         inherited Create;
         inherited Create;
         typ:=ait_label;
         typ:=ait_label;
         l:=_l;
         l:=_l;
-        checkredefinesym(l);
+{        checkredefinesym(l);}
         l.is_set:=true;
         l.is_set:=true;
         is_global:=(l.defbind=AB_GLOBAL);
         is_global:=(l.defbind=AB_GLOBAL);
       end;
       end;
@@ -1602,13 +1647,13 @@ uses
           fillsize:=0;
           fillsize:=0;
           fillop:=_op;
           fillop:=_op;
           use_op:=true;
           use_op:=true;
-          fillchar(buf,sizeof(buf),_op)
        end;
        end;
 
 
 
 
-     function tai_align_abstract.getfillbuf:pchar;
+     function tai_align_abstract.calculatefillbuf(var buf : tfillbuffer):pchar;
        begin
        begin
-         getfillbuf:=@buf;
+         fillchar(buf,high(buf),fillop);
+         calculatefillbuf:=pchar(@buf);
        end;
        end;
 
 
 
 
@@ -1636,17 +1681,39 @@ uses
 *****************************************************************************}
 *****************************************************************************}
 
 
     function taasmoutput.getlasttaifilepos : pfileposinfo;
     function taasmoutput.getlasttaifilepos : pfileposinfo;
+      var
+       hp : tlinkedlistitem;
       begin
       begin
+         getlasttaifilepos := nil;
          if assigned(last) then
          if assigned(last) then
-           getlasttaifilepos:=@tai(last).fileinfo
-         else
-           getlasttaifilepos:=nil;
+           begin
+              { find the last file information record }
+              if not (tai(last).typ in SkipLineInfo) then
+                 getlasttaifilepos:=@tailineinfo(last).fileinfo
+              else 
+               { go through list backwards to find the first entry 
+                 with line information
+               }
+               begin
+                 hp:=tai(last);
+                 while assigned(hp) and (tai(hp).typ in SkipLineInfo) do
+                    hp:=hp.Previous;
+                 { found entry }
+                 if assigned(hp) then
+                     getlasttaifilepos:=@tailineinfo(hp).fileinfo
+               end;
+           end;
       end;
       end;
 
 
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.12  2002-11-15 16:29:30  peter
+  Revision 1.13  2002-11-17 16:31:55  carl
+    * memory optimization (3-4%) : cleanup of tai fields,
+       cleanup of tdef and tsym fields.
+    * make it work for m68k
+
+  Revision 1.12  2002/11/15 16:29:30  peter
     * made tasmsymbol.refs private (merged)
     * made tasmsymbol.refs private (merged)
 
 
   Revision 1.11  2002/11/15 01:58:45  peter
   Revision 1.11  2002/11/15 01:58:45  peter

+ 24 - 23
compiler/aggas.pas

@@ -295,12 +295,6 @@ var
     procedure TGNUAssembler.WriteTree(p:TAAsmoutput);
     procedure TGNUAssembler.WriteTree(p:TAAsmoutput);
     const
     const
       allocstr : array[boolean] of string[10]=(' released',' allocated');
       allocstr : array[boolean] of string[10]=(' released',' allocated');
-      nolinetai =[ait_label,
-                  ait_regalloc,ait_tempalloc,
-{$ifdef GDB}
-                  ait_stabn,ait_stabs,ait_stab_function_name,
-{$endif GDB}
-                  ait_cut,ait_marker,ait_align,ait_section];
     type
     type
       t80bitarray = array[0..9] of byte;
       t80bitarray = array[0..9] of byte;
       t64bitarray = array[0..7] of byte;
       t64bitarray = array[0..7] of byte;
@@ -308,6 +302,7 @@ var
     var
     var
       ch       : char;
       ch       : char;
       hp       : tai;
       hp       : tai;
+      hp1      : tailineinfo; 
       consttyp : taitype;
       consttyp : taitype;
       s        : string;
       s        : string;
       found    : boolean;
       found    : boolean;
@@ -333,23 +328,24 @@ var
       hp:=tai(p.first);
       hp:=tai(p.first);
       while assigned(hp) do
       while assigned(hp) do
        begin
        begin
-         aktfilepos:=hp.fileinfo;
 
 
-         if not(hp.typ in nolinetai) then
+         if not(hp.typ in SkipLineInfo) then
           begin
           begin
+            hp1 := hp as tailineinfo;
+            aktfilepos:=hp1.fileinfo;
 {$ifdef GDB}
 {$ifdef GDB}
              { write stabs }
              { write stabs }
              if (cs_debuginfo in aktmoduleswitches) or
              if (cs_debuginfo in aktmoduleswitches) or
                 (cs_gdb_lineinfo in aktglobalswitches) then
                 (cs_gdb_lineinfo in aktglobalswitches) then
-               WriteFileLineInfo(hp.fileinfo);
+               WriteFileLineInfo(hp1.fileinfo);
 {$endif GDB}
 {$endif GDB}
              { no line info for inlined code }
              { no line info for inlined code }
              if do_line and (inlinelevel=0) then
              if do_line and (inlinelevel=0) then
               begin
               begin
                 { load infile }
                 { load infile }
-                if lastfileinfo.fileindex<>hp.fileinfo.fileindex then
+                if lastfileinfo.fileindex<>hp1.fileinfo.fileindex then
                  begin
                  begin
-                   infile:=current_module.sourcefiles.get_file(hp.fileinfo.fileindex);
+                   infile:=current_module.sourcefiles.get_file(hp1.fileinfo.fileindex);
                    if assigned(infile) then
                    if assigned(infile) then
                     begin
                     begin
                       { open only if needed !! }
                       { open only if needed !! }
@@ -357,7 +353,7 @@ var
                        infile.open;
                        infile.open;
                     end;
                     end;
                    { avoid unnecessary reopens of the same file !! }
                    { avoid unnecessary reopens of the same file !! }
-                   lastfileinfo.fileindex:=hp.fileinfo.fileindex;
+                   lastfileinfo.fileindex:=hp1.fileinfo.fileindex;
                    { be sure to change line !! }
                    { be sure to change line !! }
                    lastfileinfo.line:=-1;
                    lastfileinfo.line:=-1;
                  end;
                  end;
@@ -371,20 +367,20 @@ var
                        if assigned(lastinfile) then
                        if assigned(lastinfile) then
                          lastinfile.close;
                          lastinfile.close;
                      end;
                      end;
-                   if (hp.fileinfo.line<>lastfileinfo.line) and
-                      ((hp.fileinfo.line<infile.maxlinebuf) or (InlineLevel>0)) then
+                   if (hp1.fileinfo.line<>lastfileinfo.line) and
+                      ((hp1.fileinfo.line<infile.maxlinebuf) or (InlineLevel>0)) then
                      begin
                      begin
-                       if (hp.fileinfo.line<>0) and
-                          ((infile.linebuf^[hp.fileinfo.line]>=0) or (InlineLevel>0)) then
-                         AsmWriteLn(target_asm.comment+'['+tostr(hp.fileinfo.line)+'] '+
-                           fixline(infile.GetLineStr(hp.fileinfo.line)));
+                       if (hp1.fileinfo.line<>0) and
+                          ((infile.linebuf^[hp1.fileinfo.line]>=0) or (InlineLevel>0)) then
+                         AsmWriteLn(target_asm.comment+'['+tostr(hp1.fileinfo.line)+'] '+
+                           fixline(infile.GetLineStr(hp1.fileinfo.line)));
                        { set it to a negative value !
                        { set it to a negative value !
                        to make that is has been read already !! PM }
                        to make that is has been read already !! PM }
-                       if (infile.linebuf^[hp.fileinfo.line]>=0) then
-                         infile.linebuf^[hp.fileinfo.line]:=-infile.linebuf^[hp.fileinfo.line]-1;
+                       if (infile.linebuf^[hp1.fileinfo.line]>=0) then
+                         infile.linebuf^[hp1.fileinfo.line]:=-infile.linebuf^[hp1.fileinfo.line]-1;
                      end;
                      end;
                  end;
                  end;
-                lastfileinfo:=hp.fileinfo;
+                lastfileinfo:=hp1.fileinfo;
                 lastinfile:=infile;
                 lastinfile:=infile;
               end;
               end;
           end;
           end;
@@ -718,7 +714,7 @@ var
                   FillChar(stabslastfileinfo,sizeof(stabslastfileinfo),0);
                   FillChar(stabslastfileinfo,sizeof(stabslastfileinfo),0);
                   includecount:=0;
                   includecount:=0;
                   funcname:=nil;
                   funcname:=nil;
-                  WriteFileLineInfo(hp.fileinfo);
+                  WriteFileLineInfo(aktfilepos);
 {$endif GDB}
 {$endif GDB}
                   if lasTSec<>sec_none then
                   if lasTSec<>sec_none then
                     AsmWriteLn(ait_section2str(lasTSec));
                     AsmWriteLn(ait_section2str(lasTSec));
@@ -819,7 +815,12 @@ var
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.15  2002-11-15 01:58:45  peter
+  Revision 1.16  2002-11-17 16:31:55  carl
+    * memory optimization (3-4%) : cleanup of tai fields,
+       cleanup of tdef and tsym fields.
+    * make it work for m68k
+
+  Revision 1.15  2002/11/15 01:58:45  peter
     * merged changes from 1.0.7 up to 04-11
     * merged changes from 1.0.7 up to 04-11
       - -V option for generating bug report tracing
       - -V option for generating bug report tracing
       - more tracing for option parsing
       - more tracing for option parsing

+ 13 - 15
compiler/assemble.pas

@@ -191,7 +191,7 @@ Implementation
       finput,
       finput,
       gdb,
       gdb,
 {$endif GDB}
 {$endif GDB}
-      cpubase,aasmcpu
+      cpubase,cpuinfo,aasmcpu
       ;
       ;
 
 
     var
     var
@@ -1005,12 +1005,8 @@ Implementation
                (cs_gdb_lineinfo in aktglobalswitches)) then
                (cs_gdb_lineinfo in aktglobalswitches)) then
             begin
             begin
               if (objectalloc.currsec<>sec_none) and
               if (objectalloc.currsec<>sec_none) and
-                 not(hp.typ in  [
-                     ait_label,
-                     ait_regalloc,ait_tempalloc,
-                     ait_stabn,ait_stabs,ait_section,
-                     ait_cut,ait_marker,ait_align,ait_stab_function_name]) then
-               WriteFileLineInfo(hp.fileinfo);
+                 not(hp.typ in SkipLineInfo) then
+               WriteFileLineInfo(tailineinfo(hp).fileinfo);
             end;
             end;
 {$endif GDB}
 {$endif GDB}
            case hp.typ of
            case hp.typ of
@@ -1175,6 +1171,7 @@ Implementation
 
 
     function TInternalAssembler.TreePass2(hp:Tai):Tai;
     function TInternalAssembler.TreePass2(hp:Tai):Tai;
       var
       var
+        fillbuffer : tfillbuffer;
         InlineLevel,
         InlineLevel,
         l  : longint;
         l  : longint;
 {$ifdef i386}
 {$ifdef i386}
@@ -1192,12 +1189,8 @@ Implementation
                (cs_gdb_lineinfo in aktglobalswitches)) then
                (cs_gdb_lineinfo in aktglobalswitches)) then
             begin
             begin
               if (objectdata.currsec<>sec_none) and
               if (objectdata.currsec<>sec_none) and
-                 not(hp.typ in [
-                     ait_label,
-                     ait_regalloc,ait_tempalloc,
-                     ait_stabn,ait_stabs,ait_section,
-                     ait_cut,ait_marker,ait_align,ait_stab_function_name]) then
-               WriteFileLineInfo(hp.fileinfo);
+                 not(hp.typ in SkipLineInfo) then
+               WriteFileLineInfo(tailineinfo(hp).fileinfo);
             end;
             end;
 {$endif GDB}
 {$endif GDB}
            case hp.typ of
            case hp.typ of
@@ -1206,7 +1199,7 @@ Implementation
                  if objectdata.currsec=sec_bss then
                  if objectdata.currsec=sec_bss then
                    objectdata.alloc(Tai_align(hp).fillsize)
                    objectdata.alloc(Tai_align(hp).fillsize)
                  else
                  else
-                   objectdata.writebytes(Tai_align(hp).getfillbuf^,Tai_align(hp).fillsize);
+                   objectdata.writebytes(Tai_align(hp).calculatefillbuf(fillbuffer)^,Tai_align(hp).fillsize);
                end;
                end;
              ait_section :
              ait_section :
                begin
                begin
@@ -1621,7 +1614,12 @@ Implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.46  2002-11-15 01:58:46  peter
+  Revision 1.47  2002-11-17 16:31:55  carl
+    * memory optimization (3-4%) : cleanup of tai fields,
+       cleanup of tdef and tsym fields.
+    * make it work for m68k
+
+  Revision 1.46  2002/11/15 01:58:46  peter
     * merged changes from 1.0.7 up to 04-11
     * merged changes from 1.0.7 up to 04-11
       - -V option for generating bug report tracing
       - -V option for generating bug report tracing
       - more tracing for option parsing
       - more tracing for option parsing

+ 7 - 2
compiler/defbase.pas

@@ -1896,7 +1896,7 @@ implementation
                    else if (def_to=tdef(rec_tguid)) and
                    else if (def_to=tdef(rec_tguid)) and
                            (fromtreetype=typen) and
                            (fromtreetype=typen) and
                            is_interface(def_from) and
                            is_interface(def_from) and
-                           tobjectdef(def_from).isiidguidvalid then
+                           assigned(tobjectdef(def_from).iidguid) then
                      begin
                      begin
                        b:=1;
                        b:=1;
                        doconv:=tc_equal;
                        doconv:=tc_equal;
@@ -2040,7 +2040,12 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.25  2002-11-16 18:00:53  peter
+  Revision 1.26  2002-11-17 16:31:55  carl
+    * memory optimization (3-4%) : cleanup of tai fields,
+       cleanup of tdef and tsym fields.
+    * make it work for m68k
+
+  Revision 1.25  2002/11/16 18:00:53  peter
     * fix merged proc-procvar check
     * fix merged proc-procvar check
 
 
   Revision 1.24  2002/11/15 01:58:46  peter
   Revision 1.24  2002/11/15 01:58:46  peter

+ 7 - 2
compiler/gdb.pas

@@ -67,7 +67,7 @@ Const
        end;
        end;
 
 
        { insert a cut to split into several smaller files }
        { insert a cut to split into several smaller files }
-       tai_force_line = class(tai)
+       tai_force_line = class(tailineinfo)
           constructor Create;
           constructor Create;
        end;
        end;
 
 
@@ -233,7 +233,12 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.15  2002-08-12 15:08:39  carl
+  Revision 1.16  2002-11-17 16:31:56  carl
+    * memory optimization (3-4%) : cleanup of tai fields,
+       cleanup of tdef and tsym fields.
+    * make it work for m68k
+
+  Revision 1.15  2002/08/12 15:08:39  carl
     + stab register indexes for powerpc (moved from gdb to cpubase)
     + stab register indexes for powerpc (moved from gdb to cpubase)
     + tprocessor enumeration moved to cpuinfo
     + tprocessor enumeration moved to cpuinfo
     + linker in target_info is now a class
     + linker in target_info is now a class

+ 11 - 5
compiler/i386/aasmcpu.pas

@@ -130,7 +130,7 @@ interface
          reg       : tregister;
          reg       : tregister;
          constructor create(b:byte);
          constructor create(b:byte);
          constructor create_op(b: byte; _op: byte);
          constructor create_op(b: byte; _op: byte);
-         function getfillbuf:pchar;override;
+         function calculatefillbuf(var buf : tfillbuffer):pchar;override;
       end;
       end;
 
 
       taicpu = class(taicpu_abstract)
       taicpu = class(taicpu_abstract)
@@ -326,7 +326,7 @@ implementation
       end;
       end;
 
 
 
 
-    function tai_align.getfillbuf:pchar;
+    function tai_align.calculatefillbuf(var buf : tfillbuffer):pchar;
       const
       const
         alignarray:array[0..5] of string[8]=(
         alignarray:array[0..5] of string[8]=(
           #$8D#$B4#$26#$00#$00#$00#$00,
           #$8D#$B4#$26#$00#$00#$00#$00,
@@ -340,9 +340,10 @@ implementation
         bufptr : pchar;
         bufptr : pchar;
         j : longint;
         j : longint;
       begin
       begin
+        inherited calculatefillbuf(buf);
         if not use_op then
         if not use_op then
          begin
          begin
-           bufptr:=@buf;
+           bufptr:=pchar(@buf);
            while (fillsize>0) do
            while (fillsize>0) do
             begin
             begin
               for j:=0 to 5 do
               for j:=0 to 5 do
@@ -353,7 +354,7 @@ implementation
               dec(fillsize,length(alignarray[j]));
               dec(fillsize,length(alignarray[j]));
             end;
             end;
          end;
          end;
-        getfillbuf:=pchar(@buf);
+        calculatefillbuf:=pchar(@buf);
       end;
       end;
 
 
 
 
@@ -1874,7 +1875,12 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.7  2002-11-15 01:58:54  peter
+  Revision 1.8  2002-11-17 16:31:58  carl
+    * memory optimization (3-4%) : cleanup of tai fields,
+       cleanup of tdef and tsym fields.
+    * make it work for m68k
+
+  Revision 1.7  2002/11/15 01:58:54  peter
     * merged changes from 1.0.7 up to 04-11
     * merged changes from 1.0.7 up to 04-11
       - -V option for generating bug report tracing
       - -V option for generating bug report tracing
       - more tracing for option parsing
       - more tracing for option parsing

+ 21 - 20
compiler/i386/ag386int.pas

@@ -328,17 +328,12 @@ interface
     procedure T386IntelAssembler.WriteTree(p:TAAsmoutput);
     procedure T386IntelAssembler.WriteTree(p:TAAsmoutput);
     const
     const
       allocstr : array[boolean] of string[10]=(' released',' allocated');
       allocstr : array[boolean] of string[10]=(' released',' allocated');
-      nolinetai =[ait_label,
-                  ait_regalloc,ait_tempalloc,
-{$ifdef GDB}
-                  ait_stabn,ait_stabs,ait_stab_function_name,
-{$endif GDB}
-                  ait_cut,ait_marker,ait_align,ait_section];
     var
     var
       s,
       s,
       prefix,
       prefix,
       suffix   : string;
       suffix   : string;
       hp       : tai;
       hp       : tai;
+      hp1      : tailineinfo;
       counter,
       counter,
       lines,
       lines,
       InlineLevel : longint;
       InlineLevel : longint;
@@ -360,13 +355,14 @@ interface
       hp:=tai(p.first);
       hp:=tai(p.first);
       while assigned(hp) do
       while assigned(hp) do
        begin
        begin
-         if do_line and not(hp.typ in nolinetai) and
+         if do_line and not(hp.typ in SkipLineInfo) and
             not DoNotSplitLine then
             not DoNotSplitLine then
            begin
            begin
+              hp1:=hp as tailineinfo;
            { load infile }
            { load infile }
-             if lastfileinfo.fileindex<>hp.fileinfo.fileindex then
+             if lastfileinfo.fileindex<>hp1.fileinfo.fileindex then
               begin
               begin
-                infile:=current_module.sourcefiles.get_file(hp.fileinfo.fileindex);
+                infile:=current_module.sourcefiles.get_file(hp1.fileinfo.fileindex);
                 if assigned(infile) then
                 if assigned(infile) then
                  begin
                  begin
                    { open only if needed !! }
                    { open only if needed !! }
@@ -374,7 +370,7 @@ interface
                     infile.open;
                     infile.open;
                  end;
                  end;
                 { avoid unnecessary reopens of the same file !! }
                 { avoid unnecessary reopens of the same file !! }
-                lastfileinfo.fileindex:=hp.fileinfo.fileindex;
+                lastfileinfo.fileindex:=hp1.fileinfo.fileindex;
                 { be sure to change line !! }
                 { be sure to change line !! }
                 lastfileinfo.line:=-1;
                 lastfileinfo.line:=-1;
               end;
               end;
@@ -388,20 +384,20 @@ interface
                     if assigned(lastinfile) then
                     if assigned(lastinfile) then
                       lastinfile.close;
                       lastinfile.close;
                   end;
                   end;
-                if (hp.fileinfo.line<>lastfileinfo.line) and
-                   ((hp.fileinfo.line<infile.maxlinebuf) or (InlineLevel>0)) then
+                if (hp1.fileinfo.line<>lastfileinfo.line) and
+                   ((hp1.fileinfo.line<infile.maxlinebuf) or (InlineLevel>0)) then
                   begin
                   begin
-                    if (hp.fileinfo.line<>0) and
-                       ((infile.linebuf^[hp.fileinfo.line]>=0) or (InlineLevel>0)) then
-                      AsmWriteLn(target_asm.comment+'['+tostr(hp.fileinfo.line)+'] '+
-                        fixline(infile.GetLineStr(hp.fileinfo.line)));
+                    if (hp1.fileinfo.line<>0) and
+                       ((infile.linebuf^[hp1.fileinfo.line]>=0) or (InlineLevel>0)) then
+                      AsmWriteLn(target_asm.comment+'['+tostr(hp1.fileinfo.line)+'] '+
+                        fixline(infile.GetLineStr(hp1.fileinfo.line)));
                     { set it to a negative value !
                     { set it to a negative value !
                     to make that is has been read already !! PM }
                     to make that is has been read already !! PM }
-                    if (infile.linebuf^[hp.fileinfo.line]>=0) then
-                      infile.linebuf^[hp.fileinfo.line]:=-infile.linebuf^[hp.fileinfo.line]-1;
+                    if (infile.linebuf^[hp1.fileinfo.line]>=0) then
+                      infile.linebuf^[hp1.fileinfo.line]:=-infile.linebuf^[hp1.fileinfo.line]-1;
                   end;
                   end;
               end;
               end;
-             lastfileinfo:=hp.fileinfo;
+             lastfileinfo:=hp1.fileinfo;
              lastinfile:=infile;
              lastinfile:=infile;
            end;
            end;
          DoNotSplitLine:=false;
          DoNotSplitLine:=false;
@@ -844,7 +840,12 @@ initialization
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.29  2002-11-15 01:58:56  peter
+  Revision 1.30  2002-11-17 16:31:58  carl
+    * memory optimization (3-4%) : cleanup of tai fields,
+       cleanup of tdef and tsym fields.
+    * make it work for m68k
+
+  Revision 1.29  2002/11/15 01:58:56  peter
     * merged changes from 1.0.7 up to 04-11
     * merged changes from 1.0.7 up to 04-11
       - -V option for generating bug report tracing
       - -V option for generating bug report tracing
       - more tracing for option parsing
       - more tracing for option parsing

+ 22 - 23
compiler/i386/ag386nsm.pas

@@ -348,17 +348,10 @@ interface
     procedure T386NasmAssembler.WriteTree(p:taasmoutput);
     procedure T386NasmAssembler.WriteTree(p:taasmoutput);
     const
     const
       allocstr : array[boolean] of string[10]=(' released',' allocated');
       allocstr : array[boolean] of string[10]=(' released',' allocated');
-      nolinetai =[ait_label,
-                  ait_regalloc,ait_tempalloc,
-{$ifdef GDB}
-                  ait_stabn,ait_stabs,ait_stab_function_name,
-{$endif GDB}
-                  ait_cut,ait_marker,ait_align,ait_section];
     var
     var
       s : string;
       s : string;
-      {prefix,
-      suffix   : string; no need here }
       hp       : tai;
       hp       : tai;
+      hp1      : tailineinfo;
       counter,
       counter,
       lines,
       lines,
       i,j,l    : longint;
       i,j,l    : longint;
@@ -379,16 +372,17 @@ interface
       hp:=tai(p.first);
       hp:=tai(p.first);
       while assigned(hp) do
       while assigned(hp) do
        begin
        begin
-         aktfilepos:=hp.fileinfo;
 
 
-         if not(hp.typ in nolinetai) then
+         if not(hp.typ in SkipLineInfo) then
            begin
            begin
+             hp1:=hp as tailineinfo; 
+             aktfilepos:=hp1.fileinfo;
              if do_line then
              if do_line then
               begin
               begin
               { load infile }
               { load infile }
-                if lastfileinfo.fileindex<>hp.fileinfo.fileindex then
+                if lastfileinfo.fileindex<>hp1.fileinfo.fileindex then
                  begin
                  begin
-                   infile:=current_module.sourcefiles.get_file(hp.fileinfo.fileindex);
+                   infile:=current_module.sourcefiles.get_file(hp1.fileinfo.fileindex);
                    if assigned(infile) then
                    if assigned(infile) then
                     begin
                     begin
                       { open only if needed !! }
                       { open only if needed !! }
@@ -396,7 +390,7 @@ interface
                        infile.open;
                        infile.open;
                     end;
                     end;
                    { avoid unnecessary reopens of the same file !! }
                    { avoid unnecessary reopens of the same file !! }
-                   lastfileinfo.fileindex:=hp.fileinfo.fileindex;
+                   lastfileinfo.fileindex:=hp1.fileinfo.fileindex;
                    { be sure to change line !! }
                    { be sure to change line !! }
                    lastfileinfo.line:=-1;
                    lastfileinfo.line:=-1;
                  end;
                  end;
@@ -410,20 +404,20 @@ interface
                        if assigned(lastinfile) then
                        if assigned(lastinfile) then
                          lastinfile.close;
                          lastinfile.close;
                      end;
                      end;
-                   if (hp.fileinfo.line<>lastfileinfo.line) and
-                      ((hp.fileinfo.line<infile.maxlinebuf) or (InlineLevel>0)) then
+                   if (hp1.fileinfo.line<>lastfileinfo.line) and
+                      ((hp1.fileinfo.line<infile.maxlinebuf) or (InlineLevel>0)) then
                      begin
                      begin
-                       if (hp.fileinfo.line<>0) and
-                          ((infile.linebuf^[hp.fileinfo.line]>=0) or (InlineLevel>0)) then
-                         AsmWriteLn(target_asm.comment+'['+tostr(hp.fileinfo.line)+'] '+
-                           fixline(infile.GetLineStr(hp.fileinfo.line)));
+                       if (hp1.fileinfo.line<>0) and
+                          ((infile.linebuf^[hp1.fileinfo.line]>=0) or (InlineLevel>0)) then
+                         AsmWriteLn(target_asm.comment+'['+tostr(hp1.fileinfo.line)+'] '+
+                           fixline(infile.GetLineStr(hp1.fileinfo.line)));
                        { set it to a negative value !
                        { set it to a negative value !
                        to make that is has been read already !! PM }
                        to make that is has been read already !! PM }
-                       if (infile.linebuf^[hp.fileinfo.line]>=0) then
-                         infile.linebuf^[hp.fileinfo.line]:=-infile.linebuf^[hp.fileinfo.line]-1;
+                       if (infile.linebuf^[hp1.fileinfo.line]>=0) then
+                         infile.linebuf^[hp1.fileinfo.line]:=-infile.linebuf^[hp1.fileinfo.line]-1;
                      end;
                      end;
                  end;
                  end;
-                lastfileinfo:=hp.fileinfo;
+                lastfileinfo:=hp1.fileinfo;
                 lastinfile:=infile;
                 lastinfile:=infile;
               end;
               end;
            end;
            end;
@@ -899,7 +893,12 @@ initialization
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.27  2002-11-15 01:58:56  peter
+  Revision 1.28  2002-11-17 16:31:59  carl
+    * memory optimization (3-4%) : cleanup of tai fields,
+       cleanup of tdef and tsym fields.
+    * make it work for m68k
+
+  Revision 1.27  2002/11/15 01:58:56  peter
     * merged changes from 1.0.7 up to 04-11
     * merged changes from 1.0.7 up to 04-11
       - -V option for generating bug report tracing
       - -V option for generating bug report tracing
       - more tracing for option parsing
       - more tracing for option parsing

+ 10 - 2
compiler/i386/daopt386.pas

@@ -605,7 +605,10 @@ Begin
             new_one.next := foll;
             new_one.next := foll;
             prev.next := new_one;
             prev.next := new_one;
             foll.previous := new_one;
             foll.previous := new_one;
-            Tai(new_one).fileinfo := Tai(foll).fileinfo;
+            { shgould we update line information }
+            if (not (Tai(new_one).typ in SkipLineInfo)) and 
+               (not (Tai(foll).typ in SkipLineInfo)) then
+            Tailineinfo(new_one).fileinfo := Tailineinfo(foll).fileinfo;
           End;
           End;
       End
       End
     Else asml.Concat(new_one)
     Else asml.Concat(new_one)
@@ -2591,7 +2594,12 @@ End.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.43  2002-08-18 20:06:29  peter
+  Revision 1.44  2002-11-17 16:31:59  carl
+    * memory optimization (3-4%) : cleanup of tai fields,
+       cleanup of tdef and tsym fields.
+    * make it work for m68k
+
+  Revision 1.43  2002/08/18 20:06:29  peter
     * inlining is now also allowed in interface
     * inlining is now also allowed in interface
     * renamed write/load to ppuwrite/ppuload
     * renamed write/load to ppuwrite/ppuload
     * tnode storing in ppu
     * tnode storing in ppu

+ 0 - 1
compiler/msg/errore.msg

@@ -2031,7 +2031,6 @@ option_help_pages=11025_[
 **0*_Processor specific options:
 **0*_Processor specific options:
 3*1A<x>_output format:
 3*1A<x>_output format:
 3*2Aas_assemble using GNU AS
 3*2Aas_assemble using GNU AS
-3*2Aasaout_assemble using GNU AS for aout (Go32v1)
 3*2Anasmcoff_coff (Go32v2) file using Nasm
 3*2Anasmcoff_coff (Go32v2) file using Nasm
 3*2Anasmelf_elf32 (Linux) file using Nasm
 3*2Anasmelf_elf32 (Linux) file using Nasm
 3*2Anasmobj_obj file using Nasm
 3*2Anasmobj_obj file using Nasm

+ 1 - 1
compiler/msgidx.inc

@@ -629,7 +629,7 @@ const
   option_info=11024;
   option_info=11024;
   option_help_pages=11025;
   option_help_pages=11025;
 
 
-  MsgTxtSize = 35103;
+  MsgTxtSize = 35052;
 
 
   MsgIdxMax : array[1..20] of longint=(
   MsgIdxMax : array[1..20] of longint=(
     17,62,189,44,43,41,98,19,35,43,
     17,62,189,44,43,41,98,19,35,43,

+ 19 - 20
compiler/msgtxt.inc

@@ -795,59 +795,58 @@ const msgtxt : array[0..000146,1..240] of char=(
   '**0*_Processor specific options:'#010+
   '**0*_Processor specific options:'#010+
   '3*1A<x>_output format:'#010+
   '3*1A<x>_output format:'#010+
   '3*2Aas_assemble using GNU AS'#010+
   '3*2Aas_assemble using GNU AS'#010+
-  '3*2Aasaout_assemble using GNU AS for aout (Go32v1)'#010+
-  '3*2Anasmcoff_coff (Go32v','2) file using Nasm'#010+
-  '3*2Anasmelf_elf32 (Linux) file using Nasm'#010+
+  '3*2Anasmcoff_coff (Go32v2) file using Nasm'#010+
+  '3*2Anasmelf_elf32 (Linux) file u','sing Nasm'#010+
   '3*2Anasmobj_obj file using Nasm'#010+
   '3*2Anasmobj_obj file using Nasm'#010+
   '3*2Amasm_obj file using Masm (Microsoft)'#010+
   '3*2Amasm_obj file using Masm (Microsoft)'#010+
   '3*2Atasm_obj file using Tasm (Borland)'#010+
   '3*2Atasm_obj file using Tasm (Borland)'#010+
   '3*2Acoff_coff (Go32v2) using internal writer'#010+
   '3*2Acoff_coff (Go32v2) using internal writer'#010+
-  '3*2Apecoff_pecoff (Win','32) using internal writer'#010+
-  '3*1R<x>_assembler reading style:'#010+
+  '3*2Apecoff_pecoff (Win32) using internal writer'#010+
+  '3*1R<x>_assembler reading',' style:'#010+
   '3*2Ratt_read AT&T style assembler'#010+
   '3*2Ratt_read AT&T style assembler'#010+
   '3*2Rintel_read Intel style assembler'#010+
   '3*2Rintel_read Intel style assembler'#010+
   '3*2Rdirect_copy assembler text directly to assembler file'#010+
   '3*2Rdirect_copy assembler text directly to assembler file'#010+
   '3*1O<x>_optimizations:'#010+
   '3*1O<x>_optimizations:'#010+
   '3*2Og_generate smaller code'#010+
   '3*2Og_generate smaller code'#010+
-  '3','*2OG_generate faster code (default)'#010+
-  '3*2Or_keep certain variables in registers'#010+
+  '3*2OG_generate faster code (default)'#010+
+  '3*2Or_keep cert','ain variables in registers'#010+
   '3*2Ou_enable uncertain optimizations (see docs)'#010+
   '3*2Ou_enable uncertain optimizations (see docs)'#010+
   '3*2O1_level 1 optimizations (quick optimizations)'#010+
   '3*2O1_level 1 optimizations (quick optimizations)'#010+
   '3*2O2_level 2 optimizations (-O1 + slower optimizations)'#010+
   '3*2O2_level 2 optimizations (-O1 + slower optimizations)'#010+
-  '3*2O3_l','evel 3 optimizations (-O2 repeatedly, max 5 times)'#010+
+  '3*2O3_level 3 optimizations (-O2 repeatedly, max 5 times)'#010,
   '3*2Op<x>_target processor:'#010+
   '3*2Op<x>_target processor:'#010+
   '3*3Op1_set target processor to 386/486'#010+
   '3*3Op1_set target processor to 386/486'#010+
   '3*3Op2_set target processor to Pentium/PentiumMMX (tm)'#010+
   '3*3Op2_set target processor to Pentium/PentiumMMX (tm)'#010+
   '3*3Op3_set target processor to PPro/PII/c6x86/K6 (tm)'#010+
   '3*3Op3_set target processor to PPro/PII/c6x86/K6 (tm)'#010+
-  '3*1T<x>_Target',' operating system:'#010+
-  '3*2TGO32V2_version 2 of DJ Delorie DOS extender'#010+
+  '3*1T<x>_Target operating system:'#010+
+  '3*2TGO32V2_version 2 of DJ Delor','ie DOS extender'#010+
   '3*2TWDOSX DOS 32 Bit Extender'#010+
   '3*2TWDOSX DOS 32 Bit Extender'#010+
   '3*2TLINUX_Linux'#010+
   '3*2TLINUX_Linux'#010+
   '3*2Tnetware_Novell Netware Module (experimental)'#010+
   '3*2Tnetware_Novell Netware Module (experimental)'#010+
   '3*2TOS2_OS/2 2.x'#010+
   '3*2TOS2_OS/2 2.x'#010+
   '3*2TSUNOS_SunOS/Solaris'#010+
   '3*2TSUNOS_SunOS/Solaris'#010+
   '3*2TWin32_Windows 32 Bit'#010+
   '3*2TWin32_Windows 32 Bit'#010+
-  '3*1W<x>_Win3','2 target options'#010+
-  '3*2WB<x>_Set Image base to Hexadecimal <x> value'#010+
+  '3*1W<x>_Win32 target options'#010+
+  '3*2WB<x>_Set Image base to Hexadec','imal <x> value'#010+
   '3*2WC_Specify console type application'#010+
   '3*2WC_Specify console type application'#010+
   '3*2WD_Use DEFFILE to export functions of DLL or EXE'#010+
   '3*2WD_Use DEFFILE to export functions of DLL or EXE'#010+
   '3*2WF_Specify full-screen type application (OS/2 only)'#010+
   '3*2WF_Specify full-screen type application (OS/2 only)'#010+
-  '3*2WG_Specify graphic type a','pplication'#010+
-  '3*2WN_Do not generate relocation code (necessary for debugging)'#010+
+  '3*2WG_Specify graphic type application'#010+
+  '3*2WN_Do not generate relocation code (n','ecessary for debugging)'#010+
   '3*2WR_Generate relocation code'#010+
   '3*2WR_Generate relocation code'#010+
   '6*1A<x>_output format'#010+
   '6*1A<x>_output format'#010+
   '6*2Aas_Unix o-file using GNU AS'#010+
   '6*2Aas_Unix o-file using GNU AS'#010+
   '6*2Agas_GNU Motorola assembler'#010+
   '6*2Agas_GNU Motorola assembler'#010+
   '6*2Amit_MIT Syntax (old GAS)'#010+
   '6*2Amit_MIT Syntax (old GAS)'#010+
-  '6*2Amot_Standard Mot','orola assembler'#010+
+  '6*2Amot_Standard Motorola assembler'#010+
   '6*1O_optimizations:'#010+
   '6*1O_optimizations:'#010+
-  '6*2Oa_turn on the optimizer'#010+
+  '6*2Oa_turn on t','he optimizer'#010+
   '6*2Og_generate smaller code'#010+
   '6*2Og_generate smaller code'#010+
   '6*2OG_generate faster code (default)'#010+
   '6*2OG_generate faster code (default)'#010+
   '6*2Ox_optimize maximum (still BUGGY!!!)'#010+
   '6*2Ox_optimize maximum (still BUGGY!!!)'#010+
   '6*2O0_set target processor to a MC68000'#010+
   '6*2O0_set target processor to a MC68000'#010+
-  '6*2O2_set target processor to a',' MC68020+ (default)'#010+
-  '6*1R<x>_assembler reading style:'#010+
+  '6*2O2_set target processor to a MC68020+ (default)'#010+
+  '6*1R<x>_assembler reading style',':'#010+
   '6*2RMOT_read motorola style assembler'#010+
   '6*2RMOT_read motorola style assembler'#010+
   '6*1T<x>_Target operating system:'#010+
   '6*1T<x>_Target operating system:'#010+
   '6*2TAMIGA_Commodore Amiga'#010+
   '6*2TAMIGA_Commodore Amiga'#010+
@@ -855,7 +854,7 @@ const msgtxt : array[0..000146,1..240] of char=(
   '6*2TMACOS_Macintosh m68k'#010+
   '6*2TMACOS_Macintosh m68k'#010+
   '6*2TLINUX_Linux-68k'#010+
   '6*2TLINUX_Linux-68k'#010+
   '6*2TPALMOS_PalmOS'#010+
   '6*2TPALMOS_PalmOS'#010+
-  '*','*1*_'#010+
+  '**1*_'#010+
   '**1?_shows this help'#010+
   '**1?_shows this help'#010+
-  '**1h_shows this help without waiting'#000
+  '**1h_shows this help with','out waiting'#000
 );
 );

+ 7 - 2
compiler/ncgbas.pas

@@ -110,7 +110,7 @@ interface
 
 
       procedure ReLabel(var p:tasmsymbol);
       procedure ReLabel(var p:tasmsymbol);
         begin
         begin
-          if p.proclocal then
+          if p.defbind = AB_LOCAL then
            begin
            begin
              if not assigned(p.altsymbol) then
              if not assigned(p.altsymbol) then
                objectlibrary.GenerateAltSymbol(p);
                objectlibrary.GenerateAltSymbol(p);
@@ -288,7 +288,12 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.25  2002-11-15 16:29:30  peter
+  Revision 1.26  2002-11-17 16:31:56  carl
+    * memory optimization (3-4%) : cleanup of tai fields,
+       cleanup of tdef and tsym fields.
+    * make it work for m68k
+
+  Revision 1.25  2002/11/15 16:29:30  peter
     * made tasmsymbol.refs private (merged)
     * made tasmsymbol.refs private (merged)
 
 
   Revision 1.24  2002/11/15 01:58:51  peter
   Revision 1.24  2002/11/15 01:58:51  peter

+ 7 - 2
compiler/ncgutil.pas

@@ -1417,7 +1417,7 @@ implementation
          begin
          begin
            { Align, gprof uses 16 byte granularity }
            { Align, gprof uses 16 byte granularity }
            if (cs_profile in aktmoduleswitches) then
            if (cs_profile in aktmoduleswitches) then
-            stackalloclist.concat(Tai_align.Create_op(16,$90))
+            stackalloclist.concat(Tai_align.Create(16))
            else
            else
             stackalloclist.concat(Tai_align.Create(aktalignment.procalign));
             stackalloclist.concat(Tai_align.Create(aktalignment.procalign));
 
 
@@ -1867,7 +1867,12 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.59  2002-11-15 01:58:51  peter
+  Revision 1.60  2002-11-17 16:31:56  carl
+    * memory optimization (3-4%) : cleanup of tai fields,
+       cleanup of tdef and tsym fields.
+    * make it work for m68k
+
+  Revision 1.59  2002/11/15 01:58:51  peter
     * merged changes from 1.0.7 up to 04-11
     * merged changes from 1.0.7 up to 04-11
       - -V option for generating bug report tracing
       - -V option for generating bug report tracing
       - more tracing for option parsing
       - more tracing for option parsing

+ 10 - 5
compiler/ncnv.pas

@@ -858,8 +858,8 @@ implementation
     function ttypeconvnode.resulttype_interface_to_guid : tnode;
     function ttypeconvnode.resulttype_interface_to_guid : tnode;
 
 
       begin
       begin
-        if tobjectdef(left.resulttype.def).isiidguidvalid then
-          result:=cguidconstnode.create(tobjectdef(left.resulttype.def).iidguid);
+        if assigned(tobjectdef(left.resulttype.def).iidguid) then
+          result:=cguidconstnode.create(tobjectdef(left.resulttype.def).iidguid^);
       end;
       end;
 
 
 
 
@@ -2026,9 +2026,9 @@ implementation
             { load the GUID of the interface }
             { load the GUID of the interface }
             if (right.nodetype=typen) then
             if (right.nodetype=typen) then
              begin
              begin
-               if tobjectdef(right.resulttype.def).isiidguidvalid then
+               if assigned(tobjectdef(right.resulttype.def).iidguid) then
                  begin
                  begin
-                   hp:=cguidconstnode.create(tobjectdef(right.resulttype.def).iidguid);
+                   hp:=cguidconstnode.create(tobjectdef(right.resulttype.def).iidguid^);
                    right.free;
                    right.free;
                    right:=hp;
                    right:=hp;
                  end
                  end
@@ -2098,7 +2098,12 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.87  2002-10-10 16:07:57  florian
+  Revision 1.88  2002-11-17 16:31:56  carl
+    * memory optimization (3-4%) : cleanup of tai fields,
+       cleanup of tdef and tsym fields.
+    * make it work for m68k
+
+  Revision 1.87  2002/10/10 16:07:57  florian
     + several widestring/pwidechar related stuff added
     + several widestring/pwidechar related stuff added
 
 
   Revision 1.86  2002/10/06 16:10:23  florian
   Revision 1.86  2002/10/06 16:10:23  florian

+ 17 - 12
compiler/nobj.pas

@@ -859,11 +859,11 @@ implementation
             objectlibrary.getdatalabel(tmplabel);
             objectlibrary.getdatalabel(tmplabel);
             rawdata.concat(tai_align.create(const_align(pointer_size)));
             rawdata.concat(tai_align.create(const_align(pointer_size)));
             rawdata.concat(Tai_label.Create(tmplabel));
             rawdata.concat(Tai_label.Create(tmplabel));
-            rawdata.concat(Tai_const.Create_32bit(curintf.iidguid.D1));
-            rawdata.concat(Tai_const.Create_16bit(curintf.iidguid.D2));
-            rawdata.concat(Tai_const.Create_16bit(curintf.iidguid.D3));
-            for i:=Low(curintf.iidguid.D4) to High(curintf.iidguid.D4) do
-              rawdata.concat(Tai_const.Create_8bit(curintf.iidguid.D4[i]));
+            rawdata.concat(Tai_const.Create_32bit(curintf.iidguid^.D1));
+            rawdata.concat(Tai_const.Create_16bit(curintf.iidguid^.D2));
+            rawdata.concat(Tai_const.Create_16bit(curintf.iidguid^.D3));
+            for i:=Low(curintf.iidguid^.D4) to High(curintf.iidguid^.D4) do
+              rawdata.concat(Tai_const.Create_8bit(curintf.iidguid^.D4[i]));
             dataSegment.concat(Tai_const_symbol.Create(tmplabel));
             dataSegment.concat(Tai_const_symbol.Create(tmplabel));
           end
           end
         else
         else
@@ -1114,16 +1114,16 @@ implementation
     var
     var
       i: longint;
       i: longint;
     begin
     begin
-      if _class.isiidguidvalid then
+      if assigned(_class.iidguid) then
         begin
         begin
           if (cs_create_smart in aktmoduleswitches) then
           if (cs_create_smart in aktmoduleswitches) then
             dataSegment.concat(Tai_cut.Create);
             dataSegment.concat(Tai_cut.Create);
           dataSegment.concat(Tai_symbol.Createname_global(mangledname_prefix('IID',_class.owner)+_class.objname^,0));
           dataSegment.concat(Tai_symbol.Createname_global(mangledname_prefix('IID',_class.owner)+_class.objname^,0));
-          dataSegment.concat(Tai_const.Create_32bit(longint(_class.iidguid.D1)));
-          dataSegment.concat(Tai_const.Create_16bit(_class.iidguid.D2));
-          dataSegment.concat(Tai_const.Create_16bit(_class.iidguid.D3));
-          for i:=Low(_class.iidguid.D4) to High(_class.iidguid.D4) do
-            dataSegment.concat(Tai_const.Create_8bit(_class.iidguid.D4[i]));
+          dataSegment.concat(Tai_const.Create_32bit(longint(_class.iidguid^.D1)));
+          dataSegment.concat(Tai_const.Create_16bit(_class.iidguid^.D2));
+          dataSegment.concat(Tai_const.Create_16bit(_class.iidguid^.D3));
+          for i:=Low(_class.iidguid^.D4) to High(_class.iidguid^.D4) do
+            dataSegment.concat(Tai_const.Create_8bit(_class.iidguid^.D4[i]));
         end;
         end;
       if (cs_create_smart in aktmoduleswitches) then
       if (cs_create_smart in aktmoduleswitches) then
         dataSegment.concat(Tai_cut.Create);
         dataSegment.concat(Tai_cut.Create);
@@ -1333,7 +1333,12 @@ initialization
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.36  2002-11-15 01:58:52  peter
+  Revision 1.37  2002-11-17 16:31:56  carl
+    * memory optimization (3-4%) : cleanup of tai fields,
+       cleanup of tdef and tsym fields.
+    * make it work for m68k
+
+  Revision 1.36  2002/11/15 01:58:52  peter
     * merged changes from 1.0.7 up to 04-11
     * merged changes from 1.0.7 up to 04-11
       - -V option for generating bug report tracing
       - -V option for generating bug report tracing
       - more tracing for option parsing
       - more tracing for option parsing

+ 11 - 4
compiler/pdecl.pas

@@ -129,10 +129,10 @@ implementation
              begin
              begin
                if is_interface(p.resulttype.def) then
                if is_interface(p.resulttype.def) then
                 begin
                 begin
-                  if tobjectdef(p.resulttype.def).isiidguidvalid then
+                  if assigned(tobjectdef(p.resulttype.def).iidguid) then
                    begin
                    begin
                      new(pg);
                      new(pg);
-                     pg^:=tobjectdef(p.resulttype.def).iidguid;
+                     pg^:=tobjectdef(p.resulttype.def).iidguid^;
                      hp:=tconstsym.create_ptr(orgname,constguid,pg);
                      hp:=tconstsym.create_ptr(orgname,constguid,pg);
                    end
                    end
                   else
                   else
@@ -316,7 +316,9 @@ implementation
                     akttokenpos:=tforwarddef(hpd).forwardpos;
                     akttokenpos:=tforwarddef(hpd).forwardpos;
                     resolving_forward:=true;
                     resolving_forward:=true;
                     make_ref:=false;
                     make_ref:=false;
-                    searchsym(tforwarddef(hpd).tosymname,srsym,srsymtable);
+                    if not assigned(tforwarddef(hpd).tosymname) then
+                      internalerror(20021120);
+                    searchsym(tforwarddef(hpd).tosymname^,srsym,srsymtable);
                     make_ref:=true;
                     make_ref:=true;
                     resolving_forward:=false;
                     resolving_forward:=false;
                     akttokenpos:=stpos;
                     akttokenpos:=stpos;
@@ -624,7 +626,12 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.58  2002-11-15 16:29:30  peter
+  Revision 1.59  2002-11-17 16:31:56  carl
+    * memory optimization (3-4%) : cleanup of tai fields,
+       cleanup of tdef and tsym fields.
+    * make it work for m68k
+
+  Revision 1.58  2002/11/15 16:29:30  peter
     * made tasmsymbol.refs private (merged)
     * made tasmsymbol.refs private (merged)
 
 
   Revision 1.57  2002/10/20 15:34:16  peter
   Revision 1.57  2002/10/20 15:34:16  peter

+ 17 - 4
compiler/pdecobj.pas

@@ -779,7 +779,14 @@ implementation
             if aktclass.implementedinterfaces.searchintf(implintf)<>-1 then
             if aktclass.implementedinterfaces.searchintf(implintf)<>-1 then
               Message1(sym_e_duplicate_id,implintf.name)
               Message1(sym_e_duplicate_id,implintf.name)
             else
             else
-              aktclass.implementedinterfaces.addintf(implintf);
+              begin
+                 { allocate and prepare the GUID only if the class 
+                   implements some interfaces. 
+                 }
+                 if aktclass.implementedinterfaces.count = 0 then
+                   aktclass.prepareguid;
+                 aktclass.implementedinterfaces.addintf(implintf);
+              end;
         end;
         end;
 
 
       procedure readimplementedinterfaces;
       procedure readimplementedinterfaces;
@@ -801,6 +808,7 @@ implementation
       procedure readinterfaceiid;
       procedure readinterfaceiid;
         var
         var
           p : tnode;
           p : tnode;
+          valid : boolean;
         begin
         begin
           p:=comp_expr(true);
           p:=comp_expr(true);
           if p.nodetype=stringconstn then
           if p.nodetype=stringconstn then
@@ -808,8 +816,8 @@ implementation
               stringdispose(aktclass.iidstr);
               stringdispose(aktclass.iidstr);
               aktclass.iidstr:=stringdup(strpas(tstringconstnode(p).value_str)); { or upper? }
               aktclass.iidstr:=stringdup(strpas(tstringconstnode(p).value_str)); { or upper? }
               p.free;
               p.free;
-              aktclass.isiidguidvalid:=string2guid(aktclass.iidstr^,aktclass.iidguid);
-              if (classtype=odt_interfacecom) and not aktclass.isiidguidvalid then
+              valid:=string2guid(aktclass.iidstr^,aktclass.iidguid^);
+              if (classtype=odt_interfacecom) and not assigned(aktclass.iidguid) and not valid then
                 Message(parser_e_improper_guid_syntax);
                 Message(parser_e_improper_guid_syntax);
             end
             end
           else
           else
@@ -1161,7 +1169,12 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.55  2002-10-05 12:43:25  carl
+  Revision 1.56  2002-11-17 16:31:56  carl
+    * memory optimization (3-4%) : cleanup of tai fields,
+       cleanup of tdef and tsym fields.
+    * make it work for m68k
+
+  Revision 1.55  2002/10/05 12:43:25  carl
     * fixes for Delphi 6 compilation
     * fixes for Delphi 6 compilation
      (warning : Some features do not work under Delphi)
      (warning : Some features do not work under Delphi)
 
 

+ 6 - 6
compiler/pdecsub.pas

@@ -827,7 +827,6 @@ end;
 procedure pd_asmname;
 procedure pd_asmname;
 begin
 begin
   aktprocdef.setmangledname(target_info.Cprefix+pattern);
   aktprocdef.setmangledname(target_info.Cprefix+pattern);
-  aktprocdef.has_mangledname:=true;
   if token=_CCHAR then
   if token=_CCHAR then
     consume(_CCHAR)
     consume(_CCHAR)
   else
   else
@@ -1036,7 +1035,6 @@ begin
          consume(_NAME);
          consume(_NAME);
          import_name:=get_stringconst;
          import_name:=get_stringconst;
          aktprocdef.setmangledname(import_name);
          aktprocdef.setmangledname(import_name);
-         aktprocdef.has_mangledname:=true;
        end;
        end;
     end;
     end;
 end;
 end;
@@ -1898,7 +1896,6 @@ const
                         MessagePos(aprocdef.fileinfo,parser_e_call_convention_dont_match_forward);
                         MessagePos(aprocdef.fileinfo,parser_e_call_convention_dont_match_forward);
                       { restore interface settings }
                       { restore interface settings }
                       aprocdef.proccalloption:=hd.proccalloption;
                       aprocdef.proccalloption:=hd.proccalloption;
-                      aprocdef.has_mangledname:=hd.has_mangledname;
                       if hd.has_mangledname then
                       if hd.has_mangledname then
                         aprocdef.setmangledname(hd.mangledname);
                         aprocdef.setmangledname(hd.mangledname);
                     end;
                     end;
@@ -1949,8 +1946,6 @@ const
                     begin
                     begin
                       { rename also asmsymbol first, because the name can already be used }
                       { rename also asmsymbol first, because the name can already be used }
                       objectlibrary.renameasmsymbol(hd.mangledname,aprocdef.mangledname);
                       objectlibrary.renameasmsymbol(hd.mangledname,aprocdef.mangledname);
-                      { update the mangledname }
-                      hd.has_mangledname:=true;
                       hd.setmangledname(aprocdef.mangledname);
                       hd.setmangledname(aprocdef.mangledname);
                     end;
                     end;
                    { for compilerproc defines we need to rename and update the
                    { for compilerproc defines we need to rename and update the
@@ -2059,7 +2054,12 @@ const
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.79  2002-11-16 14:20:50  peter
+  Revision 1.80  2002-11-17 16:31:56  carl
+    * memory optimization (3-4%) : cleanup of tai fields,
+       cleanup of tdef and tsym fields.
+    * make it work for m68k
+
+  Revision 1.79  2002/11/16 14:20:50  peter
     * fix infinite loop in pd_inline
     * fix infinite loop in pd_inline
 
 
   Revision 1.78  2002/11/15 01:58:53  peter
   Revision 1.78  2002/11/15 01:58:53  peter

+ 21 - 22
compiler/powerpc/agppcmpw.pas

@@ -484,19 +484,12 @@ function getreferencestring(var ref : treference) : string;
 
 
 
 
     procedure TPPCMPWAssembler.WriteTree(p:TAAsmoutput);
     procedure TPPCMPWAssembler.WriteTree(p:TAAsmoutput);
-    const
-      nolinetai =[ait_label,
-                  ait_regalloc,ait_tempalloc,
-{$ifdef GDB}
-                  ait_stabn,ait_stabs,ait_stab_function_name,
-{$endif GDB}
-                  ait_cut,ait_marker,ait_align,ait_section];
-
     var
     var
       s,
       s,
       prefix,
       prefix,
       suffix   : string;
       suffix   : string;
       hp       : tai;
       hp       : tai;
+      hp1      : tailineinfo;
       counter,
       counter,
       lines,
       lines,
       InlineLevel : longint;
       InlineLevel : longint;
@@ -520,13 +513,14 @@ function getreferencestring(var ref : treference) : string;
       hp:=tai(p.first);
       hp:=tai(p.first);
       while assigned(hp) do
       while assigned(hp) do
        begin
        begin
-         if do_line and not(hp.typ in nolinetai) and
+         if do_line and not(hp.typ in SkipLineInfo) and
             not DoNotSplitLine then
             not DoNotSplitLine then
            begin
            begin
+             hp1 := hp as tailineinfo;
            { load infile }
            { load infile }
-             if lastfileinfo.fileindex<>hp.fileinfo.fileindex then
+             if lastfileinfo.fileindex<>hp1.fileinfo.fileindex then
               begin
               begin
-                infile:=current_module.sourcefiles.get_file(hp.fileinfo.fileindex);
+                infile:=current_module.sourcefiles.get_file(hp1.fileinfo.fileindex);
                 if assigned(infile) then
                 if assigned(infile) then
                  begin
                  begin
                    { open only if needed !! }
                    { open only if needed !! }
@@ -534,7 +528,7 @@ function getreferencestring(var ref : treference) : string;
                     infile.open;
                     infile.open;
                  end;
                  end;
                 { avoid unnecessary reopens of the same file !! }
                 { avoid unnecessary reopens of the same file !! }
-                lastfileinfo.fileindex:=hp.fileinfo.fileindex;
+                lastfileinfo.fileindex:=hp1.fileinfo.fileindex;
                 { be sure to change line !! }
                 { be sure to change line !! }
                 lastfileinfo.line:=-1;
                 lastfileinfo.line:=-1;
               end;
               end;
@@ -548,20 +542,20 @@ function getreferencestring(var ref : treference) : string;
                     if assigned(lastinfile) then
                     if assigned(lastinfile) then
                       lastinfile.close;
                       lastinfile.close;
                   end;
                   end;
-                if (hp.fileinfo.line<>lastfileinfo.line) and
-                   ((hp.fileinfo.line<infile.maxlinebuf) or (InlineLevel>0)) then
+                if (hp1.fileinfo.line<>lastfileinfo.line) and
+                   ((hp1.fileinfo.line<infile.maxlinebuf) or (InlineLevel>0)) then
                   begin
                   begin
-                    if (hp.fileinfo.line<>0) and
-                       ((infile.linebuf^[hp.fileinfo.line]>=0) or (InlineLevel>0)) then
-                      AsmWriteLn(target_asm.comment+'['+tostr(hp.fileinfo.line)+'] '+
-                        fixline(infile.GetLineStr(hp.fileinfo.line)));
+                    if (hp1.fileinfo.line<>0) and
+                       ((infile.linebuf^[hp1.fileinfo.line]>=0) or (InlineLevel>0)) then
+                      AsmWriteLn(target_asm.comment+'['+tostr(hp1.fileinfo.line)+'] '+
+                        fixline(infile.GetLineStr(hp1.fileinfo.line)));
                     { set it to a negative value !
                     { set it to a negative value !
                     to make that is has been read already !! PM }
                     to make that is has been read already !! PM }
-                    if (infile.linebuf^[hp.fileinfo.line]>=0) then
-                      infile.linebuf^[hp.fileinfo.line]:=-infile.linebuf^[hp.fileinfo.line]-1;
+                    if (infile.linebuf^[hp1.fileinfo.line]>=0) then
+                      infile.linebuf^[hp1.fileinfo.line]:=-infile.linebuf^[hp1.fileinfo.line]-1;
                   end;
                   end;
               end;
               end;
-             lastfileinfo:=hp.fileinfo;
+             lastfileinfo:=hp1.fileinfo;
              lastinfile:=infile;
              lastinfile:=infile;
            end;
            end;
          DoNotSplitLine:=false;
          DoNotSplitLine:=false;
@@ -1028,7 +1022,12 @@ initialization
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.14  2002-11-07 15:50:23  jonas
+  Revision 1.15  2002-11-17 16:31:59  carl
+    * memory optimization (3-4%) : cleanup of tai fields,
+       cleanup of tdef and tsym fields.
+    * make it work for m68k
+
+  Revision 1.14  2002/11/07 15:50:23  jonas
     * fixed bctr(l) problems
     * fixed bctr(l) problems
 
 
   Revision 1.13  2002/11/04 18:24:53  olle
   Revision 1.13  2002/11/04 18:24:53  olle

+ 7 - 2
compiler/psub.pas

@@ -623,7 +623,7 @@ implementation
          { pointer to the return value ? }
          { pointer to the return value ? }
          if paramanager.ret_in_param(aktprocdef.rettype.def)
          if paramanager.ret_in_param(aktprocdef.rettype.def)
 {$ifdef m68k}
 {$ifdef m68k}
-            and not(pocall_cdecl in aktprocsym^.definition^.proccalloptions)
+            and not (aktprocdef.proccalloption in [pocall_cdecl])
 {$endif m68k}
 {$endif m68k}
             then
             then
           begin
           begin
@@ -802,7 +802,12 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.74  2002-11-15 01:58:53  peter
+  Revision 1.75  2002-11-17 16:31:57  carl
+    * memory optimization (3-4%) : cleanup of tai fields,
+       cleanup of tdef and tsym fields.
+    * make it work for m68k
+
+  Revision 1.74  2002/11/15 01:58:53  peter
     * merged changes from 1.0.7 up to 04-11
     * merged changes from 1.0.7 up to 04-11
       - -V option for generating bug report tracing
       - -V option for generating bug report tracing
       - more tracing for option parsing
       - more tracing for option parsing

+ 13 - 38
compiler/sparc/aasmcpu.pas

@@ -36,7 +36,6 @@ type
  reg:tregister;
  reg:tregister;
  constructor create(b:byte);
  constructor create(b:byte);
  constructor create_op(b:byte; _op:byte);
  constructor create_op(b:byte; _op:byte);
- function getfillbuf:pchar;override;
   end;
   end;
   taicpu = class(taicpu_abstract)
   taicpu = class(taicpu_abstract)
     opsize:topsize;
     opsize:topsize;
@@ -110,35 +109,6 @@ constructor tai_align.create_op(b:byte; _op:byte);
     inherited create_op(b,_op);
     inherited create_op(b,_op);
     reg:= R_NONE;
     reg:= R_NONE;
   end;
   end;
-function tai_align.getfillbuf:pchar;
-  const
-    alignarray:array[0..5] of string[8]=(
-      #$8D#$B4#$26#$00#$00#$00#$00,
-      #$8D#$B6#$00#$00#$00#$00,
-      #$8D#$74#$26#$00,
-      #$8D#$76#$00,
-      #$89#$F6,
-      #$90
-    );
-  var
-    bufptr:pchar;
-    j:longint;
-  begin
-    if not use_op then
-     begin
-       bufptr:=@buf;
-       while (fillsize>0) do
-        begin
-          for j:=0 to 5 do
-           if (fillsize>=length(alignarray[j])) then
-            break;
-          move(alignarray[j][1],bufptr^,length(alignarray[j]));
-          inc(bufptr,length(alignarray[j]));
-          dec(fillsize,length(alignarray[j]));
-        end;
-     end;
-    getfillbuf:=pchar(@buf);
-  end;
 {*****************************************************************************
 {*****************************************************************************
                              Taicpu Constructors
                              Taicpu Constructors
 *****************************************************************************}
 *****************************************************************************}
@@ -212,16 +182,16 @@ constructor taicpu.op_const_reg(op:tasmop;_op1:aword;_op2:tregister);
      loadreg(1,_op2);
      loadreg(1,_op2);
   end;
   end;
 constructor TAiCpu.op_ref_reg(Op:TAsmOp;const Ref:TReference;Reg:TRegister);
 constructor TAiCpu.op_ref_reg(Op:TAsmOp;const Ref:TReference;Reg:TRegister);
-	begin
+  begin
     if not(Op in [A_JMPL,A_FLUSH,A_LDSB..A_LDDC,A_RETT,A_SWAP])
     if not(Op in [A_JMPL,A_FLUSH,A_LDSB..A_LDDC,A_RETT,A_SWAP])
     then
     then
       fail;
       fail;
-		inherited Create(Op);
-		Init(S_SW);
-		Ops:=2;
-		LoadRef(0,Ref);
-		LoadReg(1,Reg);
-	end;
+    inherited Create(Op);
+    Init(S_SW);
+    Ops:=2;
+    LoadRef(0,Ref);
+    LoadReg(1,Reg);
+  end;
 constructor taicpu.op_ref_ref(op:tasmop;_size:topsize;const _op1,_op2:treference);
 constructor taicpu.op_ref_ref(op:tasmop;_size:topsize;const _op1,_op2:treference);
   begin
   begin
      inherited create(op);
      inherited create(op);
@@ -1113,7 +1083,12 @@ procedure InitAsm;
 end.
 end.
 {
 {
     $Log$
     $Log$
-    Revision 1.12  2002-11-10 19:07:46  mazen
+    Revision 1.13  2002-11-17 16:32:04  carl
+      * memory optimization (3-4%) : cleanup of tai fields,
+         cleanup of tdef and tsym fields.
+      * make it work for m68k
+
+    Revision 1.12  2002/11/10 19:07:46  mazen
     * SPARC calling mechanism almost OK (as in GCC./mppcsparc )
     * SPARC calling mechanism almost OK (as in GCC./mppcsparc )
 
 
     Revision 1.11  2002/11/06 11:31:24  mazen
     Revision 1.11  2002/11/06 11:31:24  mazen

+ 48 - 40
compiler/symdef.pas

@@ -155,9 +155,10 @@ interface
        end;
        end;
 
 
        tforwarddef = class(tstoreddef)
        tforwarddef = class(tstoreddef)
-          tosymname : string;
+          tosymname : pstring;
           forwardpos : tfileposinfo;
           forwardpos : tfileposinfo;
           constructor create(const s:string;const pos : tfileposinfo);
           constructor create(const s:string;const pos : tfileposinfo);
+          destructor destroy;override;
           function  gettypename:string;override;
           function  gettypename:string;override;
        end;
        end;
 
 
@@ -260,8 +261,7 @@ interface
           writing_class_record_stab : boolean;
           writing_class_record_stab : boolean;
 {$endif GDB}
 {$endif GDB}
           objecttype : tobjectdeftype;
           objecttype : tobjectdeftype;
-          isiidguidvalid: boolean;
-          iidguid: TGUID;
+          iidguid: pguid;
           iidstr: pstring;
           iidstr: pstring;
           lastvtableindex: longint;
           lastvtableindex: longint;
           { store implemented interfaces defs and name mappings }
           { store implemented interfaces defs and name mappings }
@@ -275,6 +275,8 @@ interface
           function  alignment:longint;override;
           function  alignment:longint;override;
           function  vmtmethodoffset(index:longint):longint;
           function  vmtmethodoffset(index:longint):longint;
           function  members_need_inittable : boolean;
           function  members_need_inittable : boolean;
+          { this should be called when this class implements an interface }
+          procedure prepareguid;
           function  is_publishable : boolean;override;
           function  is_publishable : boolean;override;
           function  needs_inittable : boolean;override;
           function  needs_inittable : boolean;override;
           function  vmt_mangledname : string;
           function  vmt_mangledname : string;
@@ -342,7 +344,6 @@ interface
        end;
        end;
 
 
        tarraydef = class(tstoreddef)
        tarraydef = class(tstoreddef)
-          rangenr    : longint;
           lowrange,
           lowrange,
           highrange  : longint;
           highrange  : longint;
           rangetype  : ttype;
           rangetype  : ttype;
@@ -375,7 +376,6 @@ interface
        end;
        end;
 
 
        torddef = class(tstoreddef)
        torddef = class(tstoreddef)
-          rangenr  : longint;
           low,high : TConstExprInt;
           low,high : TConstExprInt;
           typ      : tbasetype;
           typ      : tbasetype;
           constructor create(t : tbasetype;v,b : TConstExprInt);
           constructor create(t : tbasetype;v,b : TConstExprInt);
@@ -411,12 +411,12 @@ interface
        tabstractprocdef = class(tstoreddef)
        tabstractprocdef = class(tstoreddef)
           { saves a definition to the return type }
           { saves a definition to the return type }
           rettype         : ttype;
           rettype         : ttype;
+          para            : tparalinkedlist;
           proctypeoption  : tproctypeoption;
           proctypeoption  : tproctypeoption;
           proccalloption  : tproccalloption;
           proccalloption  : tproccalloption;
           procoptions     : tprocoptions;
           procoptions     : tprocoptions;
-          para            : tparalinkedlist;
           maxparacount,
           maxparacount,
-          minparacount    : longint;
+          minparacount    : byte;
           symtablelevel   : byte;
           symtablelevel   : byte;
           fpu_used        : byte;    { how many stack fpu must be empty }
           fpu_used        : byte;    { how many stack fpu must be empty }
           constructor create;
           constructor create;
@@ -487,7 +487,6 @@ interface
           { browser info }
           { browser info }
           lastref,
           lastref,
           defref,
           defref,
-          crossref,
           lastwritten : tref;
           lastwritten : tref;
           refcount : longint;
           refcount : longint;
           _class : tobjectdef;
           _class : tobjectdef;
@@ -565,7 +564,6 @@ interface
        end;
        end;
 
 
        tenumdef = class(tstoreddef)
        tenumdef = class(tstoreddef)
-          rangenr,
           minval,
           minval,
           maxval    : longint;
           maxval    : longint;
           has_jumps : boolean;
           has_jumps : boolean;
@@ -1407,7 +1405,6 @@ implementation
          calcsavesize;
          calcsavesize;
          has_jumps:=false;
          has_jumps:=false;
          basedef:=nil;
          basedef:=nil;
-         rangenr:=0;
          firstenum:=nil;
          firstenum:=nil;
          correct_owner_symtable;
          correct_owner_symtable;
       end;
       end;
@@ -1421,7 +1418,6 @@ implementation
          basedef:=_basedef;
          basedef:=_basedef;
          calcsavesize;
          calcsavesize;
          has_jumps:=false;
          has_jumps:=false;
-         rangenr:=0;
          firstenum:=basedef.firstenum;
          firstenum:=basedef.firstenum;
          while assigned(firstenum) and (tenumsym(firstenum).value<>minval) do
          while assigned(firstenum) and (tenumsym(firstenum).value<>minval) do
           firstenum:=tenumsym(firstenum).nextenum;
           firstenum:=tenumsym(firstenum).nextenum;
@@ -1622,7 +1618,6 @@ implementation
          low:=v;
          low:=v;
          high:=b;
          high:=b;
          typ:=t;
          typ:=t;
-         rangenr:=0;
          setsize;
          setsize;
       end;
       end;
 
 
@@ -1666,7 +1661,6 @@ implementation
           end
           end
          else
          else
           high:=ppufile.getlongint;
           high:=ppufile.getlongint;
-         rangenr:=0;
          setsize;
          setsize;
       end;
       end;
 
 
@@ -1688,8 +1682,6 @@ implementation
             else
             else
               savesize:=0;
               savesize:=0;
          end;
          end;
-       { there are no entrys for range checking }
-         rangenr:=0;
       end;
       end;
 
 
 
 
@@ -2530,7 +2522,6 @@ implementation
          IsConstructor:=false;
          IsConstructor:=false;
          IsArrayOfConst:=false;
          IsArrayOfConst:=false;
          IsDynamicArray:=false;
          IsDynamicArray:=false;
-         rangenr:=0;
       end;
       end;
 
 
 
 
@@ -2547,7 +2538,6 @@ implementation
          IsDynamicArray:=boolean(ppufile.getbyte);
          IsDynamicArray:=boolean(ppufile.getbyte);
          IsVariant:=false;
          IsVariant:=false;
          IsConstructor:=false;
          IsConstructor:=false;
-         rangenr:=0;
       end;
       end;
 
 
 
 
@@ -3096,7 +3086,8 @@ implementation
          proctypeoption:=tproctypeoption(ppufile.getbyte);
          proctypeoption:=tproctypeoption(ppufile.getbyte);
          proccalloption:=tproccalloption(ppufile.getbyte);
          proccalloption:=tproccalloption(ppufile.getbyte);
          ppufile.getsmallset(procoptions);
          ppufile.getsmallset(procoptions);
-         count:=ppufile.getword;
+         { get the number of parameters }
+         count:=ppufile.getbyte;
          savesize:=POINTER_SIZE;
          savesize:=POINTER_SIZE;
          for i:=1 to count do
          for i:=1 to count do
           begin
           begin
@@ -3132,7 +3123,7 @@ implementation
          ppufile.putbyte(ord(proccalloption));
          ppufile.putbyte(ord(proccalloption));
          ppufile.putsmallset(procoptions);
          ppufile.putsmallset(procoptions);
          ppufile.do_interface_crc:=oldintfcrc;
          ppufile.do_interface_crc:=oldintfcrc;
-         ppufile.putword(maxparacount);
+         ppufile.putbyte(maxparacount);
          hp:=TParaItem(Para.first);
          hp:=TParaItem(Para.first);
          while assigned(hp) do
          while assigned(hp) do
           begin
           begin
@@ -3300,7 +3291,6 @@ implementation
            to check same names in parast and localst }
            to check same names in parast and localst }
          localst.next:=parast;
          localst.next:=parast;
          defref:=nil;
          defref:=nil;
-         crossref:=nil;
          lastwritten:=nil;
          lastwritten:=nil;
          refcount:=0;
          refcount:=0;
          if (cs_browser in aktmoduleswitches) and make_ref then
          if (cs_browser in aktmoduleswitches) and make_ref then
@@ -4106,12 +4096,8 @@ implementation
         set_parent(c);
         set_parent(c);
         objname:=stringdup(upper(n));
         objname:=stringdup(upper(n));
         objrealname:=stringdup(n);
         objrealname:=stringdup(n);
-
-        { set up guid }
-        isiidguidvalid:=true; { default null guid }
-        fillchar(iidguid,sizeof(iidguid),0); { default null guid }
-        iidstr:=stringdup(''); { default is empty string }
-
+        if objecttype in [odt_interfacecorba,odt_interfacecom] then
+          prepareguid;
         { setup implemented interfaces }
         { setup implemented interfaces }
         if objecttype in [odt_class,odt_interfacecorba] then
         if objecttype in [odt_class,odt_interfacecorba] then
           implementedinterfaces:=timplementedinterfaces.create
           implementedinterfaces:=timplementedinterfaces.create
@@ -4143,8 +4129,8 @@ implementation
          iidstr:=nil;
          iidstr:=nil;
          if objecttype in [odt_interfacecom,odt_interfacecorba] then
          if objecttype in [odt_interfacecom,odt_interfacecorba] then
            begin
            begin
-              isiidguidvalid:=boolean(ppufile.getbyte);
-              ppufile.getguid(iidguid);
+              new(iidguid); 
+              ppufile.getguid(iidguid^);
               iidstr:=stringdup(ppufile.getstring);
               iidstr:=stringdup(ppufile.getstring);
               lastvtableindex:=ppufile.getlongint;
               lastvtableindex:=ppufile.getlongint;
            end;
            end;
@@ -4194,9 +4180,12 @@ implementation
           symtable.free;
           symtable.free;
         stringdispose(objname);
         stringdispose(objname);
         stringdispose(objrealname);
         stringdispose(objrealname);
-        stringdispose(iidstr);
+        if assigned(iidstr) then
+          stringdispose(iidstr);
         if assigned(implementedinterfaces) then
         if assigned(implementedinterfaces) then
           implementedinterfaces.free;
           implementedinterfaces.free;
+        if assigned(iidguid) then
+          dispose(iidguid);
         inherited destroy;
         inherited destroy;
      end;
      end;
 
 
@@ -4216,8 +4205,7 @@ implementation
          ppufile.putsmallset(objectoptions);
          ppufile.putsmallset(objectoptions);
          if objecttype in [odt_interfacecom,odt_interfacecorba] then
          if objecttype in [odt_interfacecom,odt_interfacecorba] then
            begin
            begin
-              ppufile.putbyte(byte(isiidguidvalid));
-              ppufile.putguid(iidguid);
+              ppufile.putguid(iidguid^);
               ppufile.putstring(iidstr^);
               ppufile.putstring(iidstr^);
               ppufile.putlongint(lastvtableindex);
               ppufile.putlongint(lastvtableindex);
            end;
            end;
@@ -4256,6 +4244,20 @@ implementation
            implementedinterfaces.deref;
            implementedinterfaces.deref;
       end;
       end;
 
 
+    
+    procedure tobjectdef.prepareguid;
+      begin
+        { set up guid }
+        if not assigned(iidguid) then
+         begin
+            new(iidguid);
+            fillchar(iidguid^,sizeof(iidguid^),0); { default null guid }
+         end;
+        { setup iidstring }
+        if not assigned(iidstr) then
+          iidstr:=stringdup(''); { default is empty string }
+      end;
+
 
 
     procedure tobjectdef.set_parent( c : tobjectdef);
     procedure tobjectdef.set_parent( c : tobjectdef);
       begin
       begin
@@ -5326,14 +5328,21 @@ implementation
         inherited create;
         inherited create;
         registerdef:=oldregisterdef;
         registerdef:=oldregisterdef;
         deftype:=forwarddef;
         deftype:=forwarddef;
-        tosymname:=s;
+        tosymname:=stringdup(s);
         forwardpos:=pos;
         forwardpos:=pos;
      end;
      end;
 
 
 
 
     function tforwarddef.gettypename:string;
     function tforwarddef.gettypename:string;
       begin
       begin
-        gettypename:='unresolved forward to '+tosymname;
+        gettypename:='unresolved forward to '+tosymname^;
+      end;
+
+     destructor tforwarddef.destroy;
+      begin
+        if assigned(tosymname) then
+          stringdispose(tosymname);
+        inherited destroy;
       end;
       end;
 
 
 
 
@@ -5438,12 +5447,6 @@ implementation
               ttypesym(def.typesym).isusedinstab:=false;
               ttypesym(def.typesym).isusedinstab:=false;
             def.is_def_stab_written:=not_written;
             def.is_def_stab_written:=not_written;
 {$endif GDB}
 {$endif GDB}
-            { reset rangenr's }
-            case def.deftype of
-              orddef   : torddef(def).rangenr:=0;
-              enumdef  : tenumdef(def).rangenr:=0;
-              arraydef : tarraydef(def).rangenr:=0;
-            end;
             if assigned(def.rttitablesym) then
             if assigned(def.rttitablesym) then
               trttisym(def.rttitablesym).lab := nil;
               trttisym(def.rttitablesym).lab := nil;
             if assigned(def.inittablesym) then
             if assigned(def.inittablesym) then
@@ -5517,7 +5520,12 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.104  2002-11-16 19:53:18  carl
+  Revision 1.105  2002-11-17 16:31:57  carl
+    * memory optimization (3-4%) : cleanup of tai fields,
+       cleanup of tdef and tsym fields.
+    * make it work for m68k
+
+  Revision 1.104  2002/11/16 19:53:18  carl
     * avoid Range check errors
     * avoid Range check errors
 
 
   Revision 1.103  2002/11/15 16:29:09  peter
   Revision 1.103  2002/11/15 16:29:09  peter

+ 9 - 4
compiler/symsym.pas

@@ -114,10 +114,10 @@ interface
           defs : pprocdeflist; { linked list of overloaded procdefs }
           defs : pprocdeflist; { linked list of overloaded procdefs }
           function getprocdef(nr:cardinal):Tprocdef;
           function getprocdef(nr:cardinal):Tprocdef;
        public
        public
-          procdef_count : cardinal;
+          procdef_count : byte;
           is_global : boolean;
           is_global : boolean;
           overloadchecked : boolean;
           overloadchecked : boolean;
-          overloadcount : longint; { amount of overloaded functions in this module }
+          overloadcount : word;    { amount of overloaded functions in this module }
           property procdef[nr:cardinal]:Tprocdef read getprocdef;
           property procdef[nr:cardinal]:Tprocdef read getprocdef;
           constructor create(const n : string);
           constructor create(const n : string);
           constructor ppuload(ppufile:tcompilerppufile);
           constructor ppuload(ppufile:tcompilerppufile);
@@ -822,7 +822,7 @@ implementation
          until false;
          until false;
          is_global:=false;
          is_global:=false;
          overloadchecked:=false;
          overloadchecked:=false;
-         overloadcount:=-1; { invalid, not used anymore }
+         overloadcount:=$ffff; { invalid, not used anymore }
       end;
       end;
 
 
 
 
@@ -2506,7 +2506,12 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.71  2002-11-09 15:30:07  carl
+  Revision 1.72  2002-11-17 16:31:57  carl
+    * memory optimization (3-4%) : cleanup of tai fields,
+       cleanup of tdef and tsym fields.
+    * make it work for m68k
+
+  Revision 1.71  2002/11/09 15:30:07  carl
     + align RTTI tables
     + align RTTI tables
 
 
   Revision 1.70  2002/10/13 21:33:37  peter
   Revision 1.70  2002/10/13 21:33:37  peter

+ 7 - 3
compiler/systems/t_linux.pas

@@ -65,7 +65,7 @@ implementation
     cutils,cclasses,
     cutils,cclasses,
     verbose,systems,globtype,globals,
     verbose,systems,globtype,globals,
     symconst,script,
     symconst,script,
-    fmodule
+    fmodule,dos
 {$ifdef i386}
 {$ifdef i386}
     ,aasmbase,aasmtai,aasmcpu,cpubase
     ,aasmbase,aasmtai,aasmcpu,cpubase
 {$endif i386}
 {$endif i386}
@@ -89,7 +89,6 @@ begin
   if name<>'' then
   if name<>'' then
    begin
    begin
      aktprocdef.setmangledname(name);
      aktprocdef.setmangledname(name);
-     aktprocdef.has_mangledname:=true;
    end
    end
   else
   else
     message(parser_e_empty_import_name);
     message(parser_e_empty_import_name);
@@ -545,7 +544,12 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.3  2002-11-15 01:59:02  peter
+  Revision 1.4  2002-11-17 16:32:04  carl
+    * memory optimization (3-4%) : cleanup of tai fields,
+       cleanup of tdef and tsym fields.
+    * make it work for m68k
+
+  Revision 1.3  2002/11/15 01:59:02  peter
     * merged changes from 1.0.7 up to 04-11
     * merged changes from 1.0.7 up to 04-11
       - -V option for generating bug report tracing
       - -V option for generating bug report tracing
       - more tracing for option parsing
       - more tracing for option parsing

+ 6 - 2
compiler/systems/t_macos.pas

@@ -62,7 +62,6 @@ begin
   if name<>'' then
   if name<>'' then
    begin
    begin
      aktprocdef.setmangledname(name);
      aktprocdef.setmangledname(name);
-     aktprocdef.has_mangledname:=true;
    end
    end
   else
   else
     message(parser_e_empty_import_name);
     message(parser_e_empty_import_name);
@@ -100,7 +99,12 @@ initialization
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.3  2002-10-16 20:18:33  olle
+  Revision 1.4  2002-11-17 16:32:04  carl
+    * memory optimization (3-4%) : cleanup of tai fields,
+       cleanup of tdef and tsym fields.
+    * make it work for m68k
+
+  Revision 1.3  2002/10/16 20:18:33  olle
     * header comment updated
     * header comment updated
 
 
   Revision 1.2  2002/10/02 21:50:19  florian
   Revision 1.2  2002/10/02 21:50:19  florian

+ 6 - 2
compiler/systems/t_nwm.pas

@@ -140,7 +140,6 @@ begin
   if name<>'' then
   if name<>'' then
    begin
    begin
      aktprocdef.setmangledname(name);
      aktprocdef.setmangledname(name);
-     aktprocdef.has_mangledname:=true;
    end
    end
   else
   else
     message(parser_e_empty_import_name);
     message(parser_e_empty_import_name);
@@ -484,7 +483,12 @@ initialization
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.2  2002-09-09 17:34:17  peter
+  Revision 1.3  2002-11-17 16:32:04  carl
+    * memory optimization (3-4%) : cleanup of tai fields,
+       cleanup of tdef and tsym fields.
+    * make it work for m68k
+
+  Revision 1.2  2002/09/09 17:34:17  peter
     * tdicationary.replace added to replace and item in a dictionary. This
     * tdicationary.replace added to replace and item in a dictionary. This
       is only allowed for the same name
       is only allowed for the same name
     * varsyms are inserted in symtable before the types are parsed. This
     * varsyms are inserted in symtable before the types are parsed. This

+ 7 - 3
compiler/utils/ppudump.pp

@@ -709,7 +709,7 @@ begin
        end;
        end;
      writeln;
      writeln;
    end;
    end;
-  params:=ppufile.getword;
+  params:=ppufile.getbyte;
   writeln(space,' Nr of parameters : ',params);
   writeln(space,' Nr of parameters : ',params);
   if params>0 then
   if params>0 then
    begin
    begin
@@ -1374,7 +1374,6 @@ begin
 
 
              if tobjectdeftype(b) in [odt_interfacecom,odt_interfacecorba] then
              if tobjectdeftype(b) in [odt_interfacecom,odt_interfacecorba] then
                begin
                begin
-                  writeln(space,'       GUID Valid : ',(getbyte<>0));
                   { IIDGUID }
                   { IIDGUID }
                   for j:=1to 16 do
                   for j:=1to 16 do
                    getbyte;
                    getbyte;
@@ -1898,7 +1897,12 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.33  2002-10-20 14:49:31  peter
+  Revision 1.34  2002-11-17 16:32:04  carl
+    * memory optimization (3-4%) : cleanup of tai fields,
+       cleanup of tdef and tsym fields.
+    * make it work for m68k
+
+  Revision 1.33  2002/10/20 14:49:31  peter
     * store original source time in ppu so it can be compared instead of
     * store original source time in ppu so it can be compared instead of
       comparing with the ppu time
       comparing with the ppu time
 
 

+ 11 - 5
compiler/x86_64/aasmcpu.pas

@@ -133,7 +133,7 @@ interface
          reg       : tregister;
          reg       : tregister;
          constructor create(b:byte);
          constructor create(b:byte);
          constructor create_op(b: byte; _op: byte);
          constructor create_op(b: byte; _op: byte);
-         function getfillbuf:pchar;override;
+         function calculatefillbuf(var buf : tfillbuffer):pchar;override;
       end;
       end;
 
 
       taicpu = class(taicpu_abstract)
       taicpu = class(taicpu_abstract)
@@ -324,7 +324,7 @@ implementation
       end;
       end;
 
 
 
 
-    function tai_align.getfillbuf:pchar;
+    function tai_align.calculatefillbuf(var buf : tfillbuffer):pchar;
       const
       const
         alignarray:array[0..5] of string[8]=(
         alignarray:array[0..5] of string[8]=(
           #$8D#$B4#$26#$00#$00#$00#$00,
           #$8D#$B4#$26#$00#$00#$00#$00,
@@ -338,9 +338,10 @@ implementation
         bufptr : pchar;
         bufptr : pchar;
         j : longint;
         j : longint;
       begin
       begin
+        inherited calculatefillbuf(buf);
         if not use_op then
         if not use_op then
          begin
          begin
-           bufptr:=@buf;
+           bufptr:=pchar(@buf);
            while (fillsize>0) do
            while (fillsize>0) do
             begin
             begin
               for j:=0 to 5 do
               for j:=0 to 5 do
@@ -351,7 +352,7 @@ implementation
               dec(fillsize,length(alignarray[j]));
               dec(fillsize,length(alignarray[j]));
             end;
             end;
          end;
          end;
-        getfillbuf:=pchar(@buf);
+        calculatefillbuf:=pchar(@buf);
       end;
       end;
 
 
 
 
@@ -1799,7 +1800,12 @@ implementation
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.3  2002-08-13 18:01:53  carl
+  Revision 1.4  2002-11-17 16:32:04  carl
+    * memory optimization (3-4%) : cleanup of tai fields,
+       cleanup of tdef and tsym fields.
+    * make it work for m68k
+
+  Revision 1.3  2002/08/13 18:01:53  carl
     * rename swatoperands to swapoperands
     * rename swatoperands to swapoperands
     + m68k first compilable version (still needs a lot of testing):
     + m68k first compilable version (still needs a lot of testing):
         assembler generator, system information , inline
         assembler generator, system information , inline