Przeglądaj źródła

* tai_const.create_ptr added

peter 21 lat temu
rodzic
commit
356b3378e8

+ 30 - 6
compiler/aasmtai.pas

@@ -53,6 +53,7 @@ interface
           ait_symbol,
           ait_symbol_end, { needed to calc the size of a symbol }
           ait_label,
+          ait_const_64bit,
           ait_const_32bit,
           ait_const_16bit,
           ait_const_8bit,
@@ -102,6 +103,7 @@ interface
           'symbol',
           'symbol_end',
           'label',
+          'const_64bit',
           'const_32bit',
           'const_16bit',
           'const_8bit',
@@ -329,9 +331,11 @@ interface
        end;
 
 
-       { Generates a long integer (32 bit) }
+       { Generates an integer const }
        tai_const = class(tai)
-          value : cardinal;
+          value : qword;
+          constructor Create_ptr(_value : TConstPtrUInt);
+          constructor Create_64bit(_value : qword);
           constructor Create_32bit(_value : cardinal);
           constructor Create_16bit(_value : word);
           constructor Create_8bit(_value : byte);
@@ -878,24 +882,41 @@ implementation
                                TAI_CONST
  ****************************************************************************}
 
-    constructor tai_const.Create_32bit(_value : cardinal);
+    constructor tai_const.Create_ptr(_value : TConstPtrUInt);
+      begin
+{$ifdef cpu64bit}
+        self.create_64bit(_value);
+{$else cpu64bit}
+        self.create_32bit(_value);
+{$endif cpu64bit}
+      end;
+
+
+    constructor tai_const.Create_64bit(_value : qword);
+      begin
+         inherited Create;
+         typ:=ait_const_64bit;
+         value:=_value;
+      end;
+
 
+    constructor tai_const.Create_32bit(_value : cardinal);
       begin
          inherited Create;
          typ:=ait_const_32bit;
          value:=_value;
       end;
 
-    constructor tai_const.Create_16bit(_value : word);
 
+    constructor tai_const.Create_16bit(_value : word);
       begin
          inherited Create;
          typ:=ait_const_16bit;
          value:=_value;
       end;
 
-    constructor tai_const.Create_8bit(_value : byte);
 
+    constructor tai_const.Create_8bit(_value : byte);
       begin
          inherited Create;
          typ:=ait_const_8bit;
@@ -1974,7 +1995,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.71  2004-02-08 23:10:21  jonas
+  Revision 1.72  2004-02-26 16:16:38  peter
+    * tai_const.create_ptr added
+
+  Revision 1.71  2004/02/08 23:10:21  jonas
     * taicpu.is_same_reg_move() now gets a regtype parameter so it only
       removes moves of that particular register type. This is necessary so
       we don't remove the live_start instruction of a register before it

+ 6 - 3
compiler/cresstr.pas

@@ -154,7 +154,7 @@ procedure TResourceStrings.CreateResourceStringList;
     With P Do
      begin
        if (Value=nil) or (len=0) then
-         resourcestringlist.concat(tai_const.create_32bit(0))
+         resourcestringlist.concat(tai_const.create_ptr(0))
        else
          begin
             objectlibrary.getdatalabel(l1);
@@ -171,7 +171,7 @@ procedure TResourceStrings.CreateResourceStringList;
             consts.concat(tai_const.create_8bit(0));
          end;
        { append Current value (nil) and hash...}
-       resourcestringlist.concat(tai_const.create_32bit(0));
+       resourcestringlist.concat(tai_const.create_ptr(0));
        resourcestringlist.concat(tai_const.create_32bit(hash));
        { Append the name as a ansistring. }
        objectlibrary.getdatalabel(l1);
@@ -300,7 +300,10 @@ end;
 end.
 {
   $Log$
-  Revision 1.20  2003-12-29 19:31:20  florian
+  Revision 1.21  2004-02-26 16:16:38  peter
+    * tai_const.create_ptr added
+
+  Revision 1.20  2003/12/29 19:31:20  florian
     * fixed error message, if a resource file can't be written
 
   Revision 1.19  2003/12/08 22:34:24  peter

+ 6 - 3
compiler/ncgcon.pas

@@ -349,7 +349,7 @@ implementation
                         begin
                            { an empty ansi string is nil! }
                            if len=0 then
-                             Consts.concat(Tai_const.Create_32bit(0))
+                             Consts.concat(Tai_const.Create_ptr(0))
                            else
                              begin
                                 objectlibrary.getdatalabel(l1);
@@ -374,7 +374,7 @@ implementation
                         begin
                            { an empty wide string is nil! }
                            if len=0 then
-                             Consts.concat(Tai_const.Create_32bit(0))
+                             Consts.concat(Tai_const.Create_ptr(0))
                            else
                              begin
                                 objectlibrary.getdatalabel(l1);
@@ -574,7 +574,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.36  2004-01-24 18:12:40  florian
+  Revision 1.37  2004-02-26 16:16:38  peter
+    * tai_const.create_ptr added
+
+  Revision 1.36  2004/01/24 18:12:40  florian
     * fixed several arm floating point issues
 
   Revision 1.35  2004/01/12 16:39:40  peter

+ 16 - 13
compiler/nobj.pas

@@ -444,8 +444,8 @@ implementation
               datasegment.concat(tai_align.create(const_align(POINTER_SIZE)));
               dataSegment.concat(Tai_label.Create(r));
               { entries for caching }
-              dataSegment.concat(Tai_const.Create_32bit(0));
-              dataSegment.concat(Tai_const.Create_32bit(0));
+              dataSegment.concat(Tai_const.Create_ptr(0));
+              dataSegment.concat(Tai_const.Create_ptr(0));
 
               dataSegment.concat(Tai_const.Create_32bit(count));
               if assigned(root) then
@@ -897,7 +897,7 @@ implementation
         else
           begin
             { nil for Corba interfaces }
-            dataSegment.concat(Tai_const.Create_32bit(0)); { nil }
+            dataSegment.concat(Tai_const.Create_ptr(0)); { nil }
           end;
         { VTable }
         dataSegment.concat(Tai_const_symbol.Createname(gintfgetvtbllabelname(contintfindex)));
@@ -1281,7 +1281,7 @@ implementation
               if assigned(dmtlabel) then
                 dataSegment.concat(Tai_const_symbol.Create(dmtlabel)))
               else
-                dataSegment.concat(Tai_const.Create_32bit(0));
+                dataSegment.concat(Tai_const.Create_ptr(0));
            end;
 {$endif WITHDMT}
          { write pointer to parent VMT, this isn't implemented in TP }
@@ -1292,7 +1292,7 @@ implementation
             (oo_has_vmt in _class.childof.objectoptions) then
            dataSegment.concat(Tai_const_symbol.Createname(_class.childof.vmt_mangledname))
          else
-           dataSegment.concat(Tai_const.Create_32bit(0));
+           dataSegment.concat(Tai_const.Create_ptr(0));
 
          { write extended info for classes, for the order see rtl/inc/objpash.inc }
          if is_class(_class) then
@@ -1303,36 +1303,36 @@ implementation
             if (oo_has_msgint in _class.objectoptions) then
               dataSegment.concat(Tai_const_symbol.Create(intmessagetable))
             else
-              dataSegment.concat(Tai_const.Create_32bit(0));
+              dataSegment.concat(Tai_const.Create_ptr(0));
             { pointer to method table }
             if assigned(methodnametable) then
               dataSegment.concat(Tai_const_symbol.Create(methodnametable))
             else
-              dataSegment.concat(Tai_const.Create_32bit(0));
+              dataSegment.concat(Tai_const.Create_ptr(0));
             { pointer to field table }
             dataSegment.concat(Tai_const_symbol.Create(fieldtablelabel));
             { pointer to type info of published section }
             if (oo_can_have_published in _class.objectoptions) then
               dataSegment.concat(Tai_const_symbol.Create(_class.get_rtti_label(fullrtti)))
             else
-              dataSegment.concat(Tai_const.Create_32bit(0));
+              dataSegment.concat(Tai_const.Create_ptr(0));
             { inittable for con-/destruction }
             if _class.members_need_inittable then
               dataSegment.concat(Tai_const_symbol.Create(_class.get_rtti_label(initrtti)))
             else
-              dataSegment.concat(Tai_const.Create_32bit(0));
+              dataSegment.concat(Tai_const.Create_ptr(0));
             { auto table }
-            dataSegment.concat(Tai_const.Create_32bit(0));
+            dataSegment.concat(Tai_const.Create_ptr(0));
             { interface table }
             if _class.implementedinterfaces.count>0 then
               dataSegment.concat(Tai_const_symbol.Create(interfacetable))
             else
-              dataSegment.concat(Tai_const.Create_32bit(0));
+              dataSegment.concat(Tai_const.Create_ptr(0));
             { table for string messages }
             if (oo_has_msgstr in _class.objectoptions) then
               dataSegment.concat(Tai_const_symbol.Create(strmessagetable))
             else
-              dataSegment.concat(Tai_const.Create_32bit(0));
+              dataSegment.concat(Tai_const.Create_ptr(0));
           end;
          { write virtual methods }
          writevirtualmethods(dataSegment);
@@ -1380,7 +1380,10 @@ initialization
 end.
 {
   $Log$
-  Revision 1.62  2004-02-19 17:07:42  florian
+  Revision 1.63  2004-02-26 16:16:38  peter
+    * tai_const.create_ptr added
+
+  Revision 1.62  2004/02/19 17:07:42  florian
     * fixed arg. area calculation
 
   Revision 1.61  2004/02/13 15:41:24  peter

+ 9 - 6
compiler/pmodules.pas

@@ -242,7 +242,7 @@ implementation
             s:=make_mangledname('THREADVARLIST',current_module.localsymtable,'');
             { add begin and end of the list }
             ltvTable.insert(tai_symbol.createdataname_global(s,0));
-            ltvTable.concat(tai_const.create_32bit(0));  { end of list marker }
+            ltvTable.concat(tai_const.create_ptr(0));  { end of list marker }
             ltvTable.concat(tai_symbol_end.createname(s));
             if (cs_create_smart in aktmoduleswitches) then
              dataSegment.concat(Tai_cut.Create);
@@ -307,11 +307,11 @@ implementation
               if (hp.u.flags and uf_init)<>0 then
                unitinits.concat(Tai_const_symbol.Createname(make_mangledname('INIT$',hp.u.globalsymtable,'')))
               else
-               unitinits.concat(Tai_const.Create_32bit(0));
+               unitinits.concat(Tai_const.Create_ptr(0));
               if (hp.u.flags and uf_finalize)<>0 then
                unitinits.concat(Tai_const_symbol.Createname(make_mangledname('FINALIZE$',hp.u.globalsymtable,'')))
               else
-               unitinits.concat(Tai_const.Create_32bit(0));
+               unitinits.concat(Tai_const.Create_ptr(0));
               inc(count);
             end;
            hp:=tused_unit(hp.next);
@@ -322,11 +322,11 @@ implementation
            if (current_module.flags and uf_init)<>0 then
             unitinits.concat(Tai_const_symbol.Createname(make_mangledname('INIT$',current_module.localsymtable,'')))
            else
-            unitinits.concat(Tai_const.Create_32bit(0));
+            unitinits.concat(Tai_const.Create_ptr(0));
            if (current_module.flags and uf_finalize)<>0 then
             unitinits.concat(Tai_const_symbol.Createname(make_mangledname('FINALIZE$',current_module.localsymtable,'')))
            else
-            unitinits.concat(Tai_const.Create_32bit(0));
+            unitinits.concat(Tai_const.Create_ptr(0));
            inc(count);
          end;
         { TableCount,InitCount }
@@ -1438,7 +1438,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.139  2004-02-06 22:37:00  daniel
+  Revision 1.140  2004-02-26 16:16:38  peter
+    * tai_const.create_ptr added
+
+  Revision 1.139  2004/02/06 22:37:00  daniel
     * Removed not very usefull nextglobal & previousglobal fields from
       Tstoreddef, saving 78 kb of memory
 

+ 5 - 1
compiler/psystem.pas

@@ -448,6 +448,7 @@ implementation
         aiclass[ait_symbol]:=tai_symbol;
         aiclass[ait_symbol_end]:=tai_symbol_end;
         aiclass[ait_label]:=tai_label;
+        aiclass[ait_const_64bit]:=tai_const;
         aiclass[ait_const_32bit]:=tai_const;
         aiclass[ait_const_16bit]:=tai_const;
         aiclass[ait_const_8bit]:=tai_const;
@@ -488,7 +489,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.62  2004-02-04 22:15:15  daniel
+  Revision 1.63  2004-02-26 16:16:38  peter
+    * tai_const.create_ptr added
+
+  Revision 1.62  2004/02/04 22:15:15  daniel
     * Rtti generation moved to ncgutil
     * Assmtai usage of symsym removed
     * operator overloading cleanup up

+ 9 - 5
compiler/symdef.pas

@@ -1730,7 +1730,7 @@ implementation
          if assigned(basedef) then
            rttiList.concat(Tai_const_symbol.Create(basedef.get_rtti_label(rt)))
          else
-           rttiList.concat(Tai_const.Create_32bit(0));
+           rttiList.concat(Tai_const.Create_ptr(0));
          hp:=tenumsym(firstenum);
          while assigned(hp) do
            begin
@@ -1908,6 +1908,7 @@ implementation
             begin
               rttiList.concat(Tai_const.Create_8bit(tkInt64));
               write_rtti_name;
+{$warning maybe change to create_64bit}
               if target_info.endian=endian_little then
                 begin
                   { low }
@@ -5400,7 +5401,7 @@ implementation
                    { isn't it stored ? }
                    if not(ppo_stored in tpropertysym(sym).propoptions) then
                      begin
-                        rttiList.concat(Tai_const.Create_32bit(0));
+                        rttiList.concat(Tai_const.Create_ptr(0));
                         proctypesinfo:=proctypesinfo or (3 shl 4);
                      end
                    else
@@ -5607,13 +5608,13 @@ implementation
                   not(objecttype in [odt_interfacecom,odt_interfacecorba]) then
                  rttiList.concat(Tai_const_symbol.Createname(vmt_mangledname))
                else
-                 rttiList.concat(Tai_const.Create_32bit(0));
+                 rttiList.concat(Tai_const.Create_ptr(0));
 
                { write owner typeinfo }
                if assigned(childof) and (oo_can_have_published in childof.objectoptions) then
                  rttiList.concat(Tai_const_symbol.Create(childof.get_rtti_label(fullrtti)))
                else
-                 rttiList.concat(Tai_const.Create_32bit(0));
+                 rttiList.concat(Tai_const.Create_ptr(0));
 
                { count total number of properties }
                if assigned(childof) and (oo_can_have_published in childof.objectoptions) then
@@ -6118,7 +6119,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.222  2004-02-22 19:55:25  daniel
+  Revision 1.223  2004-02-26 16:16:38  peter
+    * tai_const.create_ptr added
+
+  Revision 1.222  2004/02/22 19:55:25  daniel
     * Revert my latest change
 
   Revision 1.221  2004/02/22 18:49:03  daniel