Browse Source

+ extend TParamFlags by values for hidden parameters in general and especially the hidden high, self and vmt parameters (this is necessary so a manager approach for Invoke() can be used with as few knowledge about the involved calling conventions as possible)
Note: with this TParamFlags exceeds the size of a Byte

git-svn-id: trunk@35267 -

svenbarth 8 years ago
parent
commit
5275c36393
3 changed files with 19 additions and 4 deletions
  1. 12 3
      compiler/ncgrtti.pas
  2. 4 0
      compiler/symconst.pas
  3. 3 1
      rtl/objpas/typinfo.pp

+ 12 - 3
compiler/ncgrtti.pas

@@ -995,7 +995,7 @@ implementation
 
 
            procedure write_param_flag(parasym:tparavarsym);
            procedure write_param_flag(parasym:tparavarsym);
              var
              var
-               paraspec : byte;
+               paraspec : word;
              begin
              begin
                case parasym.varspez of
                case parasym.varspez of
                  vs_value   : paraspec := 0;
                  vs_value   : paraspec := 0;
@@ -1016,13 +1016,22 @@ implementation
                }
                }
                if is_class_or_interface(parasym.vardef) then
                if is_class_or_interface(parasym.vardef) then
                  paraspec:=paraspec or pfAddress;
                  paraspec:=paraspec or pfAddress;
+               { flags for the hidden parameters }
+               if vo_is_hidden_para in parasym.varoptions then
+                 paraspec:=paraspec or pfHidden;
+               if vo_is_high_para in parasym.varoptions then
+                 paraspec:=paraspec or pfHigh;
+               if vo_is_self in parasym.varoptions then
+                 paraspec:=paraspec or pfSelf;
+               if vo_is_vmt in parasym.varoptions then
+                 paraspec:=paraspec or pfVmt;
                { set bits run from the highest to the lowest bit on
                { set bits run from the highest to the lowest bit on
                  big endian systems
                  big endian systems
                }
                }
                if (target_info.endian = endian_big) then
                if (target_info.endian = endian_big) then
-                 paraspec:=reverse_byte(paraspec);
+                 paraspec:=reverse_word(paraspec);
                { write flags for current parameter }
                { write flags for current parameter }
-               tcb.emit_ord_const(paraspec,u8inttype);
+               tcb.emit_ord_const(paraspec,u16inttype);
              end;
              end;
 
 
            procedure write_para(parasym:tparavarsym);
            procedure write_para(parasym:tparavarsym);

+ 4 - 0
compiler/symconst.pas

@@ -105,6 +105,10 @@ const
   pfReference= 16;
   pfReference= 16;
   pfOut      = 32;
   pfOut      = 32;
   pfConstRef = 64;
   pfConstRef = 64;
+  pfHidden   = 128;
+  pfHigh     = 256;
+  pfSelf     = 512;
+  pfVmt      = 1024;
 
 
   unknown_level         = 0;
   unknown_level         = 0;
   main_program_level    = 1;
   main_program_level    = 1;

+ 3 - 1
rtl/objpas/typinfo.pp

@@ -55,7 +55,9 @@ unit typinfo;
        TMethodKind = (mkProcedure,mkFunction,mkConstructor,mkDestructor,
        TMethodKind = (mkProcedure,mkFunction,mkConstructor,mkDestructor,
                       mkClassProcedure,mkClassFunction,mkClassConstructor,
                       mkClassProcedure,mkClassFunction,mkClassConstructor,
                       mkClassDestructor,mkOperatorOverload);
                       mkClassDestructor,mkOperatorOverload);
-       TParamFlag     = (pfVar,pfConst,pfArray,pfAddress,pfReference,pfOut,pfConstRef);
+       TParamFlag     = (pfVar,pfConst,pfArray,pfAddress,pfReference,pfOut,pfConstRef
+                         {$ifndef VER3_0},pfHidden,pfHigh,pfSelf,pfVmt{$endif VER3_0}
+                         );
        TParamFlags    = set of TParamFlag;
        TParamFlags    = set of TParamFlag;
        TIntfFlag      = (ifHasGuid,ifDispInterface,ifDispatch,ifHasStrGUID);
        TIntfFlag      = (ifHasGuid,ifDispInterface,ifDispatch,ifHasStrGUID);
        TIntfFlags     = set of TIntfFlag;
        TIntfFlags     = set of TIntfFlag;