浏览代码

* init and final code in genrtti.inc updated

florian 24 年之前
父节点
当前提交
5050f1ff66
共有 6 个文件被更改,包括 494 次插入520 次删除
  1. 399 455
      rtl/Makefile
  2. 6 4
      rtl/i386/rttip.inc
  3. 5 2
      rtl/inc/dynarr.inc
  4. 76 54
      rtl/inc/genrtti.inc
  5. 2 2
      rtl/inc/makefile.inc
  6. 6 3
      rtl/inc/rtti.inc

文件差异内容过多而无法显示
+ 399 - 455
rtl/Makefile


+ 6 - 4
rtl/i386/rttip.inc

@@ -30,7 +30,6 @@ asm
 // decide what type it is
         movl    TypeInfo,%ebx
         movb    (%ebx),%al
-// This is MANIFESTLY wrong
         subb    $9,%al
         jz      .LDoAnsiStringInit
         decb    %al
@@ -55,8 +54,8 @@ asm
         jmp     .LExitInitialize
         // Interfaces
 .LDoInterfaceInit:
-        movl Data, %eax
-        movl $0,(%eax)
+        movl    Data, %eax
+        movl    $0,(%eax)
         jmp     .LExitInitialize
         // Variants
 .LDoVariantInit:
@@ -483,7 +482,10 @@ end;
 
 {
   $Log$
-  Revision 1.11  2001-11-14 22:59:11  michael
+  Revision 1.12  2001-11-17 16:56:08  florian
+    * init and final code in genrtti.inc updated
+
+  Revision 1.11  2001/11/14 22:59:11  michael
   + Initial variant support
 
   Revision 1.10  2001/08/01 15:00:10  jonas

+ 5 - 2
rtl/inc/dynarr.inc

@@ -249,7 +249,10 @@ function fpc_dynarray_copy(var p : pointer;ti : pointer;
 
 {
   $Log$
-  Revision 1.11  2001-09-27 08:59:13  jonas
+  Revision 1.12  2001-11-17 16:56:08  florian
+    * init and final code in genrtti.inc updated
+
+  Revision 1.11  2001/09/27 08:59:13  jonas
     * fixed bug in dynarr_decr_ref I introduced with my previous fixes
 
   Revision 1.10  2001/09/26 14:07:25  jonas
@@ -257,7 +260,7 @@ function fpc_dynarray_copy(var p : pointer;ti : pointer;
       dynamical arrays
 
   Revision 1.9  2001/08/19 21:02:01  florian
-    * fixed and added a lot of stuff to get the Jedi DX( headers
+    * fixed and added a lot of stuff to get the Jedi DX8 headers
       compiled
 
   Revision 1.8  2001/08/01 15:00:10  jonas

+ 76 - 54
rtl/inc/genrtti.inc

@@ -23,7 +23,7 @@ Procedure fpc_Initialize (Data,TypeInfo : pointer);saveregisters;[Public,Alias :
   already defined or not so define it locally to avoid problems PM }
 Type
     Pbyte = ^Byte;
-    
+
 Var Temp       : PByte;
     I          : longint;
     Size,Count : longint;
@@ -32,33 +32,36 @@ Var Temp       : PByte;
 begin
   Temp:=PByte(TypeInfo);
   case temp^ of
-    tkAstring,tkWstring : PPchar(Data)^:=Nil;
-    tkArray :
+    tkAstring,tkWstring,tkInterface,tkDynArray:
+      PPchar(Data)^:=Nil;
+    tkArray:
       begin
-      temp:=Temp+1;
-      I:=temp^;
-      temp:=temp+(I+1);               // skip name string;
-      Size:=PArrayRec(Temp)^.Size;     // get element size
-      Count:=PArrayRec(Temp)^.Count;  // get element Count
-      TInfo:=PArrayRec(Temp)^.Info;   // Get element info
-      For I:=0 to Count-1 do
-        int_Initialize (Data+(I*size),TInfo);
+         inc(temp);
+         I:=temp^;
+         inc(temp,(I+1));                // skip name string;
+         Size:=PArrayRec(Temp)^.Size;    // get element size
+         Count:=PArrayRec(Temp)^.Count;  // get element Count
+         TInfo:=PArrayRec(Temp)^.Info;   // Get element info
+         For I:=0 to Count-1 do
+           int_Initialize (Data+(I*size),TInfo);
       end;
-    tkrecord :
+    tkRecord,tkClass,tkObject:
       begin
-      Temp:=Temp+1;
-      I:=Temp^;
-      temp:=temp+(I+1);             // skip name string;
-      Size:=PRecRec(Temp)^.Size;    // get record size; not needed.
-      Count:=PRecRec(Temp)^.Count;  // get element Count
-      For I:=1 to count Do
-        With PRecRec(Temp)^.elements[I] do
-          int_Initialize (Data+Offset,Info);
+         inc(Temp);
+         I:=Temp^;
+         inc(temp,I+1);             // skip name string;
+         { if it isn't necessary, why should we load it ? FK
+           Size:=PRecRec(Temp)^.Size;    // get record size; not needed.
+         }
+         Count:=PRecRec(Temp)^.Count;  // get element Count
+         For I:=1 to count Do
+           With PRecRec(Temp)^.elements[I] do
+             int_Initialize (Data+Offset,Info);
       end;
-{$ifdef HASVARIANTS}
+{$ifdef HASVARIANT}
     tkVariant:
       variant_init(Variant(PVarData(Data)^))
-{$endif HASVARIANTS}
+{$endif HASVARIANT}
   end;
 end;
 {$endif}
@@ -79,33 +82,42 @@ Var Temp       : PByte;
 begin
   Temp:=PByte(TypeInfo);
   case temp^ of
-    tkAstring,tkWstring : fpc_AnsiStr_Decr_Ref(Data);
+    tkAstring,tkWstring:
+      fpc_AnsiStr_Decr_Ref(Data);
     tkArray :
       begin
-      Temp:=Temp+1;
-      I:=temp^;
-      temp:=temp+(I+1);               // skip name string;
-      Size:=PArrayRec(Temp)^.Size;     // get element size
-      Count:=PArrayRec(Temp)^.Count;  // get element Count
-      TInfo:=PArrayRec(Temp)^.Info;   // Get element info
-      For I:=0 to Count-1 do
-        int_Finalize (Data+(I*size),TInfo);
+         inc(Temp);
+         I:=temp^;
+         inc(temp,I+1);                   // skip name string;
+         Size:=PArrayRec(Temp)^.Size;     // get element size
+         Count:=PArrayRec(Temp)^.Count;   // get element Count
+         TInfo:=PArrayRec(Temp)^.Info;    // Get element info
+         For I:=0 to Count-1 do
+           int_Finalize (Data+(I*size),TInfo);
       end;
-    tkrecord :
+    tkRecord,tkObject,tkClass:
       begin
-      Temp:=Temp+1;
-      I:=Temp^;
-      temp:=temp+(I+1);             // skip name string;
-      Size:=PRecRec(Temp)^.Size;    // get record size; not needed.
-      Count:=PRecRec(Temp)^.Count;  // get element Count
-      For I:=1 to count do
-        With PRecRec(Temp)^.elements[I] do
-          int_Finalize (Data+Offset,Info);
+         inc(Temp);
+         I:=Temp^;
+         inc(temp,I+1);                // skip name string;
+         { if it isn't necessary, why should we load it? FK
+           Size:=PRecRec(Temp)^.Size;    // get record size; not needed.
+         }
+         Count:=PRecRec(Temp)^.Count;  // get element Count
+         For I:=1 to count do
+           With PRecRec(Temp)^.elements[I] do
+             int_Finalize (Data+Offset,Info);
       end;
-{$ifdef HASVARIANTS}
+{$ifdef HASINTF}
+    tkInterface:
+      Intf_Decr_Ref(Data);
+{$endif HASINTF}
+    tkDynArray:
+      fpc_dynarray_decr_ref(Data,TypeInfo);
+{$ifdef HASVARIANT}
     tkVariant:
       variant_clear(Variant(PVarData(Data)^))
-{$endif HASVARIANTS}
+{$endif HASVARIANT}
   end;
 end;
 {$endif}
@@ -177,19 +189,20 @@ begin
   Temp:=PByte(TypeInfo);
   case temp^ of
     { see AddRef for comment about below construct (JM) }
-    tkAstring,tkWstring : fpc_AnsiStr_Decr_Ref(PPointer(Data)^);
-    tkArray :
+    tkAstring,tkWstring:
+      fpc_AnsiStr_Decr_Ref(PPointer(Data)^);
+    tkArray:
       begin
-      Temp:=Temp+1;
-      I:=temp^;
-      temp:=temp+(I+1);               // skip name string;
-      Size:=PArrayRec(Temp)^.Size;     // get element size
-      Count:=PArrayRec(Temp)^.Count;  // get element Count
-      TInfo:=PArrayRec(Temp)^.Info;   // Get element info
-      For I:=0 to Count-1 do
-        fpc_DecRef (Data+(I*size),TInfo);
+         inc(Temp);
+         I:=temp^;
+         inc(temp,I+1);               // skip name string;
+         Size:=PArrayRec(Temp)^.Size;     // get element size
+         Count:=PArrayRec(Temp)^.Count;  // get element Count
+         TInfo:=PArrayRec(Temp)^.Info;   // Get element info
+         For I:=0 to Count-1 do
+           fpc_DecRef (Data+(I*size),TInfo);
       end;
-    tkrecord :
+    tkrecord:
       begin
       Temp:=Temp+1;
       I:=Temp^;
@@ -200,6 +213,12 @@ begin
         With PRecRec(Temp)^.elements[I] do
           fpc_DecRef (Data+Offset,Info);
       end;
+    tkDynArray:
+      fpc_dynarray_decr_ref(Data,TypeInfo);
+{$ifdef HASINTF}
+    tkInterface:
+      Intf_Decr_Ref(Data);
+{$endif HASINTF}
   end;
 end;
 {$endif}
@@ -216,7 +235,10 @@ procedure fpc_FinalizeArray(data,typeinfo : pointer;count,size : longint); [Publ
 
 {
  $Log$
- Revision 1.7  2001-11-17 10:29:48  florian
+ Revision 1.8  2001-11-17 16:56:08  florian
+   * init and final code in genrtti.inc updated
+
+ Revision 1.7  2001/11/17 10:29:48  florian
    * make cycle for win32 fixed
 
  Revision 1.6  2001/11/14 22:59:11  michael

+ 2 - 2
rtl/inc/makefile.inc

@@ -6,8 +6,8 @@
 
 SYSNAMES=systemh heaph mathh filerec textrec system real2str sstrings innr \
          file typefile text rtti heap astrings objpas objpash except int64 \
-         generic
-         
+         generic dynarr varianth variant genrtti
+
 SYSINCNAMES=$(addsuffix .inc,$(SYSNAMES))
 
 # Other unit names which can be used for all systems

+ 6 - 3
rtl/inc/rtti.inc

@@ -40,7 +40,7 @@ Const
        tkBool          = 18;
        tkInt64         = 19;
        tkQWord         = 20;
-       tkDynArray = 21;
+       tkDynArray      = 21;
 
 { A record is designed as follows :
     1    : tkrecord
@@ -92,7 +92,10 @@ TArrayRec = record
 
 {
   $Log$
-  Revision 1.4  2001-04-23 18:25:45  peter
+  Revision 1.5  2001-11-17 16:56:08  florian
+    * init and final code in genrtti.inc updated
+
+  Revision 1.4  2001/04/23 18:25:45  peter
     * m68k updates
 
   Revision 1.3  2000/10/21 18:20:17  florian
@@ -104,4 +107,4 @@ TArrayRec = record
   Revision 1.2  2000/07/13 11:33:45  michael
   + removed logs
 
-}
+}

部分文件因为文件数量过多而无法显示