mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-23 06:49:49 +02:00
* fix alignments in vmt, remove all explicit 16 and 32 bit values
git-svn-id: trunk@2521 -
This commit is contained in:
parent
c10f73f1a3
commit
d7692a588e
@ -290,7 +290,7 @@ implementation
|
|||||||
function tclassheader.genstrmsgtab : tasmlabel;
|
function tclassheader.genstrmsgtab : tasmlabel;
|
||||||
var
|
var
|
||||||
r : tasmlabel;
|
r : tasmlabel;
|
||||||
count : longint;
|
count : aint;
|
||||||
begin
|
begin
|
||||||
root:=nil;
|
root:=nil;
|
||||||
count:=0;
|
count:=0;
|
||||||
@ -306,7 +306,7 @@ implementation
|
|||||||
asmlist[al_globals].concat(cai_align.create(const_align(sizeof(aint))));
|
asmlist[al_globals].concat(cai_align.create(const_align(sizeof(aint))));
|
||||||
asmlist[al_globals].concat(Tai_label.Create(r));
|
asmlist[al_globals].concat(Tai_label.Create(r));
|
||||||
genstrmsgtab:=r;
|
genstrmsgtab:=r;
|
||||||
asmlist[al_globals].concat(Tai_const.Create_32bit(count));
|
asmlist[al_globals].concat(Tai_const.Create_aint(count));
|
||||||
if assigned(root) then
|
if assigned(root) then
|
||||||
begin
|
begin
|
||||||
writestrentry(root);
|
writestrentry(root);
|
||||||
@ -900,7 +900,6 @@ implementation
|
|||||||
implintf:=_class.implementedinterfaces;
|
implintf:=_class.implementedinterfaces;
|
||||||
curintf:=implintf.interfaces(intfindex);
|
curintf:=implintf.interfaces(intfindex);
|
||||||
{ GUID }
|
{ GUID }
|
||||||
asmlist[al_globals].concat(cai_align.create(const_align(sizeof(aint))));
|
|
||||||
if curintf.objecttype in [odt_interfacecom] then
|
if curintf.objecttype in [odt_interfacecom] then
|
||||||
begin
|
begin
|
||||||
{ label for GUID }
|
{ label for GUID }
|
||||||
@ -922,7 +921,7 @@ implementation
|
|||||||
{ VTable }
|
{ VTable }
|
||||||
asmlist[al_globals].concat(Tai_const.Createname(gintfgetvtbllabelname(contintfindex),AT_DATA,0));
|
asmlist[al_globals].concat(Tai_const.Createname(gintfgetvtbllabelname(contintfindex),AT_DATA,0));
|
||||||
{ IOffset field }
|
{ IOffset field }
|
||||||
asmlist[al_globals].concat(Tai_const.Create_32bit(implintf.ioffsets(contintfindex)));
|
asmlist[al_globals].concat(Tai_const.Create_aint(implintf.ioffsets(contintfindex)));
|
||||||
{ IIDStr }
|
{ IIDStr }
|
||||||
objectlibrary.getdatalabel(tmplabel);
|
objectlibrary.getdatalabel(tmplabel);
|
||||||
rawdata.concat(cai_align.create(const_align(sizeof(aint))));
|
rawdata.concat(cai_align.create(const_align(sizeof(aint))));
|
||||||
@ -1043,7 +1042,6 @@ implementation
|
|||||||
max:=_class.implementedinterfaces.count;
|
max:=_class.implementedinterfaces.count;
|
||||||
|
|
||||||
rawdata:=TAAsmOutput.Create;
|
rawdata:=TAAsmOutput.Create;
|
||||||
asmlist[al_globals].concat(Tai_const.Create_16bit(max));
|
|
||||||
{ Two pass, one for allocation and vtbl creation }
|
{ Two pass, one for allocation and vtbl creation }
|
||||||
for i:=1 to max do
|
for i:=1 to max do
|
||||||
begin
|
begin
|
||||||
@ -1061,6 +1059,7 @@ implementation
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
{ second pass: for fill interfacetable and remained ioffsets }
|
{ second pass: for fill interfacetable and remained ioffsets }
|
||||||
|
asmlist[al_globals].concat(Tai_const.Create_aint(max));
|
||||||
for i:=1 to max do
|
for i:=1 to max do
|
||||||
begin
|
begin
|
||||||
j:=_class.implementedinterfaces.implindex(i);
|
j:=_class.implementedinterfaces.implindex(i);
|
||||||
@ -1165,14 +1164,12 @@ implementation
|
|||||||
curintf:=_class.implementedinterfaces.interfaces(intfindex);
|
curintf:=_class.implementedinterfaces.interfaces(intfindex);
|
||||||
gintfwalkdowninterface(curintf,intfindex);
|
gintfwalkdowninterface(curintf,intfindex);
|
||||||
end;
|
end;
|
||||||
{ 2. step calc required fieldcount and their offsets in the object memory map
|
{ 2. Optimize interface tables to reuse wrappers }
|
||||||
and write data }
|
gintfoptimizevtbls;
|
||||||
|
{ 3. Calculate offsets in object map and Write interface tables }
|
||||||
objectlibrary.getdatalabel(intftable);
|
objectlibrary.getdatalabel(intftable);
|
||||||
asmlist[al_globals].concat(cai_align.create(const_align(sizeof(aint))));
|
asmlist[al_globals].concat(cai_align.create(const_align(sizeof(aint))));
|
||||||
asmlist[al_globals].concat(Tai_label.Create(intftable));
|
asmlist[al_globals].concat(Tai_label.Create(intftable));
|
||||||
{ Optimize interface tables to reuse wrappers }
|
|
||||||
gintfoptimizevtbls;
|
|
||||||
{ Write interface tables }
|
|
||||||
gintfwritedata;
|
gintfwritedata;
|
||||||
genintftable:=intftable;
|
genintftable:=intftable;
|
||||||
end;
|
end;
|
||||||
|
@ -72,7 +72,7 @@
|
|||||||
PMsgStrTable = ^TMsgStrTable;
|
PMsgStrTable = ^TMsgStrTable;
|
||||||
|
|
||||||
TStringMessageTable = record
|
TStringMessageTable = record
|
||||||
count : dword;
|
count : PtrInt;
|
||||||
msgstrtable : array[0..0] of tmsgstrtable;
|
msgstrtable : array[0..0] of tmsgstrtable;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -96,17 +96,17 @@
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
pinterfaceentry = ^tinterfaceentry;
|
pinterfaceentry = ^tinterfaceentry;
|
||||||
tinterfaceentry = packed record
|
tinterfaceentry = record
|
||||||
IID: pguid; { if assigned(IID) then Com else Corba}
|
IID : pguid; { if assigned(IID) then Com else Corba}
|
||||||
VTable: Pointer;
|
VTable : Pointer;
|
||||||
IOffset: DWord;
|
IOffset : PtrInt;
|
||||||
IIDStr: pshortstring; { never nil. Com: upper(GuidToString(IID^)) }
|
IIDStr : pshortstring; { never nil. Com: upper(GuidToString(IID^)) }
|
||||||
end;
|
end;
|
||||||
|
|
||||||
pinterfacetable = ^tinterfacetable;
|
pinterfacetable = ^tinterfacetable;
|
||||||
tinterfacetable = packed record
|
tinterfacetable = record
|
||||||
EntryCount: Word;
|
EntryCount : PtrInt;
|
||||||
Entries: array[0..0] of tinterfaceentry;
|
Entries : array[0..0] of tinterfaceentry;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TMethod = record
|
TMethod = record
|
||||||
|
Loading…
Reference in New Issue
Block a user