+ 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 -
This commit is contained in:
svenbarth 2017-01-08 16:08:35 +00:00
parent 62fc960e63
commit 5275c36393
3 changed files with 19 additions and 4 deletions

View File

@ -995,7 +995,7 @@ implementation
procedure write_param_flag(parasym:tparavarsym);
var
paraspec : byte;
paraspec : word;
begin
case parasym.varspez of
vs_value : paraspec := 0;
@ -1016,13 +1016,22 @@ implementation
}
if is_class_or_interface(parasym.vardef) then
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
big endian systems
}
if (target_info.endian = endian_big) then
paraspec:=reverse_byte(paraspec);
paraspec:=reverse_word(paraspec);
{ write flags for current parameter }
tcb.emit_ord_const(paraspec,u8inttype);
tcb.emit_ord_const(paraspec,u16inttype);
end;
procedure write_para(parasym:tparavarsym);

View File

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

View File

@ -55,7 +55,9 @@ unit typinfo;
TMethodKind = (mkProcedure,mkFunction,mkConstructor,mkDestructor,
mkClassProcedure,mkClassFunction,mkClassConstructor,
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;
TIntfFlag = (ifHasGuid,ifDispInterface,ifDispatch,ifHasStrGUID);
TIntfFlags = set of TIntfFlag;