|
@@ -328,7 +328,6 @@ unit TypInfo;
|
|
{$endif FPC_REQUIRES_PROPER_ALIGNMENT}
|
|
{$endif FPC_REQUIRES_PROPER_ALIGNMENT}
|
|
record
|
|
record
|
|
private
|
|
private
|
|
- function GetParaLocs: PParameterLocations; inline;
|
|
|
|
function GetTail: Pointer; inline;
|
|
function GetTail: Pointer; inline;
|
|
function GetNext: PVmtMethodParam; inline;
|
|
function GetNext: PVmtMethodParam; inline;
|
|
function GetName: ShortString; inline;
|
|
function GetName: ShortString; inline;
|
|
@@ -336,9 +335,8 @@ unit TypInfo;
|
|
ParamType: PPTypeInfo;
|
|
ParamType: PPTypeInfo;
|
|
Flags: TParamFlags;
|
|
Flags: TParamFlags;
|
|
NamePtr: PShortString;
|
|
NamePtr: PShortString;
|
|
- { ParaLocs: TParameterLocations; }
|
|
|
|
|
|
+ ParaLocs: PParameterLocations;
|
|
property Name: ShortString read GetName;
|
|
property Name: ShortString read GetName;
|
|
- property ParaLocs: PParameterLocations read GetParaLocs;
|
|
|
|
property Tail: Pointer read GetTail;
|
|
property Tail: Pointer read GetTail;
|
|
property Next: PVmtMethodParam read GetNext;
|
|
property Next: PVmtMethodParam read GetNext;
|
|
end;
|
|
end;
|
|
@@ -363,7 +361,7 @@ unit TypInfo;
|
|
StackSize: SizeInt;
|
|
StackSize: SizeInt;
|
|
NamePtr: PShortString;
|
|
NamePtr: PShortString;
|
|
{ Params: array[0..ParamCount - 1] of TVmtMethodParam }
|
|
{ Params: array[0..ParamCount - 1] of TVmtMethodParam }
|
|
- { ResultLocs: TParameterLocations (if ResultType != Nil) }
|
|
|
|
|
|
+ { ResultLocs: PParameterLocations (if ResultType != Nil) }
|
|
property Name: ShortString read GetName;
|
|
property Name: ShortString read GetName;
|
|
property Param[Index: Word]: PVmtMethodParam read GetParam;
|
|
property Param[Index: Word]: PVmtMethodParam read GetParam;
|
|
property ResultLocs: PParameterLocations read GetResultLocs;
|
|
property ResultLocs: PParameterLocations read GetResultLocs;
|
|
@@ -2964,14 +2962,9 @@ end;
|
|
|
|
|
|
{ TVmtMethodParam }
|
|
{ TVmtMethodParam }
|
|
|
|
|
|
-function TVmtMethodParam.GetParaLocs: PParameterLocations;
|
|
|
|
-begin
|
|
|
|
- Result := PParameterLocations(aligntoptr(PByte(@NamePtr) + SizeOf(NamePtr)));
|
|
|
|
-end;
|
|
|
|
-
|
|
|
|
function TVmtMethodParam.GetTail: Pointer;
|
|
function TVmtMethodParam.GetTail: Pointer;
|
|
begin
|
|
begin
|
|
- Result := ParaLocs^.Tail;
|
|
|
|
|
|
+ Result := PByte(@ParaLocs) + SizeOf(ParaLocs);
|
|
end;
|
|
end;
|
|
|
|
|
|
function TVmtMethodParam.GetNext: PVmtMethodParam;
|
|
function TVmtMethodParam.GetNext: PVmtMethodParam;
|
|
@@ -2991,39 +2984,24 @@ begin
|
|
if Index >= ParamCount then
|
|
if Index >= ParamCount then
|
|
Result := Nil
|
|
Result := Nil
|
|
else
|
|
else
|
|
- begin
|
|
|
|
- Result := PVmtMethodParam(aligntoptr(PByte(@NamePtr) + SizeOf(NamePtr)));
|
|
|
|
- while Index > 0 do
|
|
|
|
- begin
|
|
|
|
- Result := Result^.Next;
|
|
|
|
- Dec(Index);
|
|
|
|
- end;
|
|
|
|
- end;
|
|
|
|
|
|
+ Result := PVmtMethodParam(PByte(aligntoptr(PByte(@NamePtr) + SizeOf(NamePtr))) + Index * PtrUInt(aligntoptr(Pointer(SizeOf(TVmtMethodParam)))));
|
|
end;
|
|
end;
|
|
|
|
|
|
function TIntfMethodEntry.GetResultLocs: PParameterLocations;
|
|
function TIntfMethodEntry.GetResultLocs: PParameterLocations;
|
|
begin
|
|
begin
|
|
if not Assigned(ResultType) then
|
|
if not Assigned(ResultType) then
|
|
Result := Nil
|
|
Result := Nil
|
|
- else if ParamCount = 0 then
|
|
|
|
- Result := PParameterLocations(aligntoptr(PByte(@NamePtr) + SizeOf(NamePtr)))
|
|
|
|
else
|
|
else
|
|
- Result := PParameterLocations(aligntoptr(Param[ParamCount - 1]^.Tail));
|
|
|
|
|
|
+ Result := PParameterLocations(PByte(aligntoptr(PByte(@NamePtr) + SizeOf(NamePtr))) + ParamCount * PtrUInt(aligntoptr(Pointer(SizeOf(TVmtMethodParam)))));
|
|
end;
|
|
end;
|
|
|
|
|
|
function TIntfMethodEntry.GetTail: Pointer;
|
|
function TIntfMethodEntry.GetTail: Pointer;
|
|
-var
|
|
|
|
- retloc: PParameterLocations;
|
|
|
|
begin
|
|
begin
|
|
|
|
+ Result := PByte(@NamePtr) + SizeOf(NamePtr);
|
|
|
|
+ if ParamCount > 0 then
|
|
|
|
+ Result := PByte(aligntoptr(Result)) + ParamCount * PtrUInt(aligntoptr(Pointer(SizeOf(TVmtMethodParam))));
|
|
if Assigned(ResultType) then
|
|
if Assigned(ResultType) then
|
|
- begin
|
|
|
|
- retloc := ResultLocs;
|
|
|
|
- Result := PByte(@retloc^.Count) + SizeOf(retloc^.Count) + SizeOf(TParameterLocation) * retloc^.Count;
|
|
|
|
- end
|
|
|
|
- else if ParamCount = 0 then
|
|
|
|
- Result := PByte(@NamePtr) + SizeOf(NamePtr)
|
|
|
|
- else
|
|
|
|
- Result := Param[ParamCount - 1]^.Tail;
|
|
|
|
|
|
+ Result := PByte(aligntoptr(Result)) + SizeOf(PParameterLocations);
|
|
end;
|
|
end;
|
|
|
|
|
|
function TIntfMethodEntry.GetNext: PIntfMethodEntry;
|
|
function TIntfMethodEntry.GetNext: PIntfMethodEntry;
|