[fpc-devel] RTTI interface & variant late binding issue (mORMot)
Steve Hildebrandt
Steve.Kassel at web.de
Wed Feb 25 21:12:41 CET 2015
Am 25.02.2015 um 20:37 schrieb Alfred:
> Well. About the non compatible. I can only detect these:
> 1)
> RTTICount: Word; //$FFFF if there is no further info, or the value of
> Count
> I did not see it set to $FFFF in case of missing RTTI. As Delphi
> reportedly does.
> But perhaps this has already been done somewhere else.
> But, in my opinion, this is not of much importance
In my opinion this is never the case the way the RTTI is currently
generated so this shouldn't be an issue.
> 2)
> Properties are in front of methods.
> This is different from Delphi.
> But I know that this cannot be changed.
> That would break a whole lot of code !
> And again, if you are aware of this: no problems at all.
>
Here the opinion of others would be nice, since the RTTI was partly
generated but not added to "typinfo.pas".
Original:
tkInterface:
(
IntfParent: PTypeInfo;
IntfFlags : TIntfFlagsBase;
GUID: TGUID;
IntfUnit: ShortString;
{
IntfProps: array of TPropInfo;
}
);
//useless since you would not know how many properties there are
Current:
tkInterface:
(
IntfParent: PTypeInfo;
IntfFlags : TIntfFlagsBase;
GUID: TGUID;
IntfUnit: ShortString;
{
IntfPropCount: Word;
IntfProps: array[0..IntfPropCount-1] of TPropInfo;
IntfMethTable : TIntfMethodTable;
}
);
//I simply assumed this to be the easier change. Still would break some
code, if property RTTI for interfaces was ever used anywhere.
How would the layout in Delphi look like?
> And I am willing to test on simple ARM (Pi[2], BBB).
> If you provide me with code !
It seemed simple enough see attached Patch.
ParReg: r0-r3=0..3
mfg Steve
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20150225/c502d357/attachment.html>
-------------- next part --------------
>From 8a8b253e779dcad74559ee2b39a4e9ec7c1aa3ba Mon Sep 17 00:00:00 2001
From: Steve Hildebrandt <Steve.Kassel at web.de>
Date: Wed, 25 Feb 2015 21:10:03 +0100
Subject: [PATCH 6/6] Updated paramgr implementation for arm
---
compiler/arm/cpupara.pas | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/compiler/arm/cpupara.pas b/compiler/arm/cpupara.pas
index a917850..fd6fc6d 100644
--- a/compiler/arm/cpupara.pas
+++ b/compiler/arm/cpupara.pas
@@ -36,6 +36,7 @@ unit cpupara;
function get_volatile_registers_int(calloption : tproccalloption):tcpuregisterset;override;
function get_volatile_registers_fpu(calloption : tproccalloption):tcpuregisterset;override;
function get_volatile_registers_mm(calloption : tproccalloption):tcpuregisterset;override;
+ procedure get_para_regoff(proccalloption: tproccalloption; paraloc: pcgparalocation; out reg: Byte; out off: LongInt);override;
function push_addr_param(varspez:tvarspez;def : tdef;calloption : tproccalloption) : boolean;override;
function ret_in_param(def:tdef;pd:tabstractprocdef):boolean;override;
procedure getintparaloc(pd : tabstractprocdef; nr : longint; var cgpara : tcgpara);override;
@@ -79,6 +80,25 @@ unit cpupara;
result:=VOLATILE_MMREGISTERS;
end;
+ procedure tarmparamanager.get_para_regoff(proccalloption: tproccalloption; paraloc: pcgparalocation; out reg: Byte; out off: LongInt);
+ var
+ I : SizeInt;
+ begin
+ with paraloc^ do
+ case loc of
+ LOC_REGISTER:
+ begin
+ reg:=getsupreg(register)-RS_R0;
+ off:=0;
+ end;
+ LOC_REFERENCE:
+ begin
+ reg:=255;
+ off:=reference.offset;
+ end;
+ end;
+ end;
+
procedure tarmparamanager.getintparaloc(pd : tabstractprocdef; nr : longint; var cgpara : tcgpara);
var
--
1.9.5.msysgit.0
More information about the fpc-devel
mailing list