Browse Source

* inlining is now also allowed in interface
* renamed write/load to ppuwrite/ppuload
* tnode storing in ppu
* nld,ncon,nbas are already updated for storing in ppu

peter 23 years ago
parent
commit
98dd65b0f3

+ 15 - 6
compiler/aasmbase.pas

@@ -661,11 +661,14 @@ implementation
 
     procedure TAsmLibraryData.DerefAsmsymbol(var s:tasmsymbol);
       begin
-        if not assigned(asmsymbolidx) then
-          internalerror(200208072);
-        if longint(pointer(s))>=asmsymbolppuidx then
-          internalerror(200208073);
-        s:=asmsymbolidx^[longint(pointer(s))];
+        if assigned(s) then
+         begin
+           if not assigned(asmsymbolidx) then
+             internalerror(200208072);
+           if longint(pointer(s))>=asmsymbolppuidx then
+             internalerror(200208073);
+           s:=asmsymbolidx^[longint(pointer(s))];
+         end;
       end;
 
 
@@ -840,7 +843,13 @@ implementation
 end.
 {
   $Log$
-  Revision 1.6  2002-08-12 15:08:39  carl
+  Revision 1.7  2002-08-18 20:06:23  peter
+    * inlining is now also allowed in interface
+    * renamed write/load to ppuwrite/ppuload
+    * tnode storing in ppu
+    * nld,ncon,nbas are already updated for storing in ppu
+
+  Revision 1.6  2002/08/12 15:08:39  carl
     + stab register indexes for powerpc (moved from gdb to cpubase)
     + tprocessor enumeration moved to cpuinfo
     + linker in target_info is now a class

File diff suppressed because it is too large
+ 299 - 184
compiler/aasmtai.pas


+ 9 - 3
compiler/aggas.pas

@@ -305,7 +305,7 @@ var
     var
       ch       : char;
       hp       : tai;
-      consttyp : tait;
+      consttyp : taitype;
       s        : string;
       found    : boolean;
       i,pos,l  : longint;
@@ -388,7 +388,7 @@ var
            ait_comment :
              Begin
                AsmWrite(target_asm.comment);
-               AsmWritePChar(tai_asm_comment(hp).str);
+               AsmWritePChar(tai_comment(hp).str);
                AsmLn;
              End;
 
@@ -796,7 +796,13 @@ var
 end.
 {
   $Log$
-  Revision 1.8  2002-07-26 21:15:37  florian
+  Revision 1.9  2002-08-18 20:06:23  peter
+    * inlining is now also allowed in interface
+    * renamed write/load to ppuwrite/ppuload
+    * tnode storing in ppu
+    * nld,ncon,nbas are already updated for storing in ppu
+
+  Revision 1.8  2002/07/26 21:15:37  florian
     * rewrote the system handling
 
   Revision 1.7  2002/07/07 09:52:32  florian

+ 8 - 2
compiler/cgbase.pas

@@ -428,7 +428,7 @@ implementation
                       assigned(otsym) then
                      otsym.address:=-procinfo.return_offset;
 
-		   rg.usedinproc := rg.usedinproc +	
+                   rg.usedinproc := rg.usedinproc +
                       getfuncretusedregisters(aktprocdef.rettype.def);
                 end;
            end;
@@ -655,7 +655,13 @@ begin
 end.
 {
   $Log$
-  Revision 1.25  2002-08-17 09:23:33  florian
+  Revision 1.26  2002-08-18 20:06:23  peter
+    * inlining is now also allowed in interface
+    * renamed write/load to ppuwrite/ppuload
+    * tnode storing in ppu
+    * nld,ncon,nbas are already updated for storing in ppu
+
+  Revision 1.25  2002/08/17 09:23:33  florian
     * first part of procinfo rewrite
 
   Revision 1.24  2002/08/11 14:32:26  peter

+ 9 - 3
compiler/i386/ag386int.pas

@@ -339,7 +339,7 @@ interface
       lines,
       InlineLevel : longint;
       i,j,l    : longint;
-      consttyp : tait;
+      consttyp : taitype;
       found,
       do_line,DoNotSplitLine,
       quoted   : boolean;
@@ -404,7 +404,7 @@ interface
          case hp.typ of
        ait_comment : Begin
                        AsmWrite(target_asm.comment);
-                       AsmWritePChar(tai_asm_comment(hp).str);
+                       AsmWritePChar(tai_comment(hp).str);
                        AsmLn;
                      End;
        ait_regalloc,
@@ -821,7 +821,13 @@ initialization
 end.
 {
   $Log$
-  Revision 1.26  2002-08-12 15:08:41  carl
+  Revision 1.27  2002-08-18 20:06:28  peter
+    * inlining is now also allowed in interface
+    * renamed write/load to ppuwrite/ppuload
+    * tnode storing in ppu
+    * nld,ncon,nbas are already updated for storing in ppu
+
+  Revision 1.26  2002/08/12 15:08:41  carl
     + stab register indexes for powerpc (moved from gdb to cpubase)
     + tprocessor enumeration moved to cpuinfo
     + linker in target_info is now a class

+ 9 - 3
compiler/i386/ag386nsm.pas

@@ -363,7 +363,7 @@ interface
       lines,
       i,j,l    : longint;
       InlineLevel : longint;
-      consttyp : tait;
+      consttyp : taitype;
       found,
       do_line,
       quoted   : boolean;
@@ -431,7 +431,7 @@ interface
            ait_comment :
              Begin
                AsmWrite(target_asm.comment);
-               AsmWritePChar(tai_asm_comment(hp).str);
+               AsmWritePChar(tai_comment(hp).str);
                AsmLn;
              End;
 
@@ -893,7 +893,13 @@ initialization
 end.
 {
   $Log$
-  Revision 1.25  2002-08-12 15:08:41  carl
+  Revision 1.26  2002-08-18 20:06:28  peter
+    * inlining is now also allowed in interface
+    * renamed write/load to ppuwrite/ppuload
+    * tnode storing in ppu
+    * nld,ncon,nbas are already updated for storing in ppu
+
+  Revision 1.25  2002/08/12 15:08:41  carl
     + stab register indexes for powerpc (moved from gdb to cpubase)
     + tprocessor enumeration moved to cpuinfo
     + linker in target_info is now a class

+ 25 - 5
compiler/i386/cpunode.pas

@@ -29,16 +29,36 @@ unit cpunode;
   implementation
 
     uses
-       ncgbas,ncgflw,ncgcnv,ncgld,ncgmem,ncgcon,ncgset,ncginl,
-       n386add,n386cal,n386con,n386cnv,n386flw,n386mat,n386mem,
-       n386set,n386inl,n386opt,
+       { generic nodes }
+       ncgbas,ncgld,ncgflw,ncgcnv,ncgmem,ncgcon,ncgcal,ncgset,ncginl,
+       { to be able to only parts of the generic code,
+         the processor specific nodes must be included
+         after the generic one (FK)
+       }
+       n386add,
+       n386cal,
+       n386con,
+       n386flw,
+       n386mem,
+       n386set,
+       n386inl,
+       n386opt,
        { this not really a node }
-       n386obj, rgcpu;
+       n386obj,
+       n386mat,
+       n386cnv
+       ;
 
 end.
 {
   $Log$
-  Revision 1.15  2002-07-25 18:01:58  carl
+  Revision 1.16  2002-08-18 20:06:29  peter
+    * inlining is now also allowed in interface
+    * renamed write/load to ppuwrite/ppuload
+    * tnode storing in ppu
+    * nld,ncon,nbas are already updated for storing in ppu
+
+  Revision 1.15  2002/07/25 18:01:58  carl
    + added generic inline nodes
 
   Revision 1.14  2002/07/06 20:27:26  carl

+ 25 - 19
compiler/i386/csopt386.pas

@@ -548,7 +548,7 @@ begin
 {$ifdef alignregdebug}
       if assigned(prev) then
         begin
-          temp := Tai_asm_comment.Create(strpnew('got here'));
+          temp := tai_comment.Create(strpnew('got here'));
           temp.next := prev.next;
           temp.previous := prev;
           prev.next := temp;
@@ -573,7 +573,7 @@ begin
                       lastRemoved := regCounter;
                       exclude(regsUsable,regCounter);
 {$ifdef alignregdebug}
-                      temp := Tai_asm_comment.Create(strpnew(
+                      temp := tai_comment.Create(strpnew(
                                 std_reg2str[regCounter]+' removed')));
                       temp.next := prev.next;
                       temp.previous := prev;
@@ -582,7 +582,7 @@ begin
                         temp.next.previous := temp;
                       if regsUsable = [] then
                         begin
-                          temp := Tai_asm_comment.Create(strpnew(
+                          temp := tai_comment.Create(strpnew(
                                     'regsUsable empty here')));
                           temp.next := prev.next;
                           temp.previous := prev;
@@ -623,7 +623,7 @@ begin
                       lastRemoved := regCounter;
                       exclude(regsUsable,regCounter);
 {$ifdef alignregdebug}
-                      temp := Tai_asm_comment.Create(strpnew(
+                      temp := tai_comment.Create(strpnew(
                                 std_reg2str[regCounter]+' removed')));
                       temp.next := next.next;
                       temp.previous := next;
@@ -632,7 +632,7 @@ begin
                         temp.next.previous := temp;
                       if regsUsable = [] then
                         begin
-                          temp := Tai_asm_comment.Create(strpnew(
+                          temp := tai_comment.Create(strpnew(
                                     'regsUsable empty here')));
                           temp.next := next.next;
                           temp.previous := next;
@@ -667,7 +667,7 @@ begin
           break
         end;
 {$ifdef alignregdebug}
-  next := Tai_asm_comment.Create(strpnew(std_reg2str[lastRemoved]+
+  next := tai_comment.Create(strpnew(std_reg2str[lastRemoved]+
                ' chosen as alignment register')));
   next.next := p.next;
   next.previous := p;
@@ -702,7 +702,7 @@ var
 begin
 {$ifdef replaceregdebug}
   l := random(1000);
-  hp := Tai_asm_comment.Create(strpnew(
+  hp := tai_comment.Create(strpnew(
           'cleared '+std_reg2str[reg]+' from here... '+tostr(l))));
   hp.next := p;
   hp.previous := p.previous;
@@ -737,7 +737,7 @@ begin
 {$ifdef replaceregdebug}
   if assigned(p) then
     begin
-      hp := Tai_asm_comment.Create(strpnew(
+      hp := tai_comment.Create(strpnew(
         'cleared '+std_reg2str[reg]+' till here... '+tostr(l))));
       hp.next := p;
       hp.previous := p.previous;
@@ -758,7 +758,7 @@ var
 begin
 {$ifdef replaceregdebug}
   l := random(1000);
-  hp := Tai_asm_comment.Create(strpnew(
+  hp := tai_comment.Create(strpnew(
           'restored '+std_reg2str[reg]+' with data from here... '+tostr(l))));
   hp.next := p;
   hp.previous := p.previous;
@@ -783,7 +783,7 @@ begin
 {$ifdef replaceregdebug}
   if assigned(p) then
     begin
-      hp := Tai_asm_comment.Create(strpnew(
+      hp := tai_comment.Create(strpnew(
         'restored '+std_reg2str[reg]+' till here... '+tostr(l))));
       hp.next := p;
       hp.previous := p.previous;
@@ -1097,7 +1097,7 @@ begin
         not(Taicpu(endp).is_jmp);
       if tmpresult and not assigned(endp.optInfo) then
         begin
-{          hp := Tai_asm_comment.Create(strpnew('next no optinfo'));
+{          hp := tai_comment.Create(strpnew('next no optinfo'));
           hp.next := endp;
           hp.previous := endp.previous;
           endp.previous := hp;
@@ -1173,7 +1173,7 @@ begin
   if SequenceEnd then
     begin
 {$ifdef replaceregdebug}
-      hp := Tai_asm_comment.Create(strpnew(
+      hp := tai_comment.Create(strpnew(
         'replacing '+std_reg2str[newreg]+' with '+std_reg2str[orgreg]+
         ' from here...')));
       hp.next := p;
@@ -1182,7 +1182,7 @@ begin
       if assigned(hp.previous) then
         hp.previous^.next := hp;
 
-      hp := Tai_asm_comment.Create(strpnew(
+      hp := tai_comment.Create(strpnew(
         'replaced '+std_reg2str[newreg]+' with '+std_reg2str[orgreg]+
         ' till here')));
       hp.next := endp.next;
@@ -1245,7 +1245,7 @@ begin
 {$ifdef replaceregdebug}
      else
        begin
-         hp := Tai_asm_comment.Create(strpnew(
+         hp := tai_comment.Create(strpnew(
            'replacing '+std_reg2str[newreg]+' with '+std_reg2str[orgreg]+
            ' from here...')));
          hp.previous := p.previous;
@@ -1254,7 +1254,7 @@ begin
         if assigned(hp.previous) then
           hp.previous^.next := hp;
 
-      hp := Tai_asm_comment.Create(strpnew(
+      hp := tai_comment.Create(strpnew(
         'replacing '+std_reg2str[newreg]+' with '+std_reg2str[orgreg]+
         ' failed here')));
       hp.next := endp.next;
@@ -1285,7 +1285,7 @@ Begin
 {$ifdef testing}
      if (pTaiprop(p.optInfo)^.regs[counter].typ in [con_const,con_noRemoveConst]) then
        begin
-         hp := Tai_asm_comment.Create(strpnew(
+         hp := tai_comment.Create(strpnew(
            'checking const load of '+tostr(l)+' here...')));
          hp.next := PTaiProp(p.OptInfo)^.Regs[Counter].StartMod;
          hp.previous := PTaiProp(p.OptInfo)^.Regs[Counter].StartMod^.previous;
@@ -1462,7 +1462,7 @@ Begin
 {so we don't try to check a sequence when p is the first instruction of the block}
                               begin
 {$ifdef csdebug}
-                               hp5 := Tai_asm_comment.Create(strpnew(
+                               hp5 := tai_comment.Create(strpnew(
                                  'cse checking '+std_reg2str[Reg32(Taicpu(p).oper[1].reg)])));
                                insertLLItem(asml,p,p.next,hp5);
 {$endif csdebug}
@@ -1545,7 +1545,7 @@ Begin
               For RegCounter := R_EAX To R_EDI Do
                 If (RegCounter in RegInfo.RegsLoadedForRef) Then
                   Begin
-           hp5 := Tai_asm_comment.Create(strpnew('New: '+std_reg2str[RegCounter]+', Old: '+
+           hp5 := tai_comment.Create(strpnew('New: '+std_reg2str[RegCounter]+', Old: '+
                                                   std_reg2str[RegInfo.New2OldReg[RegCounter]])));
            InsertLLItem(AsmL, Tai(hp2.previous), hp2, hp5);
                   End;
@@ -1984,7 +1984,13 @@ End.
 
 {
   $Log$
-  Revision 1.37  2002-08-17 09:23:44  florian
+  Revision 1.38  2002-08-18 20:06:29  peter
+    * inlining is now also allowed in interface
+    * renamed write/load to ppuwrite/ppuload
+    * tnode storing in ppu
+    * nld,ncon,nbas are already updated for storing in ppu
+
+  Revision 1.37  2002/08/17 09:23:44  florian
     * first part of procinfo rewrite
 
   Revision 1.36  2002/07/01 18:46:31  peter

+ 26 - 20
compiler/i386/daopt386.pas

@@ -1176,10 +1176,10 @@ Begin
   firstRemovedWasAlloc := false;
   first := true;
 {$ifdef allocregdebug}
-  hp := Tai_asm_comment.Create(strpnew('allocating '+std_reg2str[reg]+
+  hp := tai_comment.Create(strpnew('allocating '+std_reg2str[reg]+
     ' from here...')));
   insertllitem(asml,p1.previous,p1,hp);
-  hp := Tai_asm_comment.Create(strpnew('allocated '+std_reg2str[reg]+
+  hp := tai_comment.Create(strpnew('allocated '+std_reg2str[reg]+
     ' till here...')));
   insertllitem(asml,p2,p1.next,hp);
 {$endif allocregdebug}
@@ -1560,7 +1560,7 @@ Begin {checks whether two Taicpu instructions are equal}
  {an instruction <> mov, movzx, movsx}
        begin
   {$ifdef csdebug}
-         hp := Tai_asm_comment.Create(strpnew('checking if equivalent'));
+         hp := tai_comment.Create(strpnew('checking if equivalent'));
          hp.previous := p2;
          hp.next := p2^.next;
          p2^.next^.previous := hp;
@@ -1576,7 +1576,7 @@ Begin {checks whether two Taicpu instructions are equal}
     Else
       begin
   {$ifdef csdebug}
-        hp := Tai_asm_comment.Create(strpnew('different opcodes/format'));
+        hp := tai_comment.Create(strpnew('different opcodes/format'));
         hp.previous := p2;
         hp.next := p2^.next;
         p2^.next^.previous := hp;
@@ -1585,7 +1585,7 @@ Begin {checks whether two Taicpu instructions are equal}
         InstructionsEquivalent := False;
       end;
   {$ifdef csdebug}
-    hp := Tai_asm_comment.Create(strpnew('instreq: '+tostr(byte(instructionsequivalent))));
+    hp := tai_comment.Create(strpnew('instreq: '+tostr(byte(instructionsequivalent))));
     hp.previous := p2;
     hp.next := p2^.next;
     p2^.next^.previous := hp;
@@ -1896,7 +1896,7 @@ Begin
     top_reg:
       begin
 {$ifdef statedebug}
-        hp := Tai_asm_comment.Create(strpnew('destroying '+std_reg2str[o.reg]));
+        hp := tai_comment.Create(strpnew('destroying '+std_reg2str[o.reg]));
         hp.next := Taiobj^.next;
         hp.previous := Taiobj;
         Taiobj^.next := hp;
@@ -1945,7 +1945,7 @@ Begin
           invalidateDependingRegs(p.optinfo,reg);
           pTaiprop(p.optinfo)^.regs[reg].memwrite := nil;
 {$ifdef StateDebug}
-          hp := Tai_asm_comment.Create(strpnew(std_reg2str[reg]+': '+tostr(PTaiProp(p.optinfo)^.Regs[reg].WState)
+          hp := tai_comment.Create(strpnew(std_reg2str[reg]+': '+tostr(PTaiProp(p.optinfo)^.Regs[reg].WState)
                 + ' -- ' + tostr(PTaiProp(p.optinfo)^.Regs[reg].nrofmods))));
           InsertLLItem(AsmL, p, p.next, hp);
 {$endif StateDebug}
@@ -1953,12 +1953,12 @@ Begin
       Else
         Begin
 {$ifdef statedebug}
-          hp := Tai_asm_comment.Create(strpnew('destroying '+std_reg2str[reg]));
+          hp := tai_comment.Create(strpnew('destroying '+std_reg2str[reg]));
           insertllitem(asml,p,p.next,hp);
 {$endif statedebug}
           DestroyReg(PTaiProp(p.optinfo), Reg, true);
 {$ifdef StateDebug}
-          hp := Tai_asm_comment.Create(strpnew(std_reg2str[reg]+': '+tostr(PTaiProp(p.optinfo)^.Regs[reg].WState)));
+          hp := tai_comment.Create(strpnew(std_reg2str[reg]+': '+tostr(PTaiProp(p.optinfo)^.Regs[reg].WState)));
           InsertLLItem(AsmL, p, p.next, hp);
 {$endif StateDebug}
         End
@@ -2246,7 +2246,7 @@ Begin
                         top_reg:
                           Begin
 {$ifdef statedebug}
-                            hp := Tai_asm_comment.Create(strpnew('destroying '+
+                            hp := tai_comment.Create(strpnew('destroying '+
                               std_reg2str[Taicpu(p).oper[1].reg])));
                             insertllitem(asml,p,p.next,hp);
 {$endif statedebug}
@@ -2275,7 +2275,7 @@ Begin
                           else
                             begin
 {$ifdef statedebug}
-                              hp := Tai_asm_comment.Create(strpnew('destroying & initing '+std_reg2str[tmpreg]));
+                              hp := tai_comment.Create(strpnew('destroying & initing '+std_reg2str[tmpreg]));
                               insertllitem(asml,p,p.next,hp);
 {$endif statedebug}
                               destroyReg(curprop, tmpreg, true);
@@ -2288,7 +2288,7 @@ Begin
                                   end
                             end;
 {$ifdef StateDebug}
-                  hp := Tai_asm_comment.Create(strpnew(std_reg2str[TmpReg]+': '+tostr(CurProp^.regs[TmpReg].WState)));
+                  hp := tai_comment.Create(strpnew(std_reg2str[TmpReg]+': '+tostr(CurProp^.regs[TmpReg].WState)));
                   InsertLLItem(AsmL, p, p.next, hp);
 {$endif StateDebug}
                           End;
@@ -2313,7 +2313,7 @@ Begin
                             Begin
                               TmpReg := Reg32(Taicpu(p).oper[1].reg);
 {$ifdef statedebug}
-          hp := Tai_asm_comment.Create(strpnew('destroying '+std_reg2str[tmpreg]));
+          hp := tai_comment.Create(strpnew('destroying '+std_reg2str[tmpreg]));
           insertllitem(asml,p,p.next,hp);
 {$endif statedebug}
                               With CurProp^.regs[TmpReg] Do
@@ -2340,7 +2340,7 @@ Begin
                      (Taicpu(p).OpCode = A_DIV) Then
                     ReadReg(CurProp,R_EDX);
 {$ifdef statedebug}
-                  hp := Tai_asm_comment.Create(strpnew('destroying eax and edx'));
+                  hp := tai_comment.Create(strpnew('destroying eax and edx'));
                   insertllitem(asml,p,p.next,hp);
 {$endif statedebug}
 {                  DestroyReg(CurProp, R_EAX, true);}
@@ -2357,7 +2357,7 @@ Begin
                       Begin
                         ReadReg(CurProp,R_EAX);
 {$ifdef statedebug}
-                        hp := Tai_asm_comment.Create(strpnew('destroying eax and edx'));
+                        hp := tai_comment.Create(strpnew('destroying eax and edx'));
                         insertllitem(asml,p,p.next,hp);
 {$endif statedebug}
 {                        DestroyReg(CurProp, R_EAX, true); }
@@ -2382,7 +2382,7 @@ Begin
                   else
                     begin
 {$ifdef statedebug}
-                      hp := Tai_asm_comment.Create(strpnew('destroying & initing'+
+                      hp := tai_comment.Create(strpnew('destroying & initing'+
                         std_reg2str[Taicpu(p).oper[1].reg])));
                       insertllitem(asml,p,p.next,hp);
 {$endif statedebug}
@@ -2408,7 +2408,7 @@ Begin
                             If (InstrProp.Ch[Cnt] >= Ch_RWEAX) Then
                               ReadReg(CurProp, TCh2Reg(InstrProp.Ch[Cnt]));
 {$ifdef statedebug}
-                            hp := Tai_asm_comment.Create(strpnew('destroying '+
+                            hp := tai_comment.Create(strpnew('destroying '+
                               std_reg2str[TCh2Reg(InstrProp.Ch[Cnt])])));
                             insertllitem(asml,p,p.next,hp);
 {$endif statedebug}
@@ -2472,7 +2472,7 @@ Begin
                         Else
                           Begin
 {$ifdef statedebug}
-                            hp := Tai_asm_comment.Create(strpnew(
+                            hp := tai_comment.Create(strpnew(
                               'destroying all regs for prev instruction')));
                             insertllitem(asml,p, p.next,hp);
 {$endif statedebug}
@@ -2489,7 +2489,7 @@ Begin
         Else
           Begin
 {$ifdef statedebug}
-            hp := Tai_asm_comment.Create(strpnew(
+            hp := tai_comment.Create(strpnew(
               'destroying all regs: unknown Tai: '+tostr(ord(p.typ)))));
             insertllitem(asml,p, p.next,hp);
 {$endif statedebug}
@@ -2591,7 +2591,13 @@ End.
 
 {
   $Log$
-  Revision 1.42  2002-08-17 09:23:44  florian
+  Revision 1.43  2002-08-18 20:06:29  peter
+    * inlining is now also allowed in interface
+    * renamed write/load to ppuwrite/ppuload
+    * tnode storing in ppu
+    * nld,ncon,nbas are already updated for storing in ppu
+
+  Revision 1.42  2002/08/17 09:23:44  florian
     * first part of procinfo rewrite
 
   Revision 1.41  2002/07/01 18:46:31  peter

+ 12 - 185
compiler/i386/n386cal.pas

@@ -5,7 +5,7 @@
     Generate i386 assembler for in call nodes
 
     This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published bymethodpointer
+    it under the terms of the GNU General Public License as published by
     the Free Software Foundation; either version 2 of the License, or
     (at your option) any later version.
 
@@ -42,9 +42,6 @@ interface
           procedure pass_2;override;
        end;
 
-       ti386procinlinenode = class(tprocinlinenode)
-          procedure pass_2;override;
-       end;
 
 implementation
 
@@ -376,7 +373,7 @@ implementation
              Comment(V_debug,
                'inlined parasymtable is at offset '
                +tostr(tprocdef(procdefinition).parast.address_fixup));
-             exprasmList.concat(Tai_asm_comment.Create(
+             exprasmList.concat(tai_comment.Create(
                strpnew('inlined parasymtable is at offset '
                +tostr(tprocdef(procdefinition).parast.address_fixup))));
 {$endif extdebug}
@@ -501,7 +498,8 @@ implementation
            end;
 
          { Allocate return value for inlined routines }
-         if inlined then
+         if inlined and
+            (resulttype.def.size>0) then
            inlinecode.retoffset:=tg.gettempofsizepersistant(exprasmlist,Align(resulttype.def.size,aktalignment.paraalign));
 
          { Allocate return value when returned in argument }
@@ -526,7 +524,7 @@ implementation
 {$ifdef extdebug}
                    Comment(V_debug,'function return value is at offset '
                                    +tostr(funcretref.offset));
-                   exprasmlist.concat(tai_asm_comment.create(
+                   exprasmlist.concat(tai_comment.create(
                                        strpnew('function return value is at offset '
                                                +tostr(funcretref.offset))));
 {$endif extdebug}
@@ -1305,190 +1303,19 @@ implementation
            end;
       end;
 
-
-
-{*****************************************************************************
-                             TI386PROCINLINENODE
-*****************************************************************************}
-
-
-    procedure ti386procinlinenode.pass_2;
-       var st : tsymtable;
-           oldprocdef : tprocdef;
-           ps, i : longint;
-           tmpreg: tregister;
-           oldprocinfo : tprocinfo;
-           oldinlining_procedure,
-           nostackframe,make_global : boolean;
-           inlineentrycode,inlineexitcode : TAAsmoutput;
-           oldexitlabel,oldexit2label,oldquickexitlabel:tasmlabel;
-           oldregstate: pointer;
-{$ifdef GDB}
-           startlabel,endlabel : tasmlabel;
-           pp : pchar;
-           mangled_length  : longint;
-{$endif GDB}
-       begin
-          { deallocate the registers used for the current procedure's regvars }
-          if assigned(aktprocdef.regvarinfo) then
-            begin
-              with pregvarinfo(aktprocdef.regvarinfo)^ do
-                for i := 1 to maxvarregs do
-                  if assigned(regvars[i]) then
-                    store_regvar(exprasmlist,regvars[i].reg);
-              rg.saveStateForInline(oldregstate);
-              { make sure the register allocator knows what the regvars in the }
-              { inlined code block are (JM)                                    }
-              rg.resetusableregisters;
-              rg.clearregistercount;
-              rg.cleartempgen;
-              if assigned(inlineprocdef.regvarinfo) then
-                with pregvarinfo(inlineprocdef.regvarinfo)^ do
-                  for i := 1 to maxvarregs do
-                    if assigned(regvars[i]) then
-                      begin
-                        tmpreg:=rg.makeregsize(regvars[i].reg,OS_INT);
-                        rg.makeregvar(tmpreg);
-                      end;
-            end;
-          oldinlining_procedure:=inlining_procedure;
-          oldexitlabel:=aktexitlabel;
-          oldexit2label:=aktexit2label;
-          oldquickexitlabel:=quickexitlabel;
-          objectlibrary.getlabel(aktexitlabel);
-          objectlibrary.getlabel(aktexit2label);
-          { we're inlining a procedure }
-          inlining_procedure:=true;
-          oldprocdef:=aktprocdef;
-
-          aktprocdef:=inlineprocdef;
-
-          { save old procinfo }
-          oldprocinfo:=procinfo;
-
-          { clone }
-          procinfo:=tprocinfo(cprocinfo.newinstance);
-          move(pointer(oldprocinfo)^,pointer(procinfo)^,cprocinfo.InstanceSize);
-
-          { set new procinfo }
-          procinfo.return_offset:=retoffset;
-          procinfo.para_offset:=para_offset;
-          procinfo.no_fast_exit:=false;
-
-          { arg space has been filled by the parent secondcall }
-          st:=aktprocdef.localst;
-          { set it to the same lexical level }
-          st.symtablelevel:=oldprocdef.localst.symtablelevel;
-          if st.datasize>0 then
-            begin
-              st.address_fixup:=tg.gettempofsizepersistant(exprasmlist,st.datasize)+st.datasize;
-{$ifdef extdebug}
-              Comment(V_debug,'local symtable is at offset '+tostr(st.address_fixup));
-              exprasmList.concat(Tai_asm_comment.Create(strpnew(
-                'local symtable is at offset '+tostr(st.address_fixup))));
-{$endif extdebug}
-            end;
-          exprasmList.concat(Tai_Marker.Create(InlineStart));
-{$ifdef extdebug}
-          exprasmList.concat(Tai_asm_comment.Create(strpnew('Start of inlined proc')));
-{$endif extdebug}
-{$ifdef GDB}
-          if (cs_debuginfo in aktmoduleswitches) then
-            begin
-              objectlibrary.getaddrlabel(startlabel);
-              objectlibrary.getaddrlabel(endlabel);
-              cg.a_label(exprasmlist,startlabel);
-              inlineprocdef.localst.symtabletype:=inlinelocalsymtable;
-              inlineprocdef.parast.symtabletype:=inlineparasymtable;
-
-              { Here we must include the para and local symtable info }
-              inlineprocdef.concatstabto(withdebuglist);
-
-              { set it back for safety }
-              inlineprocdef.localst.symtabletype:=localsymtable;
-              inlineprocdef.parast.symtabletype:=parasymtable;
-
-              mangled_length:=length(oldprocdef.mangledname);
-              getmem(pp,mangled_length+50);
-              strpcopy(pp,'192,0,0,'+startlabel.name);
-              if (target_info.use_function_relative_addresses) then
-                begin
-                  strpcopy(strend(pp),'-');
-                  strpcopy(strend(pp),oldprocdef.mangledname);
-                end;
-              withdebugList.concat(Tai_stabn.Create(strnew(pp)));
-            end;
-{$endif GDB}
-          { takes care of local data initialization }
-          inlineentrycode:=TAAsmoutput.Create;
-          inlineexitcode:=TAAsmoutput.Create;
-          ps:=para_size;
-          make_global:=false; { to avoid warning }
-          genentrycode(inlineentrycode,make_global,0,ps,nostackframe,true);
-          if po_assembler in aktprocdef.procoptions then
-            inlineentrycode.insert(Tai_marker.Create(asmblockstart));
-          exprasmList.concatlist(inlineentrycode);
-          secondpass(inlinetree);
-          genexitcode(inlineexitcode,0,false,true);
-          if po_assembler in aktprocdef.procoptions then
-            inlineexitcode.concat(Tai_marker.Create(asmblockend));
-          exprasmList.concatlist(inlineexitcode);
-
-          inlineentrycode.free;
-          inlineexitcode.free;
-{$ifdef extdebug}
-          exprasmList.concat(Tai_asm_comment.Create(strpnew('End of inlined proc')));
-{$endif extdebug}
-          exprasmList.concat(Tai_Marker.Create(InlineEnd));
-
-          {we can free the local data now, reset also the fixup address }
-          if st.datasize>0 then
-            begin
-              tg.ungetpersistanttemp(exprasmlist,st.address_fixup-st.datasize);
-              st.address_fixup:=0;
-            end;
-          { restore procinfo }
-          procinfo.free;
-          procinfo:=oldprocinfo;
-{$ifdef GDB}
-          if (cs_debuginfo in aktmoduleswitches) then
-            begin
-              cg.a_label(exprasmlist,endlabel);
-              strpcopy(pp,'224,0,0,'+endlabel.name);
-             if (target_info.use_function_relative_addresses) then
-               begin
-                 strpcopy(strend(pp),'-');
-                 strpcopy(strend(pp),oldprocdef.mangledname);
-               end;
-              withdebugList.concat(Tai_stabn.Create(strnew(pp)));
-              freemem(pp,mangled_length+50);
-            end;
-{$endif GDB}
-          { restore }
-          aktprocdef:=oldprocdef;
-          aktexitlabel:=oldexitlabel;
-          aktexit2label:=oldexit2label;
-          quickexitlabel:=oldquickexitlabel;
-          inlining_procedure:=oldinlining_procedure;
-
-          { reallocate the registers used for the current procedure's regvars, }
-          { since they may have been used and then deallocated in the inlined  }
-          { procedure (JM)                                                     }
-          if assigned(aktprocdef.regvarinfo) then
-            begin
-              rg.restoreStateAfterInline(oldregstate);
-            end;
-       end;
-
-
 begin
    ccallparanode:=ti386callparanode;
    ccallnode:=ti386callnode;
-   cprocinlinenode:=ti386procinlinenode;
 end.
 {
   $Log$
-  Revision 1.64  2002-08-17 09:23:45  florian
+  Revision 1.65  2002-08-18 20:06:30  peter
+    * inlining is now also allowed in interface
+    * renamed write/load to ppuwrite/ppuload
+    * tnode storing in ppu
+    * nld,ncon,nbas are already updated for storing in ppu
+
+  Revision 1.64  2002/08/17 09:23:45  florian
     * first part of procinfo rewrite
 
   Revision 1.63  2002/08/12 15:08:42  carl

+ 9 - 3
compiler/i386/popt386.pas

@@ -506,7 +506,7 @@ Var
               if not FindAnyLabel(p1,l) then
                 begin
   {$ifdef finaldestdebug}
-                  insertllitem(asml,p1,p1.next,Tai_asm_comment.Create(
+                  insertllitem(asml,p1,p1.next,tai_comment.Create(
                     strpnew('previous label inserted'))));
   {$endif finaldestdebug}
                   objectlibrary.getlabel(l);
@@ -522,7 +522,7 @@ Var
               else
                 begin
   {$ifdef finaldestdebug}
-                  insertllitem(asml,p1,p1.next,Tai_asm_comment.Create(
+                  insertllitem(asml,p1,p1.next,tai_comment.Create(
                     strpnew('next label reused'))));
   {$endif finaldestdebug}
                   inc(l.refs);
@@ -2044,7 +2044,13 @@ End.
 
 {
   $Log$
-  Revision 1.33  2002-08-17 09:23:46  florian
+  Revision 1.34  2002-08-18 20:06:30  peter
+    * inlining is now also allowed in interface
+    * renamed write/load to ppuwrite/ppuload
+    * tnode storing in ppu
+    * nld,ncon,nbas are already updated for storing in ppu
+
+  Revision 1.33  2002/08/17 09:23:46  florian
     * first part of procinfo rewrite
 
   Revision 1.32  2002/08/11 14:32:30  peter

+ 60 - 2
compiler/nbas.pas

@@ -27,7 +27,10 @@ unit nbas;
 interface
 
     uses
-       aasmbase,aasmtai,aasmcpu,symtype,node,cpubase;
+       cpubase,
+       aasmbase,aasmtai,aasmcpu,
+       node,
+       symtype,symppu;
 
     type
        tnothingnode = class(tnode)
@@ -48,6 +51,9 @@ interface
           p_asm : taasmoutput;
           constructor create(p : taasmoutput);virtual;
           destructor destroy;override;
+          constructor ppuload(t:tnodetype;ppufile:tcompilerppufile);override;
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
+          procedure derefimpl;override;
           function getcopy : tnode;override;
           function pass_1 : tnode;override;
           function det_resulttype:tnode;override;
@@ -471,6 +477,52 @@ implementation
         inherited destroy;
       end;
 
+
+    constructor tasmnode.ppuload(t:tnodetype;ppufile:tcompilerppufile);
+      var
+        hp : tai;
+      begin
+        inherited ppuload(t,ppufile);
+        p_asm:=taasmoutput.create;
+        repeat
+          hp:=ppuloadai(ppufile);
+          if hp=nil then
+           break;
+          p_asm.concat(hp);
+        until false;
+      end;
+
+
+    procedure tasmnode.ppuwrite(ppufile:tcompilerppufile);
+      var
+        hp : tai;
+      begin
+        inherited ppuwrite(ppufile);
+        hp:=tai(p_asm.first);
+        while assigned(hp) do
+         begin
+           ppuwriteai(ppufile,hp);
+           hp:=tai(hp.next);
+         end;
+        { end is marked by a nil }
+        ppuwriteai(ppufile,nil);
+      end;
+
+
+    procedure tasmnode.derefimpl;
+      var
+        hp : tai;
+      begin
+        inherited derefimpl;
+        hp:=tai(p_asm.first);
+        while assigned(hp) do
+         begin
+           hp.derefimpl;
+           hp:=tai(hp.next);
+         end;
+      end;
+
+
     function tasmnode.getcopy: tnode;
       var
         n: tasmnode;
@@ -694,7 +746,13 @@ begin
 end.
 {
   $Log$
-  Revision 1.33  2002-08-17 22:09:44  florian
+  Revision 1.34  2002-08-18 20:06:23  peter
+    * inlining is now also allowed in interface
+    * renamed write/load to ppuwrite/ppuload
+    * tnode storing in ppu
+    * nld,ncon,nbas are already updated for storing in ppu
+
+  Revision 1.33  2002/08/17 22:09:44  florian
     * result type handling in tcgcal.pass_2 overhauled
     * better tnode.dowrite
     * some ppc stuff fixed

+ 22 - 11
compiler/ncgcal.pas

@@ -64,6 +64,9 @@ implementation
       cginfo,cgbase,pass_2,
       cpuinfo,cpubase,cpupi,aasmbase,aasmtai,aasmcpu,
       nmem,nld,ncnv,
+{$ifdef i386}
+      cga,
+{$endif i386}
       ncgutil,cgobj,tgobj,regvars,rgobj,rgcpu,cg64f32,cgcpu;
 
 {*****************************************************************************
@@ -374,7 +377,7 @@ implementation
              Comment(V_debug,
                'inlined parasymtable is at offset '
                +tostr(tprocdef(procdefinition).parast.address_fixup));
-             exprasmList.concat(Tai_asm_comment.Create(
+             exprasmList.concat(tai_comment.Create(
                strpnew('inlined parasymtable is at offset '
                +tostr(tprocdef(procdefinition).parast.address_fixup))));
 {$endif extdebug}
@@ -528,7 +531,7 @@ implementation
 {$ifdef extdebug}
                    Comment(V_debug,'function return value is at offset '
                                    +tostr(funcretref.offset));
-                   exprasmlist.concat(tai_asm_comment.create(
+                   exprasmlist.concat(tai_comment.create(
                                        strpnew('function return value is at offset '
                                                +tostr(funcretref.offset))));
 {$endif extdebug}
@@ -1332,19 +1335,21 @@ implementation
           oldexitlabel:=aktexitlabel;
           oldexit2label:=aktexit2label;
           oldquickexitlabel:=quickexitlabel;
+          oldprocdef:=aktprocdef;
+          oldprocinfo:=procinfo;
           objectlibrary.getlabel(aktexitlabel);
           objectlibrary.getlabel(aktexit2label);
           { we're inlining a procedure }
           inlining_procedure:=true;
-          oldprocdef:=aktprocdef;
-
           aktprocdef:=inlineprocdef;
-          { save old procinfo }
-          oldprocinfo:=procinfo;
 
-          { clone }
+          { clone procinfo, but not the asmlists }
           procinfo:=tprocinfo(cprocinfo.newinstance);
           move(pointer(oldprocinfo)^,pointer(procinfo)^,cprocinfo.InstanceSize);
+          procinfo.aktentrycode:=nil;
+          procinfo.aktexitcode:=nil;
+          procinfo.aktproccode:=nil;
+          procinfo.aktlocaldata:=nil;
 
           { set new procinfo }
           procinfo.return_offset:=retoffset;
@@ -1360,13 +1365,13 @@ implementation
               st.address_fixup:=tg.gettempofsizepersistant(exprasmlist,st.datasize)+st.datasize;
 {$ifdef extdebug}
               Comment(V_debug,'local symtable is at offset '+tostr(st.address_fixup));
-              exprasmList.concat(Tai_asm_comment.Create(strpnew(
+              exprasmList.concat(tai_comment.Create(strpnew(
                 'local symtable is at offset '+tostr(st.address_fixup))));
 {$endif extdebug}
             end;
           exprasmList.concat(Tai_Marker.Create(InlineStart));
 {$ifdef extdebug}
-          exprasmList.concat(Tai_asm_comment.Create(strpnew('Start of inlined proc')));
+          exprasmList.concat(tai_comment.Create(strpnew('Start of inlined proc')));
 {$endif extdebug}
 {$ifdef GDB}
           if (cs_debuginfo in aktmoduleswitches) then
@@ -1413,7 +1418,7 @@ implementation
           inlineentrycode.free;
           inlineexitcode.free;
 {$ifdef extdebug}
-          exprasmList.concat(Tai_asm_comment.Create(strpnew('End of inlined proc')));
+          exprasmList.concat(tai_comment.Create(strpnew('End of inlined proc')));
 {$endif extdebug}
           exprasmList.concat(Tai_Marker.Create(InlineEnd));
 
@@ -1464,7 +1469,13 @@ begin
 end.
 {
   $Log$
-  Revision 1.11  2002-08-17 22:09:44  florian
+  Revision 1.12  2002-08-18 20:06:23  peter
+    * inlining is now also allowed in interface
+    * renamed write/load to ppuwrite/ppuload
+    * tnode storing in ppu
+    * nld,ncon,nbas are already updated for storing in ppu
+
+  Revision 1.11  2002/08/17 22:09:44  florian
     * result type handling in tcgcal.pass_2 overhauled
     * better tnode.dowrite
     * some ppc stuff fixed

+ 12 - 6
compiler/ncgcon.pas

@@ -79,13 +79,13 @@ implementation
       { constants are actually supported by the target processor? (JM) }
 
       const
-        floattype2ait:array[tfloattype] of tait=
+        floattype2ait:array[tfloattype] of taitype=
           (ait_real_32bit,ait_real_64bit,ait_real_80bit,ait_comp_64bit,ait_comp_64bit);
 
       var
          hp1 : tai;
          lastlabel : tasmlabel;
-         realait : tait;
+         realait : taitype;
 
       begin
         location_reset(location,LOC_CREFERENCE,def_cgsize(resulttype.def));
@@ -385,10 +385,10 @@ implementation
 
     procedure tcgsetconstnode.pass_2;
       var
-         hp1     : tai;
+         hp1         : tai;
          lastlabel   : tasmlabel;
-         i         : longint;
-         neededtyp   : tait;
+         i           : longint;
+         neededtyp   : taitype;
       type
          setbytes=array[0..31] of byte;
          Psetbytes=^setbytes;
@@ -525,7 +525,13 @@ begin
 end.
 {
   $Log$
-  Revision 1.18  2002-08-11 14:32:26  peter
+  Revision 1.19  2002-08-18 20:06:23  peter
+    * inlining is now also allowed in interface
+    * renamed write/load to ppuwrite/ppuload
+    * tnode storing in ppu
+    * nld,ncon,nbas are already updated for storing in ppu
+
+  Revision 1.18  2002/08/11 14:32:26  peter
     * renamed current_library to objectlibrary
 
   Revision 1.17  2002/08/11 13:24:11  peter

+ 174 - 6
compiler/ncon.pas

@@ -30,7 +30,7 @@ interface
       globtype,widestr,
       node,
       aasmbase,aasmtai,cpuinfo,globals,
-      symconst,symtype,symdef,symsym;
+      symconst,symppu,symtype,symdef,symsym;
 
     type
        trealconstnode = class(tnode)
@@ -38,6 +38,9 @@ interface
           value_real : bestreal;
           lab_real : tasmlabel;
           constructor create(v : bestreal;const t:ttype);virtual;
+          constructor ppuload(t:tnodetype;ppufile:tcompilerppufile);override;
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
+          procedure derefimpl;override;
           function getcopy : tnode;override;
           function pass_1 : tnode;override;
           function det_resulttype:tnode;override;
@@ -49,6 +52,9 @@ interface
           restype : ttype;
           value : TConstExprInt;
           constructor create(v : tconstexprint;const t:ttype);virtual;
+          constructor ppuload(t:tnodetype;ppufile:tcompilerppufile);override;
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
+          procedure derefimpl;override;
           function getcopy : tnode;override;
           function pass_1 : tnode;override;
           function det_resulttype:tnode;override;
@@ -63,6 +69,9 @@ interface
           restype : ttype;
           value   : TConstPtrUInt;
           constructor create(v : TConstPtrUInt;const t:ttype);virtual;
+          constructor ppuload(t:tnodetype;ppufile:tcompilerppufile);override;
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
+          procedure derefimpl;override;
           function getcopy : tnode;override;
           function pass_1 : tnode;override;
           function det_resulttype:tnode;override;
@@ -78,6 +87,9 @@ interface
           constructor createstr(const s : string;st:tstringtype);virtual;
           constructor createpchar(s : pchar;l : longint);virtual;
           constructor createwstr(w : pcompilerwidestring);virtual;
+          constructor ppuload(t:tnodetype;ppufile:tcompilerppufile);override;
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
+          procedure derefimpl;override;
           destructor destroy;override;
           function getcopy : tnode;override;
           function pass_1 : tnode;override;
@@ -93,6 +105,9 @@ interface
           lab_set : tasmlabel;
           constructor create(s : pconstset;const t:ttype);virtual;
           destructor destroy;override;
+          constructor ppuload(t:tnodetype;ppufile:tcompilerppufile);override;
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
+          procedure derefimpl;override;
           function getcopy : tnode;override;
           function pass_1 : tnode;override;
           function det_resulttype:tnode;override;
@@ -110,6 +125,8 @@ interface
        tguidconstnode = class(tnode)
           value : tguid;
           constructor create(const g:tguid);virtual;
+          constructor ppuload(t:tnodetype;ppufile:tcompilerppufile);override;
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
           function getcopy : tnode;override;
           function pass_1 : tnode;override;
           function det_resulttype:tnode;override;
@@ -269,7 +286,7 @@ implementation
 
     begin
         is_emptyset:=(p.nodetype=setconstn) and
-	 (Tsetconstnode(p).value_set^=[]);
+         (Tsetconstnode(p).value_set^=[]);
     end;
 {$endif}
 
@@ -329,6 +346,32 @@ implementation
          lab_real:=nil;
       end;
 
+    constructor trealconstnode.ppuload(t:tnodetype;ppufile:tcompilerppufile);
+      begin
+        inherited ppuload(t,ppufile);
+        ppufile.gettype(restype);
+        value_real:=ppufile.getreal;
+        lab_real:=tasmlabel(ppufile.getasmsymbol);
+      end;
+
+
+    procedure trealconstnode.ppuwrite(ppufile:tcompilerppufile);
+      begin
+        inherited ppuwrite(ppufile);
+        ppufile.puttype(restype);
+        ppufile.putreal(value_real);
+        ppufile.putasmsymbol(lab_real);
+      end;
+
+
+    procedure trealconstnode.derefimpl;
+      begin
+        inherited derefimpl;
+        restype.resolve;
+        objectlibrary.derefasmsymbol(lab_real);
+      end;
+
+
     function trealconstnode.getcopy : tnode;
 
       var
@@ -362,6 +405,7 @@ implementation
           (value_real = trealconstnode(p).value_real);
       end;
 
+
 {*****************************************************************************
                               TORDCONSTNODE
 *****************************************************************************}
@@ -374,6 +418,30 @@ implementation
          restype:=t;
       end;
 
+
+    constructor tordconstnode.ppuload(t:tnodetype;ppufile:tcompilerppufile);
+      begin
+        inherited ppuload(t,ppufile);
+        ppufile.gettype(restype);
+        value:=ppufile.getexprint;
+      end;
+
+
+    procedure tordconstnode.ppuwrite(ppufile:tcompilerppufile);
+      begin
+        inherited ppuwrite(ppufile);
+        ppufile.puttype(restype);
+        ppufile.putexprint(value);
+      end;
+
+
+    procedure tordconstnode.derefimpl;
+      begin
+        inherited derefimpl;
+        restype.resolve;
+      end;
+
+
     function tordconstnode.getcopy : tnode;
 
       var
@@ -413,7 +481,7 @@ implementation
     procedure Tordconstnode._dowrite;
 
     begin
-	inherited _dowrite;
+        inherited _dowrite;
         system.write(writenodeindention,',value = ',value);
     end;
 {$endif}
@@ -430,6 +498,30 @@ implementation
          restype:=t;
       end;
 
+
+    constructor tpointerconstnode.ppuload(t:tnodetype;ppufile:tcompilerppufile);
+      begin
+        inherited ppuload(t,ppufile);
+        ppufile.gettype(restype);
+        value:=ppufile.getptruint;
+      end;
+
+
+    procedure tpointerconstnode.ppuwrite(ppufile:tcompilerppufile);
+      begin
+        inherited ppuwrite(ppufile);
+        ppufile.puttype(restype);
+        ppufile.putptruint(value);
+      end;
+
+
+    procedure tpointerconstnode.derefimpl;
+      begin
+        inherited derefimpl;
+        restype.resolve;
+      end;
+
+
     function tpointerconstnode.getcopy : tnode;
 
       var
@@ -516,6 +608,7 @@ implementation
          lab_str:=nil;
       end;
 
+
     destructor tstringconstnode.destroy;
       begin
         if st_type=st_widestring then
@@ -525,6 +618,36 @@ implementation
         inherited destroy;
       end;
 
+
+    constructor tstringconstnode.ppuload(t:tnodetype;ppufile:tcompilerppufile);
+      begin
+        inherited ppuload(t,ppufile);
+        st_type:=tstringtype(ppufile.getbyte);
+        len:=ppufile.getlongint;
+        getmem(value_str,len+1);
+        ppufile.getdata(value_str^,len);
+        value_str[len]:=#0;
+        lab_str:=tasmlabel(ppufile.getasmsymbol);
+      end;
+
+
+    procedure tstringconstnode.ppuwrite(ppufile:tcompilerppufile);
+      begin
+        inherited ppuwrite(ppufile);
+        ppufile.putbyte(byte(st_type));
+        ppufile.putlongint(len);
+        ppufile.putdata(value_str^,len);
+        ppufile.putasmsymbol(lab_str);
+      end;
+
+
+    procedure tstringconstnode.derefimpl;
+      begin
+        inherited derefimpl;
+        objectlibrary.derefasmsymbol(lab_str);
+      end;
+
+
     function tstringconstnode.getcopy : tnode;
 
       var
@@ -614,6 +737,31 @@ implementation
         inherited destroy;
       end;
 
+
+    constructor tsetconstnode.ppuload(t:tnodetype;ppufile:tcompilerppufile);
+      begin
+        inherited ppuload(t,ppufile);
+        ppufile.gettype(restype);
+        new(value_set);
+        ppufile.getdata(value_set^,sizeof(tconstset));
+      end;
+
+
+    procedure tsetconstnode.ppuwrite(ppufile:tcompilerppufile);
+      begin
+        inherited ppuwrite(ppufile);
+        ppufile.puttype(restype);
+        ppufile.putdata(value_set^,sizeof(tconstset));
+      end;
+
+
+    procedure tsetconstnode.derefimpl;
+      begin
+        inherited derefimpl;
+        restype.resolve;
+      end;
+
+
     function tsetconstnode.getcopy : tnode;
 
       var
@@ -670,8 +818,8 @@ implementation
     function tsetconstnode.docompare(p: tnode): boolean;
 
     begin
-	docompare:=(inherited docompare(p))
-	 and (value_set^=Tsetconstnode(p).value_set^);
+        docompare:=(inherited docompare(p))
+         and (value_set^=Tsetconstnode(p).value_set^);
     end;
 {$endif}
 
@@ -708,6 +856,20 @@ implementation
          value:=g;
       end;
 
+    constructor tguidconstnode.ppuload(t:tnodetype;ppufile:tcompilerppufile);
+      begin
+        inherited ppuload(t,ppufile);
+        ppufile.getguid(value);
+      end;
+
+
+    procedure tguidconstnode.ppuwrite(ppufile:tcompilerppufile);
+      begin
+        inherited ppuwrite(ppufile);
+        ppufile.putguid(value);
+      end;
+
+
     function tguidconstnode.getcopy : tnode;
 
       var
@@ -750,7 +912,13 @@ begin
 end.
 {
   $Log$
-  Revision 1.38  2002-08-17 22:09:45  florian
+  Revision 1.39  2002-08-18 20:06:23  peter
+    * inlining is now also allowed in interface
+    * renamed write/load to ppuwrite/ppuload
+    * tnode storing in ppu
+    * nld,ncon,nbas are already updated for storing in ppu
+
+  Revision 1.38  2002/08/17 22:09:45  florian
     * result type handling in tcgcal.pass_2 overhauled
     * better tnode.dowrite
     * some ppc stuff fixed

+ 147 - 20
compiler/nld.pas

@@ -31,15 +31,18 @@ interface
        {$ifdef state_tracking}
        nstate,
        {$endif}
-       symconst,symbase,symtype,symsym,symdef;
+       symconst,symppu,symbase,symtype,symsym,symdef;
 
     type
        tloadnode = class(tunarynode)
           symtableentry : tsym;
           symtable : tsymtable;
-          procdeflist : tprocdef;
+          procdef : tprocdef;
           constructor create(v : tsym;st : tsymtable);virtual;
           constructor create_procvar(v : tsym;d:tprocdef;st : tsymtable);virtual;
+          constructor ppuload(t:tnodetype;ppufile:tcompilerppufile);override;
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
+          procedure derefimpl;override;
           procedure set_mp(p:tnode);
           function  getcopy : tnode;override;
           function  pass_1 : tnode;override;
@@ -57,6 +60,8 @@ interface
        tassignmentnode = class(tbinarynode)
           assigntype : tassigntype;
           constructor create(l,r : tnode);virtual;
+          constructor ppuload(t:tnodetype;ppufile:tcompilerppufile);override;
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
           function getcopy : tnode;override;
           function pass_1 : tnode;override;
           function det_resulttype:tnode;override;
@@ -70,6 +75,9 @@ interface
        tfuncretnode = class(tnode)
           funcretsym : tfuncretsym;
           constructor create(v:tsym);virtual;
+          constructor ppuload(t:tnodetype;ppufile:tcompilerppufile);override;
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
+          procedure derefimpl;override;
           function getcopy : tnode;override;
           function pass_1 : tnode;override;
           function det_resulttype:tnode;override;
@@ -98,6 +106,9 @@ interface
           allowed : boolean;
           restype : ttype;
           constructor create(t : ttype);virtual;
+          constructor ppuload(t:tnodetype;ppufile:tcompilerppufile);override;
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
+          procedure derefimpl;override;
           function pass_1 : tnode;override;
           function det_resulttype:tnode;override;
           function docompare(p: tnode): boolean; override;
@@ -109,6 +120,9 @@ interface
           rttitype : trttitype;
           rttidef : tstoreddef;
           constructor create(def:tstoreddef;rt:trttitype);virtual;
+          constructor ppuload(t:tnodetype;ppufile:tcompilerppufile);override;
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
+          procedure derefimpl;override;
           function  getcopy : tnode;override;
           function pass_1 : tnode;override;
           procedure pass_2;override;
@@ -148,7 +162,7 @@ implementation
           internalerror(200108121);
          symtableentry:=v;
          symtable:=st;
-         procdeflist:=nil;
+         procdef:=nil;
       end;
 
     constructor tloadnode.create_procvar(v : tsym;d:tprocdef;st : tsymtable);
@@ -158,9 +172,37 @@ implementation
           internalerror(200108121);
          symtableentry:=v;
          symtable:=st;
-         procdeflist:=d;
+         procdef:=d;
       end;
 
+
+    constructor tloadnode.ppuload(t:tnodetype;ppufile:tcompilerppufile);
+      begin
+        inherited ppuload(t,ppufile);
+        symtableentry:=tsym(ppufile.getderef);
+{$warning FIXME: No withsymtable support}
+        symtable:=nil;
+        procdef:=tprocdef(ppufile.getderef);
+      end;
+
+
+    procedure tloadnode.ppuwrite(ppufile:tcompilerppufile);
+      begin
+        inherited ppuwrite(ppufile);
+        ppufile.putderef(symtableentry);
+        ppufile.putderef(procdef);
+      end;
+
+
+    procedure tloadnode.derefimpl;
+      begin
+        inherited derefimpl;
+        resolvesym(pointer(symtableentry));
+        symtable:=symtableentry.owner;
+        resolvedef(pointer(procdef));
+      end;
+
+
     procedure tloadnode.set_mp(p:tnode);
       begin
         left:=p;
@@ -262,14 +304,14 @@ implementation
                   resulttype:=ttypedconstsym(symtableentry).typedconsttype;
             procsym :
                 begin
-                   if not assigned(procdeflist) then
+                   if not assigned(procdef) then
                     begin
                       if assigned(tprocsym(symtableentry).defs^.next) then
                        CGMessage(parser_e_no_overloaded_procvars);
                       resulttype.setdef(tprocsym(symtableentry).defs^.def);
                     end
                    else
-                    resulttype.setdef(procdeflist);
+                    resulttype.setdef(procdef);
 
                    if (m_tp_procvar in aktmodeswitches) then
                     begin
@@ -426,6 +468,21 @@ implementation
          assigntype:=at_normal;
       end;
 
+
+    constructor tassignmentnode.ppuload(t:tnodetype;ppufile:tcompilerppufile);
+      begin
+        inherited ppuload(t,ppufile);
+        assigntype:=tassigntype(ppufile.getbyte);
+      end;
+
+
+    procedure tassignmentnode.ppuwrite(ppufile:tcompilerppufile);
+      begin
+        inherited ppuwrite(ppufile);
+        ppufile.putbyte(byte(assigntype));
+      end;
+
+
     function tassignmentnode.getcopy : tnode;
 
       var
@@ -596,18 +653,18 @@ implementation
     var se:Tstate_entry;
 
     begin
-	track_state_pass:=false;
-	if exec_known then
-	    begin
-		track_state_pass:=right.track_state_pass(exec_known);
-		{Force a new resulttype pass.}
-		right.resulttype.def:=nil;
-		do_resulttypepass(right);
-		resulttypepass(right);
-		aktstate.store_fact(left.getcopy,right.getcopy);
-	    end
-	else
-	    aktstate.delete_fact(left);
+        track_state_pass:=false;
+        if exec_known then
+            begin
+                track_state_pass:=right.track_state_pass(exec_known);
+                {Force a new resulttype pass.}
+                right.resulttype.def:=nil;
+                do_resulttypepass(right);
+                resulttypepass(right);
+                aktstate.store_fact(left.getcopy,right.getcopy);
+            end
+        else
+            aktstate.delete_fact(left);
     end;
 {$endif}
 
@@ -623,6 +680,26 @@ implementation
       end;
 
 
+    constructor tfuncretnode.ppuload(t:tnodetype;ppufile:tcompilerppufile);
+      begin
+        inherited ppuload(t,ppufile);
+        funcretsym:=tfuncretsym(ppufile.getderef);
+      end;
+
+
+    procedure tfuncretnode.ppuwrite(ppufile:tcompilerppufile);
+      begin
+        inherited ppuwrite(ppufile);
+        ppufile.putderef(funcretsym);
+      end;
+
+
+    procedure tfuncretnode.derefimpl;
+      begin
+        resolvesym(pointer(funcretsym));
+      end;
+
+
     function tfuncretnode.getcopy : tnode;
       var
          n : tfuncretnode;
@@ -901,6 +978,28 @@ implementation
       end;
 
 
+    constructor ttypenode.ppuload(t:tnodetype;ppufile:tcompilerppufile);
+      begin
+        inherited ppuload(t,ppufile);
+        ppufile.gettype(restype);
+        allowed:=boolean(ppufile.getbyte);
+      end;
+
+
+    procedure ttypenode.ppuwrite(ppufile:tcompilerppufile);
+      begin
+        inherited ppuwrite(ppufile);
+        ppufile.puttype(restype);
+        ppufile.putbyte(byte(allowed));
+      end;
+
+
+    procedure ttypenode.derefimpl;
+      begin
+        restype.resolve;
+      end;
+
+
     function ttypenode.det_resulttype:tnode;
       begin
         result:=nil;
@@ -943,6 +1042,28 @@ implementation
       end;
 
 
+    constructor trttinode.ppuload(t:tnodetype;ppufile:tcompilerppufile);
+      begin
+        inherited ppuload(t,ppufile);
+        rttidef:=tstoreddef(ppufile.getderef);
+        rttitype:=trttitype(ppufile.getbyte);
+      end;
+
+
+    procedure trttinode.ppuwrite(ppufile:tcompilerppufile);
+      begin
+        inherited ppuwrite(ppufile);
+        ppufile.putderef(rttidef);
+        ppufile.putbyte(byte(rttitype));
+      end;
+
+
+    procedure trttinode.derefimpl;
+      begin
+        resolvedef(pointer(rttidef));
+      end;
+
+
     function trttinode.getcopy : tnode;
       var
          n : trttinode;
@@ -996,7 +1117,13 @@ begin
 end.
 {
   $Log$
-  Revision 1.51  2002-08-17 22:09:46  florian
+  Revision 1.52  2002-08-18 20:06:23  peter
+    * inlining is now also allowed in interface
+    * renamed write/load to ppuwrite/ppuload
+    * tnode storing in ppu
+    * nld,ncon,nbas are already updated for storing in ppu
+
+  Revision 1.51  2002/08/17 22:09:46  florian
     * result type handling in tcgcal.pass_2 overhauled
     * better tnode.dowrite
     * some ppc stuff fixed
@@ -1010,7 +1137,7 @@ end.
     + Willamette/SSE2 instructions to assembler added
 
   Revision 1.48  2002/07/20 07:44:37  daniel
-  * Forgot to add a {$ifdef extdebug}
+  * Forgot to add a $ifdef extdebug
 
   Revision 1.47  2002/07/19 12:55:27  daniel
   * Further developed state tracking in whilerepeatn

+ 110 - 49
compiler/node.pas

@@ -44,6 +44,7 @@ interface
 {$endif}
 
        tnodetype = (
+          emptynode,        {No node (returns nil when loading from ppu)}
           addn,             {Represents the + operator}
           muln,             {Represents the * operator}
           subn,             {Represents the - operator}
@@ -128,6 +129,7 @@ interface
 
       const
         nodetype2str : array[tnodetype] of string[20] = (
+          '<emptynode>',
           'addn',
           'muln',
           'subn',
@@ -310,13 +312,14 @@ interface
           maxfirstpasscount,
           firstpasscount : longint;
 {$endif extdebug}
-          constructor create(tt : tnodetype);
+          constructor create(t:tnodetype);
           { this constructor is only for creating copies of class }
           { the fields are copied by getcopy                      }
           constructor createforcopy;
-          constructor load(tt : tnodetype;ppufile:tcompilerppufile);
+          constructor ppuload(t:tnodetype;ppufile:tcompilerppufile);virtual;
           destructor destroy;override;
-          procedure write(ppufile:tcompilerppufile);virtual;
+          procedure ppuwrite(ppufile:tcompilerppufile);virtual;
+          procedure derefimpl;virtual;
 
           { toggles the flag }
           procedure toggleflag(f : tnodeflags);
@@ -371,10 +374,11 @@ interface
        punarynode = ^tunarynode;
        tunarynode = class(tnode)
           left : tnode;
-          constructor create(tt : tnodetype;l : tnode);
-          constructor load(tt:tnodetype;ppufile:tcompilerppufile);
+          constructor create(t:tnodetype;l : tnode);
+          constructor ppuload(t:tnodetype;ppufile:tcompilerppufile);override;
           destructor destroy;override;
-          procedure write(ppufile:tcompilerppufile);override;
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
+          procedure derefimpl;override;
           procedure concattolist(l : tlinkedlist);override;
           function ischild(p : tnode) : boolean;override;
           function docompare(p : tnode) : boolean;override;
@@ -389,10 +393,11 @@ interface
        pbinarynode = ^tbinarynode;
        tbinarynode = class(tunarynode)
           right : tnode;
-          constructor create(tt : tnodetype;l,r : tnode);
-          constructor load(tt:tnodetype;ppufile:tcompilerppufile);
+          constructor create(t:tnodetype;l,r : tnode);
+          constructor ppuload(t:tnodetype;ppufile:tcompilerppufile);override;
           destructor destroy;override;
-          procedure write(ppufile:tcompilerppufile);override;
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
+          procedure derefimpl;override;
           procedure concattolist(l : tlinkedlist);override;
           function ischild(p : tnode) : boolean;override;
           function docompare(p : tnode) : boolean;override;
@@ -406,7 +411,7 @@ interface
        end;
 
        tbinopnode = class(tbinarynode)
-          constructor create(tt : tnodetype;l,r : tnode);virtual;
+          constructor create(t:tnodetype;l,r : tnode);virtual;
           function docompare(p : tnode) : boolean;override;
        end;
 
@@ -418,13 +423,16 @@ interface
 {$endif tempregdebug}
 
     var
+      { array with all class types for tnodes }
       nodeclass : tnodeclassarray;
 {$ifdef EXTDEBUG}
+      { indention used when writing the tree to the screen }
       writenodeindention : string;
 {$endif EXTDEBUG}
 
 
     function ppuloadnode(ppufile:tcompilerppufile):tnode;
+    procedure ppuwritenode(ppufile:tcompilerppufile;n:tnode);
 {$ifdef EXTDEBUG}
     procedure writenode(t:tnode);
 {$endif EXTDEBUG}
@@ -435,6 +443,10 @@ implementation
     uses
        cutils,verbose;
 
+    const
+      ppunodemarker = 255;
+
+
 {****************************************************************************
                                  Helpers
  ****************************************************************************}
@@ -446,16 +458,38 @@ implementation
       begin
         { marker }
         b:=ppufile.getbyte;
-        if b<>255 then
+        if b<>ppunodemarker then
           internalerror(200208151);
         { load nodetype }
         t:=tnodetype(ppufile.getbyte);
         if t>high(tnodetype) then
           internalerror(200208152);
-        if not assigned(nodeclass[t]) then
-          internalerror(200208153);
-        { generate node of the correct class }
-        ppuloadnode:=nodeclass[t].load(t,ppufile);
+        if t<>emptynode then
+         begin
+           if not assigned(nodeclass[t]) then
+             internalerror(200208153);
+writeln('load: ',nodetype2str[t]);
+           { generate node of the correct class }
+           ppuloadnode:=nodeclass[t].ppuload(t,ppufile);
+         end
+        else
+         ppuloadnode:=nil;
+      end;
+
+
+    procedure ppuwritenode(ppufile:tcompilerppufile;n:tnode);
+      begin
+        { marker, read by ppuloadnode }
+        ppufile.putbyte(ppunodemarker);
+        { type, read by ppuloadnode }
+        if assigned(n) then
+         begin
+           ppufile.putbyte(byte(n.nodetype));
+writeln('write: ',nodetype2str[n.nodetype]);
+           n.ppuwrite(ppufile);
+         end
+        else
+         ppufile.putbyte(byte(emptynode));
       end;
 
 
@@ -475,11 +509,11 @@ implementation
                                  TNODE
  ****************************************************************************}
 
-    constructor tnode.create(tt : tnodetype);
+    constructor tnode.create(t:tnodetype);
 
       begin
          inherited create;
-         nodetype:=tt;
+         nodetype:=t;
          blocktype:=block_type;
          { this allows easier error tracing }
          location.loc:=LOC_INVALID;
@@ -504,9 +538,10 @@ implementation
       begin
       end;
 
-    constructor tnode.load(tt : tnodetype;ppufile:tcompilerppufile);
+    constructor tnode.ppuload(t:tnodetype;ppufile:tcompilerppufile);
 
       begin
+        nodetype:=t;
         { tnode fields }
         blocktype:=tblock_type(ppufile.getbyte);
         ppufile.getposinfo(fileinfo);
@@ -527,21 +562,22 @@ implementation
       end;
 
 
-    procedure tnode.write(ppufile:tcompilerppufile);
+    procedure tnode.ppuwrite(ppufile:tcompilerppufile);
       begin
-        { marker, read by ppuloadnode }
-        ppufile.putbyte($ff);
-        { type, read by ppuloadnode }
-        ppufile.putbyte(byte(nodetype));
-        { tnode fields }
         ppufile.putbyte(byte(block_type));
-        ppufile.putposinfo(aktfilepos);
+        ppufile.putposinfo(fileinfo);
         ppufile.putsmallset(localswitches);
         ppufile.puttype(resulttype);
         ppufile.putsmallset(flags);
       end;
 
 
+    procedure tnode.derefimpl;
+      begin
+        resulttype.resolve;
+      end;
+
+
     procedure tnode.toggleflag(f : tnodeflags);
 
       begin
@@ -576,24 +612,27 @@ implementation
     procedure tnode._dowrite;
       begin
         dowritenodetype;
-        system.write(',resulttype = "',resulttype.def.gettypename,'"');
-        system.write(',location.loc = ',ord(location.loc));
-        system.write(',registersfpu = ',registersfpu);
+        if assigned(resulttype.def) then
+          write(',resulttype = "',resulttype.def.gettypename,'"')
+        else
+          write(',resulttype = <nil>');
+        write(',location.loc = ',ord(location.loc));
+        write(',registersfpu = ',registersfpu);
       end;
 
     procedure tnode.dowritenodetype;
       begin
-          system.write(nodetype2str[nodetype]);
+          write(nodetype2str[nodetype]);
       end;
 
     procedure tnode.dowrite;
       begin
-         system.write(writenodeindention,'(');
+         write(writenodeindention,'(');
          writenodeindention:=writenodeindention+'    ';
          _dowrite;
-         writeln(writenodeindention);
+         writeln;
          delete(writenodeindention,1,4);
-         system.write(writenodeindention,')');
+         write(writenodeindention,')');
       end;
 {$endif EXTDEBUG}
 
@@ -678,17 +717,17 @@ implementation
                                  TUNARYNODE
  ****************************************************************************}
 
-    constructor tunarynode.create(tt : tnodetype;l : tnode);
+    constructor tunarynode.create(t:tnodetype;l : tnode);
 
       begin
-         inherited create(tt);
+         inherited create(t);
          left:=l;
       end;
 
 
-    constructor tunarynode.load(tt : tnodetype;ppufile:tcompilerppufile);
+    constructor tunarynode.ppuload(t:tnodetype;ppufile:tcompilerppufile);
       begin
-        inherited load(tt,ppufile);
+        inherited ppuload(t,ppufile);
         left:=ppuloadnode(ppufile);
       end;
 
@@ -700,10 +739,18 @@ implementation
       end;
 
 
-    procedure tunarynode.write(ppufile:tcompilerppufile);
+    procedure tunarynode.ppuwrite(ppufile:tcompilerppufile);
+      begin
+        inherited ppuwrite(ppufile);
+        ppuwritenode(ppufile,left);
+      end;
+
+
+    procedure tunarynode.derefimpl;
       begin
-        inherited write(ppufile);
-        left.write(ppufile);
+        inherited derefimpl;
+        if assigned(left) then
+          left.derefimpl;
       end;
 
 
@@ -772,17 +819,17 @@ implementation
                             TBINARYNODE
  ****************************************************************************}
 
-    constructor tbinarynode.create(tt : tnodetype;l,r : tnode);
+    constructor tbinarynode.create(t:tnodetype;l,r : tnode);
 
       begin
-         inherited create(tt,l);
+         inherited create(t,l);
          right:=r
       end;
 
 
-    constructor tbinarynode.load(tt : tnodetype;ppufile:tcompilerppufile);
+    constructor tbinarynode.ppuload(t:tnodetype;ppufile:tcompilerppufile);
       begin
-        inherited load(tt,ppufile);
+        inherited ppuload(t,ppufile);
         right:=ppuloadnode(ppufile);
       end;
 
@@ -794,10 +841,18 @@ implementation
       end;
 
 
-    procedure tbinarynode.write(ppufile:tcompilerppufile);
+    procedure tbinarynode.ppuwrite(ppufile:tcompilerppufile);
       begin
-        inherited write(ppufile);
-        right.write(ppufile);
+        inherited ppuwrite(ppufile);
+        ppuwritenode(ppufile,right);
+      end;
+
+
+    procedure tbinarynode.derefimpl;
+      begin
+        inherited derefimpl;
+        if assigned(right) then
+          right.derefimpl;
       end;
 
 
@@ -898,10 +953,10 @@ implementation
                             TBINOPYNODE
  ****************************************************************************}
 
-    constructor tbinopnode.create(tt : tnodetype;l,r : tnode);
+    constructor tbinopnode.create(t:tnodetype;l,r : tnode);
 
       begin
-         inherited create(tt,l,r);
+         inherited create(t,l,r);
       end;
 
     function tbinopnode.docompare(p : tnode) : boolean;
@@ -917,7 +972,13 @@ implementation
 end.
 {
   $Log$
-  Revision 1.36  2002-08-17 22:09:46  florian
+  Revision 1.37  2002-08-18 20:06:24  peter
+    * inlining is now also allowed in interface
+    * renamed write/load to ppuwrite/ppuload
+    * tnode storing in ppu
+    * nld,ncon,nbas are already updated for storing in ppu
+
+  Revision 1.36  2002/08/17 22:09:46  florian
     * result type handling in tcgcal.pass_2 overhauled
     * better tnode.dowrite
     * some ppc stuff fixed

+ 10 - 3
compiler/pass_2.pas

@@ -64,7 +64,8 @@ implementation
      procedure logsecond(ht:tnodetype; entry: boolean);
        const
          secondnames: array[tnodetype] of string[13] =
-            ('add-addn',  {addn}
+            ('<emptynode>',
+             'add-addn',  {addn}
              'add-muln',  {muln}
              'add-subn',  {subn}
              'moddiv-divn',      {divn}
@@ -151,7 +152,7 @@ implementation
           p := strpnew('second'+secondnames[ht]+' (entry)')
         else
           p := strpnew('second'+secondnames[ht]+' (exit)');
-        exprasmlist.concat(tai_asm_comment.create(p));
+        exprasmlist.concat(tai_comment.create(p));
       end;
 {$endif EXTDEBUG}
 
@@ -329,7 +330,13 @@ implementation
 end.
 {
   $Log$
-  Revision 1.35  2002-08-17 09:23:38  florian
+  Revision 1.36  2002-08-18 20:06:24  peter
+    * inlining is now also allowed in interface
+    * renamed write/load to ppuwrite/ppuload
+    * tnode storing in ppu
+    * nld,ncon,nbas are already updated for storing in ppu
+
+  Revision 1.35  2002/08/17 09:23:38  florian
     * first part of procinfo rewrite
 
   Revision 1.34  2002/08/15 19:10:35  peter

+ 8 - 2
compiler/pdecsub.pas

@@ -1103,7 +1103,7 @@ const
       mutexclpo     : [po_leftright]
     ),(
       idtok:_INLINE;
-      pd_flags : pd_implemen+pd_body+pd_notobjintf;
+      pd_flags : pd_interface+pd_implemen+pd_body+pd_notobjintf;
       handler  : nil;
       pocall   : pocall_inline;
       pooption : [];
@@ -1957,7 +1957,13 @@ const
 end.
 {
   $Log$
-  Revision 1.64  2002-08-17 09:23:39  florian
+  Revision 1.65  2002-08-18 20:06:24  peter
+    * inlining is now also allowed in interface
+    * renamed write/load to ppuwrite/ppuload
+    * tnode storing in ppu
+    * nld,ncon,nbas are already updated for storing in ppu
+
+  Revision 1.64  2002/08/17 09:23:39  florian
     * first part of procinfo rewrite
 
   Revision 1.63  2002/08/11 14:32:27  peter

+ 9 - 3
compiler/pexpr.pas

@@ -667,7 +667,7 @@ implementation
               { generate a methodcallnode or proccallnode }
               { we shouldn't convert things like @tcollection.load }
               if assigned(getprocvardef) then
-	       aprocdef:=Tprocsym(sym).search_procdef_byprocvardef(getprocvardef)
+               aprocdef:=Tprocsym(sym).search_procdef_byprocvardef(getprocvardef)
               else
                aprocdef:=nil;
               p2:=cloadnode.create_procvar(sym,aprocdef,st);
@@ -1919,7 +1919,7 @@ implementation
                   { make sure we found a valid procedure, otherwise the  }
                   { "getprocvardef" will become the default in taddrnode }
                   { while there should be an error (JM)                  }
-                  assigned(tloadnode(taddrnode(p1).left).procdeflist) then
+                  assigned(tloadnode(taddrnode(p1).left).procdef) then
                 taddrnode(p1).getprocvardef:=getprocvardef;
              end;
 
@@ -2248,7 +2248,13 @@ implementation
 end.
 {
   $Log$
-  Revision 1.76  2002-08-17 09:23:39  florian
+  Revision 1.77  2002-08-18 20:06:24  peter
+    * inlining is now also allowed in interface
+    * renamed write/load to ppuwrite/ppuload
+    * tnode storing in ppu
+    * nld,ncon,nbas are already updated for storing in ppu
+
+  Revision 1.76  2002/08/17 09:23:39  florian
     * first part of procinfo rewrite
 
   Revision 1.75  2002/08/01 16:37:47  jonas

+ 8 - 2
compiler/pmodules.pas

@@ -534,7 +534,7 @@ implementation
           exit;
          if (cs_gdb_dbx in aktglobalswitches) then
            begin
-             debugList.concat(Tai_asm_comment.Create(strpnew('EINCL of global '+
+             debugList.concat(tai_comment.Create(strpnew('EINCL of global '+
                tglobalsymtable(current_module.globalsymtable).name^+' has index '+
                tostr(tglobalsymtable(current_module.globalsymtable).unitid))));
              debugList.concat(Tai_stabs.Create(strpnew('"'+
@@ -1388,7 +1388,13 @@ implementation
 end.
 {
   $Log$
-  Revision 1.72  2002-08-17 09:23:39  florian
+  Revision 1.73  2002-08-18 20:06:25  peter
+    * inlining is now also allowed in interface
+    * renamed write/load to ppuwrite/ppuload
+    * tnode storing in ppu
+    * nld,ncon,nbas are already updated for storing in ppu
+
+  Revision 1.72  2002/08/17 09:23:39  florian
     * first part of procinfo rewrite
 
   Revision 1.71  2002/08/11 13:24:12  peter

+ 10 - 4
compiler/powerpc/cpupi.pas

@@ -71,13 +71,13 @@ unit cpupi;
       begin
          procdef.parast.address_fixup:=align(maxpushedparasize,16);
          if cs_asm_source in aktglobalswitches then
-           aktproccode.insert(Tai_asm_comment.Create(strpnew('Parameter copies start at: r1+'+tostr(procdef.parast.address_fixup))));
+           aktproccode.insert(Tai_comment.Create(strpnew('Parameter copies start at: r1+'+tostr(procdef.parast.address_fixup))));
          procdef.localst.address_fixup:=align(procdef.parast.address_fixup+procdef.parast.datasize,16);
          if cs_asm_source in aktglobalswitches then
-           aktproccode.insert(Tai_asm_comment.Create(strpnew('Locals start at: r1+'+tostr(procdef.localst.address_fixup))));
+           aktproccode.insert(Tai_comment.Create(strpnew('Locals start at: r1+'+tostr(procdef.localst.address_fixup))));
          procinfo.firsttemp_offset:=align(procdef.localst.address_fixup+procdef.localst.datasize,16);
          if cs_asm_source in aktglobalswitches then
-           aktproccode.insert(Tai_asm_comment.Create(strpnew('Temp. space start: r1+'+tostr(procinfo.firsttemp_offset))));
+           aktproccode.insert(Tai_comment.Create(strpnew('Temp. space start: r1+'+tostr(procinfo.firsttemp_offset))));
 
          //!!!! tg.setfirsttemp(procinfo.firsttemp_offset);
          tg.firsttemp:=procinfo.firsttemp_offset;
@@ -89,7 +89,13 @@ begin
 end.
 {
   $Log$
-  Revision 1.1  2002-08-17 09:23:49  florian
+  Revision 1.2  2002-08-18 20:06:30  peter
+    * inlining is now also allowed in interface
+    * renamed write/load to ppuwrite/ppuload
+    * tnode storing in ppu
+    * nld,ncon,nbas are already updated for storing in ppu
+
+  Revision 1.1  2002/08/17 09:23:49  florian
     * first part of procinfo rewrite
 }
 

+ 9 - 32
compiler/ppu.pas

@@ -112,37 +112,8 @@ const
   ibwidestringdef  = 56;
   ibvariantdef     = 57;
   {implementation/objectdata}
-  ibasmsymbols     = 80;
-  {tais}
-  ibtaidirect       = 100;
-  ibtaistring       = 101;
-  ibtailabel        = 102;
-  ibtaicomment      = 103;
-  ibtaiinstruction  = 104;
-  ibtaidatablock    = 105;
-  ibtaisymbol       = 106;
-  ibtaisymbol_end   = 107;
-  ibtaiconst_32bit  = 108;
-  ibtaiconst_16bit  = 109;
-  ibtaiconst_8bit   = 110;
-  ibtaiconst_symbol = 111;
-  ibtaireal_80bit   = 112;
-  ibtaireal_64bit   = 113;
-  ibtaireal_32bit   = 114;
-  ibtaicomp_64bit   = 115;
-  ibtaialign        = 116;
-  ibtaisection      = 117;
-  ibtaiconst_rva    = 118;
-  ibtaistabn        = 119;
-  ibtaistabs        = 120;
-  ibtaiforce_line   = 121;
-  ibtaifunction_name = 122;
-  ibtaicut          = 123;
-  ibtairegalloc     = 124;
-  ibtaitempalloc    = 125;
-  ibtaimarker       = 126;
-  {tnodes}
-  ibnode            = 150;
+  ibnode           = 80;
+  ibasmsymbols     = 81;
 
 { unit flags }
   uf_init          = $1;
@@ -1014,7 +985,13 @@ end;
 end.
 {
   $Log$
-  Revision 1.25  2002-08-15 19:10:35  peter
+  Revision 1.26  2002-08-18 20:06:25  peter
+    * inlining is now also allowed in interface
+    * renamed write/load to ppuwrite/ppuload
+    * tnode storing in ppu
+    * nld,ncon,nbas are already updated for storing in ppu
+
+  Revision 1.25  2002/08/15 19:10:35  peter
     * first things tai,tnode storing in ppu
 
   Revision 1.24  2002/08/15 15:09:42  carl

+ 67 - 1
compiler/psystem.pas

@@ -36,6 +36,7 @@ interface
     procedure createconstdefs;
 
     procedure registernodes;
+    procedure registertais;
 
 
 implementation
@@ -43,6 +44,10 @@ implementation
     uses
       globals,globtype,
       symconst,symtype,symsym,symdef,symtable,
+      aasmtai,aasmcpu,
+{$ifdef GDB}
+      gdb,
+{$endif GDB}
       node,nbas,nflw,nset,ncon,ncnv,nld,nmem,ncal,nmat,nadd,ninl,nopt;
 
 
@@ -406,10 +411,71 @@ implementation
         nodeclass[rttin]:=crttinode;
       end;
 
+
+    procedure registertais;
+      {
+        Register all possible tais in the taiclass array that
+        will be used for loading the tais from a ppu
+      }
+      begin
+        aiclass[ait_none]:=nil;
+        aiclass[ait_align]:=tai_align;
+        aiclass[ait_section]:=tai_section;
+        aiclass[ait_comment]:=tai_comment;
+        aiclass[ait_direct]:=tai_direct;
+        aiclass[ait_string]:=tai_string;
+        aiclass[ait_instruction]:=taicpu;
+        aiclass[ait_datablock]:=tai_datablock;
+        aiclass[ait_symbol]:=tai_symbol;
+        aiclass[ait_symbol_end]:=tai_symbol_end;
+        aiclass[ait_label]:=tai_label;
+        aiclass[ait_const_32bit]:=tai_const;
+        aiclass[ait_const_16bit]:=tai_const;
+        aiclass[ait_const_8bit]:=tai_const;
+        aiclass[ait_const_symbol]:=tai_const_symbol;
+        aiclass[ait_const_rva]:=tai_const_symbol;
+        aiclass[ait_real_32bit]:=tai_real_32bit;
+        aiclass[ait_real_64bit]:=tai_real_64bit;
+        aiclass[ait_real_80bit]:=tai_real_80bit;
+        aiclass[ait_comp_64bit]:=tai_comp_64bit;
+{$ifdef GDB}
+        aiclass[ait_stabn]:=tai_stabn;
+        aiclass[ait_stabs]:=tai_stabs;
+        aiclass[ait_force_line]:=tai_force_line;
+        aiclass[ait_stab_function_name]:=tai_stab_function_name;
+{$endif GDB}
+{$ifdef alpha}
+          { the follow is for the DEC Alpha }
+        aiclass[ait_frame]:=tai_frame;
+        aiclass[ait_ent]:=tai_ent;
+{$endif alpha}
+{$ifdef m68k}
+{$warning FIXME: tai_labeled_instruction doesn't exists}
+//        aiclass[ait_labeled_instruction]:=tai_labeled_instruction;
+{$endif m68k}
+{$ifdef ia64}
+        aiclass[ait_bundle]:=tai_bundle;
+        aiclass[ait_stop]:=tai_stop;
+{$endif ia64}
+{$ifdef SPARC}
+        aiclass[ait_labeled_instruction]:=tai_labeled_instruction;
+{$endif SPARC}
+        aiclass[ait_cut]:=tai_cut;
+        aiclass[ait_regalloc]:=tai_regalloc;
+        aiclass[ait_tempalloc]:=tai_tempalloc;
+        aiclass[ait_marker]:=tai_marker;
+      end;
+
 end.
 {
   $Log$
-  Revision 1.36  2002-08-15 19:10:35  peter
+  Revision 1.37  2002-08-18 20:06:25  peter
+    * inlining is now also allowed in interface
+    * renamed write/load to ppuwrite/ppuload
+    * tnode storing in ppu
+    * nld,ncon,nbas are already updated for storing in ppu
+
+  Revision 1.36  2002/08/15 19:10:35  peter
     * first things tai,tnode storing in ppu
 
   Revision 1.35  2002/08/14 19:14:39  carl

+ 11 - 5
compiler/regvars.pas

@@ -373,7 +373,7 @@ implementation
              if assigned(regvarinfo^.regvars[i]) then
                begin
                 if cs_asm_source in aktglobalswitches then
-                 asml.insert(Tai_asm_comment.Create(strpnew(regvarinfo^.regvars[i].name+
+                 asml.insert(tai_comment.Create(strpnew(regvarinfo^.regvars[i].name+
                   ' with weight '+tostr(regvarinfo^.regvars[i].refs)+' assigned to register '+
                   std_reg2str[regvarinfo^.regvars[i].reg])));
                 if (status.verbosity and v_debug)=v_debug then
@@ -395,7 +395,7 @@ implementation
 {$ifdef i386}
           if assigned(p) then
             if cs_asm_source in aktglobalswitches then
-              asml.insert(Tai_asm_comment.Create(strpnew(tostr(p.registersfpu)+
+              asml.insert(tai_comment.Create(strpnew(tostr(p.registersfpu)+
               ' registers on FPU stack used by temp. expressions')));
 {$endif i386}
           for i:=1 to maxfpuvarregs do
@@ -403,7 +403,7 @@ implementation
                if assigned(regvarinfo^.fpuregvars[i]) then
                  begin
                     if cs_asm_source in aktglobalswitches then
-                      asml.insert(Tai_asm_comment.Create(strpnew(regvarinfo^.fpuregvars[i].name+
+                      asml.insert(tai_comment.Create(strpnew(regvarinfo^.fpuregvars[i].name+
                         ' with weight '+tostr(regvarinfo^.fpuregvars[i].refs)+' assigned to register '+
                         std_reg2str[regvarinfo^.fpuregvars[i].reg])));
                     if (status.verbosity and v_debug)=v_debug then
@@ -412,7 +412,7 @@ implementation
                  end;
             end;
           if cs_asm_source in aktglobalswitches then
-            asml.insert(Tai_asm_comment.Create(strpnew('Register variable assignment:')));
+            asml.insert(tai_comment.Create(strpnew('Register variable assignment:')));
         end;
     end;
 
@@ -469,7 +469,13 @@ end.
 
 {
   $Log$
-  Revision 1.39  2002-08-17 09:23:41  florian
+  Revision 1.40  2002-08-18 20:06:25  peter
+    * inlining is now also allowed in interface
+    * renamed write/load to ppuwrite/ppuload
+    * tnode storing in ppu
+    * nld,ncon,nbas are already updated for storing in ppu
+
+  Revision 1.39  2002/08/17 09:23:41  florian
     * first part of procinfo rewrite
 
   Revision 1.38  2002/08/06 20:55:22  florian

+ 136 - 127
compiler/symdef.pas

@@ -63,13 +63,12 @@ interface
           is_def_stab_written : tdefstabstatus;
 {$endif GDB}
           constructor create;
-          constructor loaddef(ppufile:tcompilerppufile);
+          constructor ppuloaddef(ppufile:tcompilerppufile);
           destructor  destroy;override;
-          procedure writedef(ppufile:tcompilerppufile);
-          procedure write(ppufile:tcompilerppufile);virtual;abstract;
+          procedure ppuwritedef(ppufile:tcompilerppufile);
+          procedure ppuwrite(ppufile:tcompilerppufile);virtual;abstract;
           procedure deref;override;
           procedure derefimpl;override;
-          procedure derefobjectdata;override;
           function  size:longint;override;
           function  alignment:longint;override;
           function  is_publishable : boolean;override;
@@ -118,8 +117,8 @@ interface
           constructor createtext;
           constructor createuntyped;
           constructor createtyped(const tt : ttype);
-          constructor load(ppufile:tcompilerppufile);
-          procedure write(ppufile:tcompilerppufile);override;
+          constructor ppuload(ppufile:tcompilerppufile);
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure deref;override;
           function  gettypename:string;override;
           function  getmangledparaname:string;override;
@@ -133,9 +132,9 @@ interface
 
        tvariantdef = class(tstoreddef)
           constructor create;
-          constructor load(ppufile:tcompilerppufile);
+          constructor ppuload(ppufile:tcompilerppufile);
           function gettypename:string;override;
-          procedure write(ppufile:tcompilerppufile);override;
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure setsize;
           function needs_inittable : boolean;override;
           procedure write_rtti_data(rt:trttitype);override;
@@ -143,8 +142,8 @@ interface
 
        tformaldef = class(tstoreddef)
           constructor create;
-          constructor load(ppufile:tcompilerppufile);
-          procedure write(ppufile:tcompilerppufile);override;
+          constructor ppuload(ppufile:tcompilerppufile);
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
           function  gettypename:string;override;
 {$ifdef GDB}
           function  stabstring : pchar;override;
@@ -178,8 +177,8 @@ interface
           is_far : boolean;
           constructor create(const tt : ttype);
           constructor createfar(const tt : ttype);
-          constructor load(ppufile:tcompilerppufile);
-          procedure write(ppufile:tcompilerppufile);override;
+          constructor ppuload(ppufile:tcompilerppufile);
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure deref;override;
           function  gettypename:string;override;
           { debug }
@@ -210,9 +209,9 @@ interface
        trecorddef = class(tabstractrecorddef)
        public
           constructor create(p : tsymtable);
-          constructor load(ppufile:tcompilerppufile);
+          constructor ppuload(ppufile:tcompilerppufile);
           destructor destroy;override;
-          procedure write(ppufile:tcompilerppufile);override;
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure deref;override;
           function  size:longint;override;
           function  alignment : longint;override;
@@ -263,9 +262,9 @@ interface
           { store implemented interfaces defs and name mappings }
           implementedinterfaces: timplementedinterfaces;
           constructor create(ot : tobjectdeftype;const n : string;c : tobjectdef);
-          constructor load(ppufile:tcompilerppufile);
+          constructor ppuload(ppufile:tcompilerppufile);
           destructor  destroy;override;
-          procedure write(ppufile:tcompilerppufile);override;
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure deref;override;
           function  size : longint;override;
           function  alignment:longint;override;
@@ -326,8 +325,8 @@ interface
 
        tclassrefdef = class(tpointerdef)
           constructor create(const t:ttype);
-          constructor load(ppufile:tcompilerppufile);
-          procedure write(ppufile:tcompilerppufile);override;
+          constructor ppuload(ppufile:tcompilerppufile);
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
           function gettypename:string;override;
           { debug }
 {$ifdef GDB}
@@ -348,8 +347,8 @@ interface
           IsArrayOfConst : boolean;
           function elesize : longint;
           constructor create(l,h : longint;const t : ttype);
-          constructor load(ppufile:tcompilerppufile);
-          procedure write(ppufile:tcompilerppufile);override;
+          constructor ppuload(ppufile:tcompilerppufile);
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
           function  gettypename:string;override;
           function  getmangledparaname : string;override;
 {$ifdef GDB}
@@ -375,8 +374,8 @@ interface
           low,high : TConstExprInt;
           typ      : tbasetype;
           constructor create(t : tbasetype;v,b : TConstExprInt);
-          constructor load(ppufile:tcompilerppufile);
-          procedure write(ppufile:tcompilerppufile);override;
+          constructor ppuload(ppufile:tcompilerppufile);
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
           function  is_publishable : boolean;override;
           function  gettypename:string;override;
           procedure setsize;
@@ -395,8 +394,8 @@ interface
        tfloatdef = class(tstoreddef)
           typ : tfloattype;
           constructor create(t : tfloattype);
-          constructor load(ppufile:tcompilerppufile);
-          procedure write(ppufile:tcompilerppufile);override;
+          constructor ppuload(ppufile:tcompilerppufile);
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
           function  gettypename:string;override;
           function  is_publishable : boolean;override;
           procedure setsize;
@@ -420,9 +419,9 @@ interface
           symtablelevel   : byte;
           fpu_used        : byte;    { how many stack fpu must be empty }
           constructor create;
-          constructor load(ppufile:tcompilerppufile);
+          constructor ppuload(ppufile:tcompilerppufile);
           destructor destroy;override;
-          procedure  write(ppufile:tcompilerppufile);override;
+          procedure  ppuwrite(ppufile:tcompilerppufile);override;
           procedure deref;override;
           procedure concatpara(const tt:ttype;sym : tsym;vsp : tvarspez;defval:tsym);
           function  para_size(alignsize:longint) : longint;
@@ -437,8 +436,8 @@ interface
 
        tprocvardef = class(tabstractprocdef)
           constructor create;
-          constructor load(ppufile:tcompilerppufile);
-          procedure write(ppufile:tcompilerppufile);override;
+          constructor ppuload(ppufile:tcompilerppufile);
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
           function  size : longint;override;
           function gettypename:string;override;
           function is_publishable : boolean;override;
@@ -508,12 +507,11 @@ interface
           { small set which contains the modified registers }
           usedregisters : tregisterset;
           constructor create;
-          constructor load(ppufile:tcompilerppufile);
+          constructor ppuload(ppufile:tcompilerppufile);
           destructor  destroy;override;
-          procedure write(ppufile:tcompilerppufile);override;
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure deref;override;
           procedure derefimpl;override;
-          procedure derefobjectdata;override;
           function  getsymtable(t:tgetsymtable):tsymtable;override;
           function  haspara:boolean;
           function  mangledname : string;
@@ -550,7 +548,7 @@ interface
           constructor loadwide(ppufile:tcompilerppufile);
           function  stringtypname:string;
           function  size : longint;override;
-          procedure write(ppufile:tcompilerppufile);override;
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
           function  gettypename:string;override;
           function  getmangledparaname:string;override;
           function  is_publishable : boolean;override;
@@ -574,9 +572,9 @@ interface
           basedef   : tenumdef;
           constructor create;
           constructor create_subrange(_basedef:tenumdef;_min,_max:longint);
-          constructor load(ppufile:tcompilerppufile);
+          constructor ppuload(ppufile:tcompilerppufile);
           destructor destroy;override;
-          procedure write(ppufile:tcompilerppufile);override;
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure deref;override;
           function  gettypename:string;override;
           function  is_publishable : boolean;override;
@@ -602,9 +600,9 @@ interface
           elementtype : ttype;
           settype : tsettype;
           constructor create(const t:ttype;high : longint);
-          constructor load(ppufile:tcompilerppufile);
+          constructor ppuload(ppufile:tcompilerppufile);
           destructor  destroy;override;
-          procedure write(ppufile:tcompilerppufile);override;
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure deref;override;
           function  gettypename:string;override;
           function  is_publishable : boolean;override;
@@ -828,7 +826,7 @@ implementation
        manglenamesize : longint;
 {$endif}
 
-    constructor tstoreddef.loaddef(ppufile:tcompilerppufile);
+    constructor tstoreddef.ppuloaddef(ppufile:tcompilerppufile);
       begin
          inherited create;
 {$ifdef EXTDEBUG}
@@ -890,7 +888,7 @@ implementation
       end;
 
 
-    procedure tstoreddef.writedef(ppufile:tcompilerppufile);
+    procedure tstoreddef.ppuwritedef(ppufile:tcompilerppufile);
       begin
         ppufile.putword(indexnr);
         ppufile.putderef(typesym);
@@ -927,11 +925,6 @@ implementation
       end;
 
 
-    procedure tstoreddef.derefobjectdata;
-      begin
-      end;
-
-
     function tstoreddef.size : longint;
       begin
          size:=savesize;
@@ -1191,7 +1184,7 @@ implementation
 
     constructor tstringdef.loadshort(ppufile:tcompilerppufile);
       begin
-         inherited loaddef(ppufile);
+         inherited ppuloaddef(ppufile);
          string_typ:=st_shortstring;
          deftype:=stringdef;
          len:=ppufile.getbyte;
@@ -1211,7 +1204,7 @@ implementation
 
     constructor tstringdef.loadlong(ppufile:tcompilerppufile);
       begin
-         inherited loaddef(ppufile);
+         inherited ppuloaddef(ppufile);
          deftype:=stringdef;
          string_typ:=st_longstring;
          len:=ppufile.getlongint;
@@ -1231,7 +1224,7 @@ implementation
 
     constructor tstringdef.loadansi(ppufile:tcompilerppufile);
       begin
-         inherited loaddef(ppufile);
+         inherited ppuloaddef(ppufile);
          deftype:=stringdef;
          string_typ:=st_ansistring;
          len:=ppufile.getlongint;
@@ -1251,7 +1244,7 @@ implementation
 
     constructor tstringdef.loadwide(ppufile:tcompilerppufile);
       begin
-         inherited loaddef(ppufile);
+         inherited ppuloaddef(ppufile);
          deftype:=stringdef;
          string_typ:=st_widestring;
          len:=ppufile.getlongint;
@@ -1275,9 +1268,9 @@ implementation
       end;
 
 
-    procedure tstringdef.write(ppufile:tcompilerppufile);
+    procedure tstringdef.ppuwrite(ppufile:tcompilerppufile);
       begin
-         inherited writedef(ppufile);
+         inherited ppuwritedef(ppufile);
          if string_typ=st_shortstring then
            ppufile.putbyte(len)
          else
@@ -1437,9 +1430,9 @@ implementation
       end;
 
 
-    constructor tenumdef.load(ppufile:tcompilerppufile);
+    constructor tenumdef.ppuload(ppufile:tcompilerppufile);
       begin
-         inherited loaddef(ppufile);
+         inherited ppuloaddef(ppufile);
          deftype:=enumdef;
          basedef:=tenumdef(ppufile.getderef);
          minval:=ppufile.getlongint;
@@ -1501,9 +1494,9 @@ implementation
       end;
 
 
-    procedure tenumdef.write(ppufile:tcompilerppufile);
+    procedure tenumdef.ppuwrite(ppufile:tcompilerppufile);
       begin
-         inherited writedef(ppufile);
+         inherited ppuwritedef(ppufile);
          ppufile.putderef(basedef);
          ppufile.putlongint(min);
          ppufile.putlongint(max);
@@ -1660,11 +1653,11 @@ implementation
       end;
 
 
-    constructor torddef.load(ppufile:tcompilerppufile);
+    constructor torddef.ppuload(ppufile:tcompilerppufile);
       var
         l1,l2 : longint;
       begin
-         inherited loaddef(ppufile);
+         inherited ppuloaddef(ppufile);
          deftype:=orddef;
          typ:=tbasetype(ppufile.getbyte);
          if sizeof(TConstExprInt)=8 then
@@ -1768,9 +1761,9 @@ implementation
       end;
 
 
-    procedure torddef.write(ppufile:tcompilerppufile);
+    procedure torddef.ppuwrite(ppufile:tcompilerppufile);
       begin
-         inherited writedef(ppufile);
+         inherited ppuwritedef(ppufile);
          ppufile.putbyte(byte(typ));
          if sizeof(TConstExprInt)=8 then
           begin
@@ -1913,9 +1906,9 @@ implementation
       end;
 
 
-    constructor tfloatdef.load(ppufile:tcompilerppufile);
+    constructor tfloatdef.ppuload(ppufile:tcompilerppufile);
       begin
-         inherited loaddef(ppufile);
+         inherited ppuloaddef(ppufile);
          deftype:=floatdef;
          typ:=tfloattype(ppufile.getbyte);
          setsize;
@@ -1935,9 +1928,9 @@ implementation
       end;
 
 
-    procedure tfloatdef.write(ppufile:tcompilerppufile);
+    procedure tfloatdef.ppuwrite(ppufile:tcompilerppufile);
       begin
-         inherited writedef(ppufile);
+         inherited ppuwritedef(ppufile);
          ppufile.putbyte(byte(typ));
          ppufile.writeentry(ibfloatdef);
       end;
@@ -2025,9 +2018,9 @@ implementation
       end;
 
 
-    constructor tfiledef.load(ppufile:tcompilerppufile);
+    constructor tfiledef.ppuload(ppufile:tcompilerppufile);
       begin
-         inherited loaddef(ppufile);
+         inherited ppuloaddef(ppufile);
          deftype:=filedef;
          filetyp:=tfiletyp(ppufile.getbyte);
          if filetyp=ft_typed then
@@ -2058,9 +2051,9 @@ implementation
       end;
 
 
-    procedure tfiledef.write(ppufile:tcompilerppufile);
+    procedure tfiledef.ppuwrite(ppufile:tcompilerppufile);
       begin
-         inherited writedef(ppufile);
+         inherited ppuwritedef(ppufile);
          ppufile.putbyte(byte(filetyp));
          if filetyp=ft_typed then
            ppufile.puttype(typedfiletype);
@@ -2158,17 +2151,17 @@ implementation
       end;
 
 
-    constructor tvariantdef.load(ppufile:tcompilerppufile);
+    constructor tvariantdef.ppuload(ppufile:tcompilerppufile);
       begin
-         inherited loaddef(ppufile);
+         inherited ppuloaddef(ppufile);
          deftype:=variantdef;
          setsize;
       end;
 
 
-    procedure tvariantdef.write(ppufile:tcompilerppufile);
+    procedure tvariantdef.ppuwrite(ppufile:tcompilerppufile);
       begin
-         inherited writedef(ppufile);
+         inherited ppuwritedef(ppufile);
          ppufile.writeentry(ibvariantdef);
       end;
 
@@ -2220,9 +2213,9 @@ implementation
       end;
 
 
-    constructor tpointerdef.load(ppufile:tcompilerppufile);
+    constructor tpointerdef.ppuload(ppufile:tcompilerppufile);
       begin
-         inherited loaddef(ppufile);
+         inherited ppuloaddef(ppufile);
          deftype:=pointerdef;
          ppufile.gettype(pointertype);
          is_far:=(ppufile.getbyte<>0);
@@ -2237,9 +2230,9 @@ implementation
       end;
 
 
-    procedure tpointerdef.write(ppufile:tcompilerppufile);
+    procedure tpointerdef.ppuwrite(ppufile:tcompilerppufile);
       begin
-         inherited writedef(ppufile);
+         inherited ppuwritedef(ppufile);
          ppufile.puttype(pointertype);
          ppufile.putbyte(byte(is_far));
          ppufile.writeentry(ibpointerdef);
@@ -2327,10 +2320,10 @@ implementation
       end;
 
 
-    constructor tclassrefdef.load(ppufile:tcompilerppufile);
+    constructor tclassrefdef.ppuload(ppufile:tcompilerppufile);
       begin
          { be careful, tclassdefref inherits from tpointerdef }
-         inherited loaddef(ppufile);
+         inherited ppuloaddef(ppufile);
          deftype:=classrefdef;
          ppufile.gettype(pointertype);
          is_far:=false;
@@ -2338,10 +2331,10 @@ implementation
       end;
 
 
-    procedure tclassrefdef.write(ppufile:tcompilerppufile);
+    procedure tclassrefdef.ppuwrite(ppufile:tcompilerppufile);
       begin
          { be careful, tclassdefref inherits from tpointerdef }
-         inherited writedef(ppufile);
+         inherited ppuwritedef(ppufile);
          ppufile.puttype(pointertype);
          ppufile.writeentry(ibclassrefdef);
       end;
@@ -2408,9 +2401,9 @@ implementation
       end;
 
 
-    constructor tsetdef.load(ppufile:tcompilerppufile);
+    constructor tsetdef.ppuload(ppufile:tcompilerppufile);
       begin
-         inherited loaddef(ppufile);
+         inherited ppuloaddef(ppufile);
          deftype:=setdef;
          ppufile.gettype(elementtype);
          settype:=tsettype(ppufile.getbyte);
@@ -2428,9 +2421,9 @@ implementation
       end;
 
 
-    procedure tsetdef.write(ppufile:tcompilerppufile);
+    procedure tsetdef.ppuwrite(ppufile:tcompilerppufile);
       begin
-         inherited writedef(ppufile);
+         inherited ppuwritedef(ppufile);
          ppufile.puttype(elementtype);
          ppufile.putbyte(byte(settype));
          if settype=varset then
@@ -2540,17 +2533,17 @@ implementation
       end;
 
 
-    constructor tformaldef.load(ppufile:tcompilerppufile);
+    constructor tformaldef.ppuload(ppufile:tcompilerppufile);
       begin
-         inherited loaddef(ppufile);
+         inherited ppuloaddef(ppufile);
          deftype:=formaldef;
          savesize:=POINTER_SIZE;
       end;
 
 
-    procedure tformaldef.write(ppufile:tcompilerppufile);
+    procedure tformaldef.ppuwrite(ppufile:tcompilerppufile);
       begin
-         inherited writedef(ppufile);
+         inherited ppuwritedef(ppufile);
          ppufile.writeentry(ibformaldef);
       end;
 
@@ -2594,9 +2587,9 @@ implementation
       end;
 
 
-    constructor tarraydef.load(ppufile:tcompilerppufile);
+    constructor tarraydef.ppuload(ppufile:tcompilerppufile);
       begin
-         inherited loaddef(ppufile);
+         inherited ppuloaddef(ppufile);
          deftype:=arraydef;
          { the addresses are calculated later }
          ppufile.gettype(elementtype);
@@ -2655,9 +2648,9 @@ implementation
       end;
 
 
-    procedure tarraydef.write(ppufile:tcompilerppufile);
+    procedure tarraydef.ppuwrite(ppufile:tcompilerppufile);
       begin
-         inherited writedef(ppufile);
+         inherited ppuwritedef(ppufile);
          ppufile.puttype(elementtype);
          ppufile.puttype(rangetype);
          ppufile.putlongint(lowrange);
@@ -2918,17 +2911,17 @@ implementation
       end;
 
 
-    constructor trecorddef.load(ppufile:tcompilerppufile);
+    constructor trecorddef.ppuload(ppufile:tcompilerppufile);
       var
          oldread_member : boolean;
       begin
-         inherited loaddef(ppufile);
+         inherited ppuloaddef(ppufile);
          deftype:=recorddef;
          savesize:=ppufile.getlongint;
          oldread_member:=read_member;
          read_member:=true;
          symtable:=trecordsymtable.create;
-         trecordsymtable(symtable).load(ppufile);
+         trecordsymtable(symtable).ppuload(ppufile);
          read_member:=oldread_member;
          symtable.defowner:=self;
       end;
@@ -2967,16 +2960,16 @@ implementation
       end;
 
 
-    procedure trecorddef.write(ppufile:tcompilerppufile);
+    procedure trecorddef.ppuwrite(ppufile:tcompilerppufile);
       var
          oldread_member : boolean;
       begin
          oldread_member:=read_member;
          read_member:=true;
-         inherited writedef(ppufile);
+         inherited ppuwritedef(ppufile);
          ppufile.putlongint(savesize);
          ppufile.writeentry(ibrecorddef);
-         trecordsymtable(symtable).write(ppufile);
+         trecordsymtable(symtable).ppuwrite(ppufile);
          read_member:=oldread_member;
       end;
 
@@ -3146,12 +3139,12 @@ implementation
       end;
 
 
-    constructor tabstractprocdef.load(ppufile:tcompilerppufile);
+    constructor tabstractprocdef.ppuload(ppufile:tcompilerppufile);
       var
          hp : TParaItem;
          count,i : word;
       begin
-         inherited loaddef(ppufile);
+         inherited ppuloaddef(ppufile);
          Para:=TParaLinkedList.Create;
          minparacount:=0;
          maxparacount:=0;
@@ -3180,12 +3173,12 @@ implementation
       end;
 
 
-    procedure tabstractprocdef.write(ppufile:tcompilerppufile);
+    procedure tabstractprocdef.ppuwrite(ppufile:tcompilerppufile);
       var
         hp : TParaItem;
         oldintfcrc : boolean;
       begin
-         inherited writedef(ppufile);
+         inherited ppuwritedef(ppufile);
          ppufile.puttype(rettype);
          oldintfcrc:=ppufile.do_interface_crc;
          ppufile.do_interface_crc:=false;
@@ -3211,6 +3204,7 @@ implementation
       end;
 
 
+
     function tabstractprocdef.para_size(alignsize:longint) : longint;
       var
          pdc : TParaItem;
@@ -3375,9 +3369,9 @@ implementation
       end;
 
 
-    constructor tprocdef.load(ppufile:tcompilerppufile);
+    constructor tprocdef.ppuload(ppufile:tcompilerppufile);
       begin
-         inherited load(ppufile);
+         inherited ppuload(ppufile);
          deftype:=procdef;
 
          ppufile.getnormalset(usedregisters);
@@ -3393,22 +3387,29 @@ implementation
          ppufile.getposinfo(fileinfo);
          { inline stuff }
          if proccalloption=pocall_inline then
-           funcretsym:=tsym(ppufile.getderef)
+          begin
+            funcretsym:=tsym(ppufile.getderef);
+            code:=ppuloadnode(ppufile);
+          end
          else
-           funcretsym:=nil;
+          begin
+            code := nil;
+            funcretsym:=nil;
+          end;
          { load para and local symtables }
          parast:=tparasymtable.create;
-         tparasymtable(parast).load(ppufile);
+         tparasymtable(parast).ppuload(ppufile);
          parast.defowner:=self;
          if (proccalloption=pocall_inline) or
             ((current_module.flags and uf_local_browser)<>0) then
           begin
             localst:=tlocalsymtable.create;
-            tlocalsymtable(localst).load(ppufile);
+            tlocalsymtable(localst).ppuload(ppufile);
             localst.defowner:=self;
           end
          else
           localst:=nil;
+
          { default values for no persistent data }
          if (cs_link_deffile in aktglobalswitches) and
             (tf_need_export in target_info.flags) and
@@ -3418,7 +3419,6 @@ implementation
          forwarddef:=false;
          interfacedef:=false;
          hasforward:=false;
-         code := nil;
          regvarinfo := nil;
          lastref:=nil;
          lastwritten:=nil;
@@ -3454,11 +3454,11 @@ implementation
       end;
 
 
-    procedure tprocdef.write(ppufile:tcompilerppufile);
+    procedure tprocdef.ppuwrite(ppufile:tcompilerppufile);
       var
         oldintfcrc : boolean;
       begin
-         inherited write(ppufile);
+         inherited ppuwrite(ppufile);
          oldintfcrc:=ppufile.do_interface_crc;
          ppufile.do_interface_crc:=false;
          { set all registers to used for simplified compilation PM }
@@ -3482,8 +3482,12 @@ implementation
            on the crc }
          oldintfcrc:=ppufile.do_crc;
          ppufile.do_crc:=false;
-         if (proccalloption=pocall_inline) then
-           ppufile.putderef(funcretsym);
+         { inline stuff }
+         if proccalloption=pocall_inline then
+          begin
+            ppufile.putderef(funcretsym);
+            ppuwritenode(ppufile,code);
+          end;
          ppufile.do_crc:=oldintfcrc;
 
          { write this entry }
@@ -3495,7 +3499,7 @@ implementation
             parast:=tparasymtable.create;
             parast.defowner:=self;
           end;
-         tparasymtable(parast).write(ppufile);
+         tparasymtable(parast).ppuwrite(ppufile);
 
          { save localsymtable for inline procedures or when local
            browser info is requested, this has no influence on the crc }
@@ -3509,7 +3513,7 @@ implementation
                localst:=tlocalsymtable.create;
                localst.defowner:=self;
              end;
-            tlocalsymtable(localst).write(ppufile);
+            tlocalsymtable(localst).ppuwrite(ppufile);
             ppufile.do_crc:=oldintfcrc;
           end;
       end;
@@ -3799,11 +3803,10 @@ implementation
             { safety }
             funcretsym:=nil;
           end;
-      end;
-
 
-    procedure tprocdef.derefobjectdata;
-      begin
+        { inline tree }
+        if (proccalloption=pocall_inline) then
+          code.derefimpl;
       end;
 
 
@@ -3925,14 +3928,14 @@ implementation
       end;
 
 
-    constructor tprocvardef.load(ppufile:tcompilerppufile);
+    constructor tprocvardef.ppuload(ppufile:tcompilerppufile);
       begin
-         inherited load(ppufile);
+         inherited ppuload(ppufile);
          deftype:=procvardef;
       end;
 
 
-    procedure tprocvardef.write(ppufile:tcompilerppufile);
+    procedure tprocvardef.ppuwrite(ppufile:tcompilerppufile);
       begin
          { here we cannot get a real good value so just give something }
          { plausible (PM) }
@@ -3946,7 +3949,7 @@ implementation
 {$endif FAST_FPU}
          else
            fpu_used:=0;
-         inherited write(ppufile);
+         inherited ppuwrite(ppufile);
          ppufile.writeentry(ibprocvardef);
       end;
 
@@ -4134,12 +4137,12 @@ implementation
      end;
 
 
-    constructor tobjectdef.load(ppufile:tcompilerppufile);
+    constructor tobjectdef.ppuload(ppufile:tcompilerppufile);
       var
          oldread_member : boolean;
          i,implintfcount: longint;
       begin
-         inherited loaddef(ppufile);
+         inherited ppuloaddef(ppufile);
          deftype:=objectdef;
          objecttype:=tobjectdeftype(ppufile.getbyte);
          savesize:=ppufile.getlongint;
@@ -4176,7 +4179,7 @@ implementation
          oldread_member:=read_member;
          read_member:=true;
          symtable:=tobjectsymtable.create(objrealname^);
-         tobjectsymtable(symtable).load(ppufile);
+         tobjectsymtable(symtable).ppuload(ppufile);
          read_member:=oldread_member;
 
          symtable.defowner:=self;
@@ -4211,13 +4214,13 @@ implementation
      end;
 
 
-    procedure tobjectdef.write(ppufile:tcompilerppufile);
+    procedure tobjectdef.ppuwrite(ppufile:tcompilerppufile);
       var
          oldread_member : boolean;
          implintfcount : longint;
          i : longint;
       begin
-         inherited writedef(ppufile);
+         inherited ppuwritedef(ppufile);
          ppufile.putbyte(byte(objecttype));
          ppufile.putlongint(size);
          ppufile.putlongint(vmt_offset);
@@ -4247,7 +4250,7 @@ implementation
 
          oldread_member:=read_member;
          read_member:=true;
-         tobjectsymtable(symtable).write(ppufile);
+         tobjectsymtable(symtable).ppuwrite(ppufile);
          read_member:=oldread_member;
       end;
 
@@ -5504,7 +5507,13 @@ implementation
 end.
 {
   $Log$
-  Revision 1.89  2002-08-11 15:28:00  florian
+  Revision 1.90  2002-08-18 20:06:25  peter
+    * inlining is now also allowed in interface
+    * renamed write/load to ppuwrite/ppuload
+    * tnode storing in ppu
+    * nld,ncon,nbas are already updated for storing in ppu
+
+  Revision 1.89  2002/08/11 15:28:00  florian
     + support of explicit type case <any ordinal type>->pointer
       (delphi mode only)
 

+ 92 - 7
compiler/symppu.pas

@@ -28,7 +28,7 @@ interface
     uses
        cclasses,
        globtype,globals,
-       aasmbase,
+       cpuinfo,aasmbase,
        symbase,symtype,
        ppu;
 
@@ -37,12 +37,16 @@ interface
        public
          procedure checkerror;
          procedure getguid(var g: tguid);
+         function  getexprint:tconstexprint;
+         function  getptruint:TConstPtrUInt;
          procedure getposinfo(var p:tfileposinfo);
          function  getderef : pointer;
          function  getsymlist:tsymlist;
          procedure gettype(var t:ttype);
          function  getasmsymbol:tasmsymbol;
          procedure putguid(const g: tguid);
+         procedure putexprint(v:tconstexprint);
+         procedure PutPtrUInt(v:TConstPtrUInt);
          procedure putposinfo(const p:tfileposinfo);
          procedure putderef(p : tsymtableentry);
          procedure putsymlist(p:tsymlist);
@@ -74,6 +78,52 @@ implementation
       end;
 
 
+    function tcompilerppufile.getexprint:tconstexprint;
+      var
+        l1,l2 : longint;
+      begin
+        if sizeof(tconstexprint)=8 then
+          begin
+            l1:=getlongint;
+            l2:=getlongint;
+{$ifopt R+}
+  {$define Range_check_on}
+{$endif opt R+}
+{$R- needed here }
+            result:=qword(l1)+(int64(l2) shl 32);
+{$ifdef Range_check_on}
+  {$R+}
+  {$undef Range_check_on}
+{$endif Range_check_on}
+          end
+        else
+          result:=getlongint;
+      end;
+
+
+    function tcompilerppufile.getPtrUInt:TConstPtrUInt;
+      var
+        l1,l2 : longint;
+      begin
+        if sizeof(tconstexprint)=8 then
+          begin
+            l1:=getlongint;
+            l2:=getlongint;
+{$ifopt R+}
+  {$define Range_check_on}
+{$endif opt R+}
+{$R- needed here }
+            result:=qword(l1)+(int64(l2) shl 32);
+{$ifdef Range_check_on}
+  {$R+}
+  {$undef Range_check_on}
+{$endif Range_check_on}
+          end
+        else
+          result:=getlongint;
+      end;
+
+
     procedure tcompilerppufile.getposinfo(var p:tfileposinfo);
       var
         info : byte;
@@ -273,6 +323,30 @@ implementation
       end;
 
 
+    procedure tcompilerppufile.putexprint(v:tconstexprint);
+      begin
+        if sizeof(TConstExprInt)=8 then
+          begin
+             putlongint(longint(lo(v)));
+             putlongint(longint(hi(v)));
+          end
+        else
+          putlongint(v);
+      end;
+
+
+    procedure tcompilerppufile.PutPtrUInt(v:TConstPtrUInt);
+      begin
+        if sizeof(TConstPtrUInt)=8 then
+          begin
+             putlongint(longint(lo(v)));
+             putlongint(longint(hi(v)));
+          end
+        else
+          putlongint(v);
+      end;
+
+
     procedure tcompilerppufile.putderef(p : tsymtableentry);
       begin
         if p=nil then
@@ -399,19 +473,30 @@ implementation
 
     procedure tcompilerppufile.putasmsymbol(s:tasmsymbol);
       begin
-        if s.ppuidx=-1 then
+        if assigned(s) then
          begin
-           s.ppuidx:=objectlibrary.asmsymbolppuidx;
-           inc(objectlibrary.asmsymbolppuidx);
-         end;
-        putlongint(s.ppuidx);
+           if s.ppuidx=-1 then
+            begin
+              inc(objectlibrary.asmsymbolppuidx);
+              s.ppuidx:=objectlibrary.asmsymbolppuidx;
+            end;
+           putlongint(s.ppuidx);
+         end
+        else
+         putlongint(0);
       end;
 
 
 end.
 {
   $Log$
-  Revision 1.14  2002-08-11 14:32:28  peter
+  Revision 1.15  2002-08-18 20:06:26  peter
+    * inlining is now also allowed in interface
+    * renamed write/load to ppuwrite/ppuload
+    * tnode storing in ppu
+    * nld,ncon,nbas are already updated for storing in ppu
+
+  Revision 1.14  2002/08/11 14:32:28  peter
     * renamed current_library to objectlibrary
 
   Revision 1.13  2002/08/11 13:24:14  peter

+ 67 - 126
compiler/symsym.pas

@@ -60,7 +60,7 @@ interface
           constructor create(const n : string);
           constructor loadsym(ppufile:tcompilerppufile);
           destructor destroy;override;
-          procedure write(ppufile:tcompilerppufile);virtual;abstract;
+          procedure ppuwrite(ppufile:tcompilerppufile);virtual;abstract;
           procedure writesym(ppufile:tcompilerppufile);
           procedure deref;override;
           procedure insert_in_data;virtual;
@@ -83,18 +83,18 @@ interface
           code : pointer; { should be tnode }
           constructor create(const n : string; l : tasmlabel);
           destructor destroy;override;
-          constructor load(ppufile:tcompilerppufile);
+          constructor ppuload(ppufile:tcompilerppufile);
           procedure generate_mangledname;override;
-          procedure write(ppufile:tcompilerppufile);override;
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
        end;
 
        tunitsym = class(tstoredsym)
           unitsymtable : tsymtable;
           prevsym      : tunitsym;
           constructor create(const n : string;ref : tsymtable);
-          constructor load(ppufile:tcompilerppufile);
+          constructor ppuload(ppufile:tcompilerppufile);
           destructor destroy;override;
-          procedure write(ppufile:tcompilerppufile);override;
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure restoreunitsym;
 {$ifdef GDB}
           procedure concatstabto(asmlist : taasmoutput);override;
@@ -113,7 +113,7 @@ interface
           overloadchecked : boolean;
           overloadcount   : longint; { amount of overloaded functions in this module }
           constructor create(const n : string);
-          constructor load(ppufile:tcompilerppufile);
+          constructor ppuload(ppufile:tcompilerppufile);
           destructor destroy;override;
           { writes all declarations except the specified one }
           procedure write_parameter_lists(skipdef:tprocdef);
@@ -121,7 +121,7 @@ interface
           { only forward                                             }
           procedure check_forward;
           procedure unchain_overload;
-          procedure write(ppufile:tcompilerppufile);override;
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure deref;override;
           procedure addprocdef(p:tprocdef);
           procedure concat_procdefs_to(s:Tprocsym);
@@ -144,8 +144,8 @@ interface
           isusedinstab : boolean;
 {$endif GDB}
           constructor create(const n : string;const tt : ttype);
-          constructor load(ppufile:tcompilerppufile);
-          procedure write(ppufile:tcompilerppufile);override;
+          constructor ppuload(ppufile:tcompilerppufile);
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure deref;override;
           function  gettypedef:tdef;override;
           procedure load_references(ppufile:tcompilerppufile;locals:boolean);override;
@@ -167,9 +167,9 @@ interface
           constructor create(const n : string;const tt : ttype);
           constructor create_dll(const n : string;const tt : ttype);
           constructor create_C(const n,mangled : string;const tt : ttype);
-          constructor load(ppufile:tcompilerppufile);
+          constructor ppuload(ppufile:tcompilerppufile);
           destructor  destroy;override;
-          procedure write(ppufile:tcompilerppufile);override;
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure deref;override;
           procedure generate_mangledname;override;
           procedure set_mangledname(const s:string);
@@ -195,9 +195,9 @@ interface
           storedaccess  : tsymlist;
           constructor create(const n : string);
           destructor  destroy;override;
-          constructor load(ppufile:tcompilerppufile);
+          constructor ppuload(ppufile:tcompilerppufile);
           function  getsize : longint;
-          procedure write(ppufile:tcompilerppufile);override;
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
           function  gettypedef:tdef;override;
           procedure deref;override;
           procedure dooverride(overriden:tpropertysym);
@@ -212,9 +212,9 @@ interface
           address       : longint;
           funcretstate  : tvarstate;
           constructor create(const n : string;const tt : ttype);
-          constructor load(ppufile:tcompilerppufile);
+          constructor ppuload(ppufile:tcompilerppufile);
           destructor  destroy;override;
-          procedure write(ppufile:tcompilerppufile);override;
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure deref;override;
           procedure insert_in_data;override;
 {$ifdef GDB}
@@ -228,10 +228,10 @@ interface
           ref     : tstoredsym;
           asmname : pstring;
           constructor create(const n : string;const tt : ttype);
-          constructor load(ppufile:tcompilerppufile);
+          constructor ppuload(ppufile:tcompilerppufile);
           procedure deref;override;
           function  mangledname : string;
-          procedure write(ppufile:tcompilerppufile);override;
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure insert_in_data;override;
 {$ifdef GDB}
           procedure concatstabto(asmlist : taasmoutput);override;
@@ -243,10 +243,10 @@ interface
           is_writable     : boolean;
           constructor create(const n : string;p : tdef;writable : boolean);
           constructor createtype(const n : string;const tt : ttype;writable : boolean);
-          constructor load(ppufile:tcompilerppufile);
+          constructor ppuload(ppufile:tcompilerppufile);
           destructor destroy;override;
           procedure generate_mangledname;override;
-          procedure write(ppufile:tcompilerppufile);override;
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure deref;override;
           function  getsize:longint;
           procedure insert_in_data;override;
@@ -269,11 +269,11 @@ interface
           constructor create_ptr(const n : string;t : tconsttyp;v : pointer);
           constructor create_ptr_typed(const n : string;t : tconsttyp;v : pointer;const tt:ttype);
           constructor create_string(const n : string;t : tconsttyp;str:pchar;l:longint);
-          constructor load(ppufile:tcompilerppufile);
+          constructor ppuload(ppufile:tcompilerppufile);
           destructor  destroy;override;
           function  mangledname : string;
           procedure deref;override;
-          procedure write(ppufile:tcompilerppufile);override;
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
 {$ifdef GDB}
           function  stabstring : pchar;override;
           procedure concatstabto(asmlist : taasmoutput);override;
@@ -285,8 +285,8 @@ interface
           definition : tenumdef;
           nextenum   : tenumsym;
           constructor create(const n : string;def : tenumdef;v : longint);
-          constructor load(ppufile:tcompilerppufile);
-          procedure write(ppufile:tcompilerppufile);override;
+          constructor ppuload(ppufile:tcompilerppufile);
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure deref;override;
           procedure order;
 {$ifdef GDB}
@@ -297,9 +297,9 @@ interface
        tsyssym = class(tstoredsym)
           number : longint;
           constructor create(const n : string;l : longint);
-          constructor load(ppufile:tcompilerppufile);
+          constructor ppuload(ppufile:tcompilerppufile);
           destructor  destroy;override;
-          procedure write(ppufile:tcompilerppufile);override;
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
 {$ifdef GDB}
           procedure concatstabto(asmlist : taasmoutput);override;
 {$endif GDB}
@@ -310,8 +310,8 @@ interface
           lab     : tasmsymbol;
           rttityp : trttitype;
           constructor create(const n:string;rt:trttitype);
-          constructor load(ppufile:tcompilerppufile);
-          procedure write(ppufile:tcompilerppufile);override;
+          constructor ppuload(ppufile:tcompilerppufile);
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
           function  mangledname:string;
           function  get_label:tasmsymbol;
        end;
@@ -647,7 +647,7 @@ implementation
          code:=nil;
       end;
 
-    constructor tlabelsym.load(ppufile:tcompilerppufile);
+    constructor tlabelsym.ppuload(ppufile:tcompilerppufile);
 
       begin
          inherited loadsym(ppufile);
@@ -673,7 +673,7 @@ implementation
       end;
 
 
-    procedure tlabelsym.write(ppufile:tcompilerppufile);
+    procedure tlabelsym.ppuwrite(ppufile:tcompilerppufile);
       begin
          if owner.symtabletype=globalsymtable then
            Message(sym_e_ill_label_decl)
@@ -707,7 +707,7 @@ implementation
           end;
       end;
 
-    constructor tunitsym.load(ppufile:tcompilerppufile);
+    constructor tunitsym.ppuload(ppufile:tcompilerppufile);
 
       begin
          inherited loadsym(ppufile);
@@ -753,7 +753,7 @@ implementation
          inherited destroy;
       end;
 
-    procedure tunitsym.write(ppufile:tcompilerppufile);
+    procedure tunitsym.ppuwrite(ppufile:tcompilerppufile);
       begin
          inherited writesym(ppufile);
          ppufile.writeentry(ibunitsym);
@@ -783,7 +783,7 @@ implementation
       end;
 
 
-    constructor tprocsym.load(ppufile:tcompilerppufile);
+    constructor tprocsym.ppuload(ppufile:tcompilerppufile);
       var
          pd : tprocdef;
       begin
@@ -1007,7 +1007,7 @@ implementation
             end;
     end;
 
-    procedure tprocsym.write(ppufile:tcompilerppufile);
+    procedure tprocsym.ppuwrite(ppufile:tcompilerppufile);
       var
          p : pprocdeflist;
       begin
@@ -1125,7 +1125,7 @@ implementation
       end;
 
 
-    constructor tpropertysym.load(ppufile:tcompilerppufile);
+    constructor tpropertysym.ppuload(ppufile:tcompilerppufile);
       begin
          inherited loadsym(ppufile);
          typ:=propertysym;
@@ -1188,7 +1188,7 @@ implementation
       end;
 
 
-    procedure tpropertysym.write(ppufile:tcompilerppufile);
+    procedure tpropertysym.ppuwrite(ppufile:tcompilerppufile);
       begin
         inherited writesym(ppufile);
         ppufile.putsmallset(propoptions);
@@ -1254,7 +1254,7 @@ implementation
          address:=procinfo.return_offset;
       end;
 
-    constructor tfuncretsym.load(ppufile:tcompilerppufile);
+    constructor tfuncretsym.ppuload(ppufile:tcompilerppufile);
       begin
          inherited loadsym(ppufile);
          ppufile.gettype(returntype);
@@ -1267,7 +1267,7 @@ implementation
         inherited destroy;
       end;
 
-    procedure tfuncretsym.write(ppufile:tcompilerppufile);
+    procedure tfuncretsym.ppuwrite(ppufile:tcompilerppufile);
       begin
          inherited writesym(ppufile);
          ppufile.puttype(returntype);
@@ -1323,10 +1323,10 @@ implementation
       end;
 
 
-    constructor tabsolutesym.load(ppufile:tcompilerppufile);
+    constructor tabsolutesym.ppuload(ppufile:tcompilerppufile);
       begin
          { Note: This needs to load everything of tvarsym.write }
-         inherited load(ppufile);
+         inherited ppuload(ppufile);
          { load absolute }
          typ:=absolutesym;
          ref:=nil;
@@ -1348,7 +1348,7 @@ implementation
       end;
 
 
-    procedure tabsolutesym.write(ppufile:tcompilerppufile);
+    procedure tabsolutesym.ppuwrite(ppufile:tcompilerppufile);
       var
         hvo : tvaroptions;
       begin
@@ -1480,7 +1480,7 @@ implementation
       end;
 
 
-    constructor tvarsym.load(ppufile:tcompilerppufile);
+    constructor tvarsym.ppuload(ppufile:tcompilerppufile);
       begin
          inherited loadsym(ppufile);
          typ:=varsym;
@@ -1512,7 +1512,7 @@ implementation
       end;
 
 
-    procedure tvarsym.write(ppufile:tcompilerppufile);
+    procedure tvarsym.ppuwrite(ppufile:tcompilerppufile);
       var
         hvo : tvaroptions;
       begin
@@ -1880,7 +1880,7 @@ implementation
       end;
 
 
-    constructor ttypedconstsym.load(ppufile:tcompilerppufile);
+    constructor ttypedconstsym.ppuload(ppufile:tcompilerppufile);
       begin
          inherited loadsym(ppufile);
          typ:=typedconstsym;
@@ -1916,7 +1916,7 @@ implementation
       end;
 
 
-    procedure ttypedconstsym.write(ppufile:tcompilerppufile);
+    procedure ttypedconstsym.ppuwrite(ppufile:tcompilerppufile);
       begin
          inherited writesym(ppufile);
          ppufile.puttype(typedconsttype);
@@ -2072,7 +2072,7 @@ implementation
       end;
 
 
-    constructor tconstsym.load(ppufile:tcompilerppufile);
+    constructor tconstsym.ppuload(ppufile:tcompilerppufile);
       var
          pd : pbestreal;
          ps : pnormalset;
@@ -2089,22 +2089,7 @@ implementation
          valueptr:=nil;
          case consttyp of
            constint:
-             if sizeof(tconstexprint)=8 then
-               begin
-                  l1:=ppufile.getlongint;
-                  l2:=ppufile.getlongint;
-{$ifopt R+}
-  {$define Range_check_on}
-{$endif opt R+}
-{$R- needed here }
-                  valueord:=qword(l1)+(int64(l2) shl 32);
-{$ifdef Range_check_on}
-  {$R+}
-  {$undef Range_check_on}
-{$endif Range_check_on}
-               end
-             else
-               valueord:=ppufile.getlongint;
+             valueord:=ppufile.getexprint;
            constwchar,
            constbool,
            constchar :
@@ -2112,42 +2097,12 @@ implementation
            constord :
              begin
                ppufile.gettype(consttype);
-               if sizeof(TConstExprInt)=8 then
-                 begin
-                    l1:=ppufile.getlongint;
-                    l2:=ppufile.getlongint;
-{$ifopt R+}
-  {$define Range_check_on}
-{$endif opt R+}
-{$R- needed here }
-                    valueord:=qword(l1)+(int64(l2) shl 32);
-{$ifdef Range_check_on}
-  {$R+}
-  {$undef Range_check_on}
-{$endif Range_check_on}
-                 end
-               else
-                 valueord:=ppufile.getlongint;
+               valueord:=ppufile.getexprint;
              end;
            constpointer :
              begin
                ppufile.gettype(consttype);
-               if sizeof(TConstPtrUInt)=8 then
-                 begin
-                    l1:=ppufile.getlongint;
-                    l2:=ppufile.getlongint;
-{$ifopt R+}
-  {$define Range_check_on}
-{$endif opt R+}
-{$R- needed here }
-                    valueordptr:=qword(l1)+(int64(l2) shl 32);
-{$ifdef Range_check_on}
-  {$R+}
-  {$undef Range_check_on}
-{$endif Range_check_on}
-                 end
-               else
-                 valueordptr:=cardinal(ppufile.getlongint);
+               valueordptr:=ppufile.getptruint;
              end;
            conststring,
            constresourcestring :
@@ -2207,46 +2162,26 @@ implementation
       end;
 
 
-    procedure tconstsym.write(ppufile:tcompilerppufile);
+    procedure tconstsym.ppuwrite(ppufile:tcompilerppufile);
       begin
          inherited writesym(ppufile);
          ppufile.putbyte(byte(consttyp));
          case consttyp of
            constnil : ;
            constint:
-             begin
-               if sizeof(TConstExprInt)=8 then
-                 begin
-                    ppufile.putlongint(longint(lo(valueord)));
-                    ppufile.putlongint(longint(hi(valueord)));
-                 end
-               else
-                 ppufile.putlongint(valueord);
-             end;
+             ppufile.putexprint(valueord);
            constbool,
            constchar :
              ppufile.putlongint(valueord);
            constord :
              begin
                ppufile.puttype(consttype);
-               if sizeof(TConstExprInt)=8 then
-                 begin
-                    ppufile.putlongint(longint(lo(valueord)));
-                    ppufile.putlongint(longint(hi(valueord)));
-                 end
-               else
-                 ppufile.putlongint(valueord);
+               ppufile.putexprint(valueord);
              end;
            constpointer :
              begin
                ppufile.puttype(consttype);
-               if sizeof(TConstPtrUInt)=8 then
-                 begin
-                    ppufile.putlongint(longint(lo(valueordptr)));
-                    ppufile.putlongint(longint(hi(valueordptr)));
-                 end
-               else
-                 ppufile.putlongint(longint(valueordptr));
+               ppufile.putptruint(valueordptr);
              end;
            conststring,
            constresourcestring :
@@ -2329,7 +2264,7 @@ implementation
       end;
 
 
-    constructor tenumsym.load(ppufile:tcompilerppufile);
+    constructor tenumsym.ppuload(ppufile:tcompilerppufile);
       begin
          inherited loadsym(ppufile);
          typ:=enumsym;
@@ -2373,7 +2308,7 @@ implementation
       end;
 
 
-    procedure tenumsym.write(ppufile:tcompilerppufile);
+    procedure tenumsym.ppuwrite(ppufile:tcompilerppufile);
       begin
          inherited writesym(ppufile);
          ppufile.putderef(definition);
@@ -2411,7 +2346,7 @@ implementation
       end;
 
 
-    constructor ttypesym.load(ppufile:tcompilerppufile);
+    constructor ttypesym.ppuload(ppufile:tcompilerppufile);
       begin
          inherited loadsym(ppufile);
          typ:=typesym;
@@ -2434,7 +2369,7 @@ implementation
       end;
 
 
-    procedure ttypesym.write(ppufile:tcompilerppufile);
+    procedure ttypesym.ppuwrite(ppufile:tcompilerppufile);
       begin
          inherited writesym(ppufile);
          ppufile.puttype(restype);
@@ -2511,7 +2446,7 @@ implementation
          number:=l;
       end;
 
-    constructor tsyssym.load(ppufile:tcompilerppufile);
+    constructor tsyssym.ppuload(ppufile:tcompilerppufile);
       begin
          inherited loadsym(ppufile);
          typ:=syssym;
@@ -2523,7 +2458,7 @@ implementation
         inherited destroy;
       end;
 
-    procedure tsyssym.write(ppufile:tcompilerppufile);
+    procedure tsyssym.ppuwrite(ppufile:tcompilerppufile);
       begin
          inherited writesym(ppufile);
          ppufile.putlongint(number);
@@ -2552,7 +2487,7 @@ implementation
       end;
 
 
-    constructor trttisym.load(ppufile:tcompilerppufile);
+    constructor trttisym.ppuload(ppufile:tcompilerppufile);
       begin
         inherited loadsym(ppufile);
         typ:=rttisym;
@@ -2561,7 +2496,7 @@ implementation
       end;
 
 
-    procedure trttisym.write(ppufile:tcompilerppufile);
+    procedure trttisym.ppuwrite(ppufile:tcompilerppufile);
       begin
          inherited writesym(ppufile);
          ppufile.putbyte(byte(rttityp));
@@ -2673,7 +2608,13 @@ implementation
 end.
 {
   $Log$
-  Revision 1.52  2002-08-17 09:23:42  florian
+  Revision 1.53  2002-08-18 20:06:27  peter
+    * inlining is now also allowed in interface
+    * renamed write/load to ppuwrite/ppuload
+    * tnode storing in ppu
+    * nld,ncon,nbas are already updated for storing in ppu
+
+  Revision 1.52  2002/08/17 09:23:42  florian
     * first part of procinfo rewrite
 
   Revision 1.51  2002/08/16 14:24:59  carl

+ 67 - 75
compiler/symtable.pas

@@ -67,13 +67,12 @@ interface
           procedure writesyms(ppufile:tcompilerppufile);
        public
           { load/write }
-          procedure load(ppufile:tcompilerppufile);virtual;
-          procedure write(ppufile:tcompilerppufile);virtual;
+          procedure ppuload(ppufile:tcompilerppufile);virtual;
+          procedure ppuwrite(ppufile:tcompilerppufile);virtual;
           procedure load_references(ppufile:tcompilerppufile;locals:boolean);virtual;
           procedure write_references(ppufile:tcompilerppufile;locals:boolean);virtual;
           procedure deref;virtual;
           procedure derefimpl;virtual;
-          procedure derefobjectdata;virtual;
           procedure insert(sym : tsymentry);override;
           function  speedsearch(const s : stringid;speedvalue : cardinal) : tsymentry;override;
           procedure allsymbolsused;
@@ -93,8 +92,8 @@ interface
 
        tabstractrecordsymtable = class(tstoredsymtable)
        public
-          procedure load(ppufile:tcompilerppufile);override;
-          procedure write(ppufile:tcompilerppufile);override;
+          procedure ppuload(ppufile:tcompilerppufile);override;
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure load_references(ppufile:tcompilerppufile;locals:boolean);override;
           procedure write_references(ppufile:tcompilerppufile;locals:boolean);override;
        end;
@@ -113,8 +112,8 @@ interface
 
        tabstractlocalsymtable = class(tstoredsymtable)
        public
-          procedure load(ppufile:tcompilerppufile);override;
-          procedure write(ppufile:tcompilerppufile);override;
+          procedure ppuload(ppufile:tcompilerppufile);override;
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure load_references(ppufile:tcompilerppufile;locals:boolean);override;
           procedure write_references(ppufile:tcompilerppufile;locals:boolean);override;
        end;
@@ -153,8 +152,8 @@ interface
           unitsym       : tunitsym;
           constructor create(const n : string);
           destructor  destroy;override;
-          procedure load(ppufile:tcompilerppufile);override;
-          procedure write(ppufile:tcompilerppufile);override;
+          procedure ppuload(ppufile:tcompilerppufile);override;
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure insert(sym : tsymentry);override;
 {$ifdef GDB}
           function getnewtypecount : word; override;
@@ -164,8 +163,8 @@ interface
        tstaticsymtable = class(tabstractunitsymtable)
        public
           constructor create(const n : string);
-          procedure load(ppufile:tcompilerppufile);override;
-          procedure write(ppufile:tcompilerppufile);override;
+          procedure ppuload(ppufile:tcompilerppufile);override;
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure load_references(ppufile:tcompilerppufile;locals:boolean);override;
           procedure write_references(ppufile:tcompilerppufile;locals:boolean);override;
           procedure insert(sym : tsymentry);override;
@@ -290,7 +289,7 @@ implementation
                              TStoredSymtable
 *****************************************************************************}
 
-    procedure tstoredsymtable.load(ppufile:tcompilerppufile);
+    procedure tstoredsymtable.ppuload(ppufile:tcompilerppufile);
       begin
         { load definitions }
         loaddefs(ppufile);
@@ -300,7 +299,7 @@ implementation
       end;
 
 
-    procedure tstoredsymtable.write(ppufile:tcompilerppufile);
+    procedure tstoredsymtable.ppuwrite(ppufile:tcompilerppufile);
       begin
          { write definitions }
          writedefs(ppufile);
@@ -323,24 +322,24 @@ implementation
          repeat
            b:=ppufile.readentry;
            case b of
-              ibpointerdef : hp:=tpointerdef.load(ppufile);
-                ibarraydef : hp:=tarraydef.load(ppufile);
-                  iborddef : hp:=torddef.load(ppufile);
-                ibfloatdef : hp:=tfloatdef.load(ppufile);
-                 ibprocdef : hp:=tprocdef.load(ppufile);
+              ibpointerdef : hp:=tpointerdef.ppuload(ppufile);
+                ibarraydef : hp:=tarraydef.ppuload(ppufile);
+                  iborddef : hp:=torddef.ppuload(ppufile);
+                ibfloatdef : hp:=tfloatdef.ppuload(ppufile);
+                 ibprocdef : hp:=tprocdef.ppuload(ppufile);
           ibshortstringdef : hp:=tstringdef.loadshort(ppufile);
            iblongstringdef : hp:=tstringdef.loadlong(ppufile);
            ibansistringdef : hp:=tstringdef.loadansi(ppufile);
            ibwidestringdef : hp:=tstringdef.loadwide(ppufile);
-               ibrecorddef : hp:=trecorddef.load(ppufile);
-               ibobjectdef : hp:=tobjectdef.load(ppufile);
-                 ibenumdef : hp:=tenumdef.load(ppufile);
-                  ibsetdef : hp:=tsetdef.load(ppufile);
-              ibprocvardef : hp:=tprocvardef.load(ppufile);
-                 ibfiledef : hp:=tfiledef.load(ppufile);
-             ibclassrefdef : hp:=tclassrefdef.load(ppufile);
-               ibformaldef : hp:=tformaldef.load(ppufile);
-              ibvariantdef : hp:=tvariantdef.load(ppufile);
+               ibrecorddef : hp:=trecorddef.ppuload(ppufile);
+               ibobjectdef : hp:=tobjectdef.ppuload(ppufile);
+                 ibenumdef : hp:=tenumdef.ppuload(ppufile);
+                  ibsetdef : hp:=tsetdef.ppuload(ppufile);
+              ibprocvardef : hp:=tprocvardef.ppuload(ppufile);
+                 ibfiledef : hp:=tfiledef.ppuload(ppufile);
+             ibclassrefdef : hp:=tclassrefdef.ppuload(ppufile);
+               ibformaldef : hp:=tformaldef.ppuload(ppufile);
+              ibvariantdef : hp:=tvariantdef.ppuload(ppufile);
                  ibenddefs : break;
                      ibend : Message(unit_f_ppu_read_error);
            else
@@ -369,19 +368,19 @@ implementation
          repeat
            b:=ppufile.readentry;
            case b of
-                ibtypesym : sym:=ttypesym.load(ppufile);
-                ibprocsym : sym:=tprocsym.load(ppufile);
-               ibconstsym : sym:=tconstsym.load(ppufile);
-                 ibvarsym : sym:=tvarsym.load(ppufile);
-             ibfuncretsym : sym:=tfuncretsym.load(ppufile);
-            ibabsolutesym : sym:=tabsolutesym.load(ppufile);
-                ibenumsym : sym:=tenumsym.load(ppufile);
-          ibtypedconstsym : sym:=ttypedconstsym.load(ppufile);
-            ibpropertysym : sym:=tpropertysym.load(ppufile);
-                ibunitsym : sym:=tunitsym.load(ppufile);
-               iblabelsym : sym:=tlabelsym.load(ppufile);
-                 ibsyssym : sym:=tsyssym.load(ppufile);
-                ibrttisym : sym:=trttisym.load(ppufile);
+                ibtypesym : sym:=ttypesym.ppuload(ppufile);
+                ibprocsym : sym:=tprocsym.ppuload(ppufile);
+               ibconstsym : sym:=tconstsym.ppuload(ppufile);
+                 ibvarsym : sym:=tvarsym.ppuload(ppufile);
+             ibfuncretsym : sym:=tfuncretsym.ppuload(ppufile);
+            ibabsolutesym : sym:=tabsolutesym.ppuload(ppufile);
+                ibenumsym : sym:=tenumsym.ppuload(ppufile);
+          ibtypedconstsym : sym:=ttypedconstsym.ppuload(ppufile);
+            ibpropertysym : sym:=tpropertysym.ppuload(ppufile);
+                ibunitsym : sym:=tunitsym.ppuload(ppufile);
+               iblabelsym : sym:=tlabelsym.ppuload(ppufile);
+                 ibsyssym : sym:=tsyssym.ppuload(ppufile);
+                ibrttisym : sym:=trttisym.ppuload(ppufile);
                 ibendsyms : break;
                     ibend : Message(unit_f_ppu_read_error);
            else
@@ -406,7 +405,7 @@ implementation
          pd:=tstoreddef(defindex.first);
          while assigned(pd) do
            begin
-              pd.write(ppufile);
+              pd.ppuwrite(ppufile);
               pd:=tstoreddef(pd.indexnext);
            end;
       { write end of definitions }
@@ -428,7 +427,7 @@ implementation
          pd:=tstoredsym(symindex.first);
          while assigned(pd) do
            begin
-              pd.write(ppufile);
+              pd.ppuwrite(ppufile);
               pd:=tstoredsym(pd.indexnext);
            end;
        { end of symbols }
@@ -536,19 +535,6 @@ implementation
       end;
 
 
-    procedure tstoredsymtable.derefobjectdata;
-      var
-        hp : tdef;
-      begin
-        hp:=tdef(defindex.first);
-        while assigned(hp) do
-         begin
-           hp.derefobjectdata;
-           hp:=tdef(hp.indexnext);
-         end;
-      end;
-
-
     procedure tstoredsymtable.insert(sym:tsymentry);
       var
          hsym : tsym;
@@ -958,20 +944,20 @@ implementation
                           TAbstractRecordSymtable
 ****************************************************************************}
 
-    procedure tabstractrecordsymtable.load(ppufile:tcompilerppufile);
+    procedure tabstractrecordsymtable.ppuload(ppufile:tcompilerppufile);
       var
         storesymtable : tsymtable;
       begin
         storesymtable:=aktrecordsymtable;
         aktrecordsymtable:=self;
 
-        inherited load(ppufile);
+        inherited ppuload(ppufile);
 
         aktrecordsymtable:=storesymtable;
       end;
 
 
-    procedure tabstractrecordsymtable.write(ppufile:tcompilerppufile);
+    procedure tabstractrecordsymtable.ppuwrite(ppufile:tcompilerppufile);
       var
         oldtyp : byte;
         storesymtable : tsymtable;
@@ -981,7 +967,7 @@ implementation
          oldtyp:=ppufile.entrytyp;
          ppufile.entrytyp:=subentryid;
 
-         inherited write(ppufile);
+         inherited ppuwrite(ppufile);
 
          ppufile.entrytyp:=oldtyp;
          aktrecordsymtable:=storesymtable;
@@ -1123,20 +1109,20 @@ implementation
                           TAbstractLocalSymtable
 ****************************************************************************}
 
-    procedure tabstractlocalsymtable.load(ppufile:tcompilerppufile);
+    procedure tabstractlocalsymtable.ppuload(ppufile:tcompilerppufile);
       var
         storesymtable : tsymtable;
       begin
         storesymtable:=aktlocalsymtable;
         aktlocalsymtable:=self;
 
-        inherited load(ppufile);
+        inherited ppuload(ppufile);
 
         aktlocalsymtable:=storesymtable;
       end;
 
 
-   procedure tabstractlocalsymtable.write(ppufile:tcompilerppufile);
+   procedure tabstractlocalsymtable.ppuwrite(ppufile:tcompilerppufile);
       var
         oldtyp : byte;
         storesymtable : tsymtable;
@@ -1350,12 +1336,12 @@ implementation
                 unitid:=current_module.unitcount;
                 inc(current_module.unitcount);
              end;
-           asmList.concat(Tai_asm_comment.Create(strpnew('Begin unit '+name^+' has index '+tostr(unitid))));
+           asmList.concat(tai_comment.Create(strpnew('Begin unit '+name^+' has index '+tostr(unitid))));
            if cs_gdb_dbx in aktglobalswitches then
              begin
                 if dbx_count_ok then
                   begin
-                     asmList.concat(Tai_asm_comment.Create(strpnew('"repeated" unit '+name^
+                     asmList.concat(tai_comment.Create(strpnew('"repeated" unit '+name^
                               +' has index '+tostr(unitid)+' dbx count = '+tostr(dbx_count))));
                      asmList.concat(Tai_stabs.Create(strpnew('"'+name^+'",'
                        +tostr(N_EXCL)+',0,0,'+tostr(dbx_count))));
@@ -1380,7 +1366,7 @@ implementation
                   begin
                     dbx_counter := prev_dbx_count;
                     do_count_dbx:=false;
-                    asmList.concat(Tai_asm_comment.Create(strpnew('End unit '+name^
+                    asmList.concat(tai_comment.Create(strpnew('End unit '+name^
                       +' has index '+tostr(unitid))));
                     asmList.concat(Tai_stabs.Create(strpnew('"'+name^+'",'
                       +tostr(N_EINCL)+',0,0,0')));
@@ -1404,14 +1390,14 @@ implementation
       end;
 
 
-    procedure tstaticsymtable.load(ppufile:tcompilerppufile);
+    procedure tstaticsymtable.ppuload(ppufile:tcompilerppufile);
       begin
         aktstaticsymtable:=self;
 
         next:=symtablestack;
         symtablestack:=self;
 
-        inherited load(ppufile);
+        inherited ppuload(ppufile);
 
         { now we can deref the syms and defs }
         deref;
@@ -1421,11 +1407,11 @@ implementation
       end;
 
 
-    procedure tstaticsymtable.write(ppufile:tcompilerppufile);
+    procedure tstaticsymtable.ppuwrite(ppufile:tcompilerppufile);
       begin
         aktstaticsymtable:=self;
 
-        inherited write(ppufile);
+        inherited ppuwrite(ppufile);
       end;
 
 
@@ -1482,7 +1468,7 @@ implementation
              unittypecount:=1;
              pglobaltypecount := @unittypecount;
              {unitid:=current_module.unitcount;}
-             debugList.concat(Tai_asm_comment.Create(strpnew('Global '+name^+' has index '+tostr(unitid))));
+             debugList.concat(tai_comment.Create(strpnew('Global '+name^+' has index '+tostr(unitid))));
              debugList.concat(Tai_stabs.Create(strpnew('"'+name^+'",'+tostr(N_BINCL)+',0,0,0')));
              {inc(current_module.unitcount);}
              dbx_count_ok:=false;
@@ -1509,7 +1495,7 @@ implementation
        end;
 
 
-    procedure tglobalsymtable.load(ppufile:tcompilerppufile);
+    procedure tglobalsymtable.ppuload(ppufile:tcompilerppufile);
       begin
 {$ifdef GDB}
          if cs_gdb_dbx in aktglobalswitches then
@@ -1529,7 +1515,7 @@ implementation
          next:=symtablestack;
          symtablestack:=self;
 
-         inherited load(ppufile);
+         inherited ppuload(ppufile);
 
          { now we can deref the syms and defs }
          deref;
@@ -1544,10 +1530,10 @@ implementation
       end;
 
 
-    procedure tglobalsymtable.write(ppufile:tcompilerppufile);
+    procedure tglobalsymtable.ppuwrite(ppufile:tcompilerppufile);
       begin
         { write the symtable entries }
-        inherited write(ppufile);
+        inherited ppuwrite(ppufile);
 
         { write dbx count }
 {$ifdef GDB}
@@ -2072,7 +2058,13 @@ implementation
 end.
 {
   $Log$
-  Revision 1.67  2002-08-17 09:23:43  florian
+  Revision 1.68  2002-08-18 20:06:27  peter
+    * inlining is now also allowed in interface
+    * renamed write/load to ppuwrite/ppuload
+    * tnode storing in ppu
+    * nld,ncon,nbas are already updated for storing in ppu
+
+  Revision 1.67  2002/08/17 09:23:43  florian
     * first part of procinfo rewrite
 
   Revision 1.66  2002/08/11 13:24:15  peter

+ 7 - 2
compiler/symtype.pas

@@ -68,7 +68,6 @@ interface
          constructor create;
          procedure deref;virtual;abstract;
          procedure derefimpl;virtual;abstract;
-         procedure derefobjectdata;virtual;abstract;
          function  typename:string;
          function  gettypename:string;virtual;
          function  mangledparaname:string;
@@ -529,7 +528,13 @@ implementation
 end.
 {
   $Log$
-  Revision 1.20  2002-08-11 13:24:16  peter
+  Revision 1.21  2002-08-18 20:06:28  peter
+    * inlining is now also allowed in interface
+    * renamed write/load to ppuwrite/ppuload
+    * tnode storing in ppu
+    * nld,ncon,nbas are already updated for storing in ppu
+
+  Revision 1.20  2002/08/11 13:24:16  peter
     * saving of asmsymbols in ppu supported
     * asmsymbollist global is removed and moved into a new class
       tasmlibrarydata that will hold the info of a .a file which

Some files were not shown because too many files changed in this diff