* change the class references in a class' field table to indirect references

git-svn-id: trunk@37482 -
This commit is contained in:
svenbarth 2017-10-17 20:34:21 +00:00
parent 2af27756da
commit 530213711f
2 changed files with 11 additions and 4 deletions

View File

@ -632,7 +632,7 @@ implementation
datatcb.queue_init(voidpointertype);
{ reference to the vmt }
datatcb.queue_emit_asmsym(
current_asmdata.RefAsmSymbol(classdef.vmt_mangledname,AT_DATA),
current_asmdata.RefAsmSymbol(classdef.vmt_mangledname,AT_DATA,true),
tfieldvarsym(classdef.vmt_field).vardef);
end;
classtabledef:=datatcb.end_anonymous_record;

View File

@ -544,6 +544,13 @@ type
Name: ShortString;
end;
{$ifdef VER3_0}
PersistentClassRef = TPersistentClass;
{$else VER3_0}
PPersistentClass = ^TPersistentClass;
PersistentClassRef = PPersistentClass;
{$endif VER3_0}
PFieldClassTable = ^TFieldClassTable;
TFieldClassTable =
{$ifndef FPC_REQUIRES_PROPER_ALIGNMENT}
@ -551,7 +558,7 @@ type
{$endif FPC_REQUIRES_PROPER_ALIGNMENT}
record
Count: Word;
Entries: array[{$ifdef cpu16}0..16384 div sizeof(TPersistentClass){$else}Word{$endif}] of TPersistentClass;
Entries: array[{$ifdef cpu16}0..16384 div sizeof(PersistentClassRef){$else}Word{$endif}] of PersistentClassRef;
end;
PFieldTable = ^TFieldTable;
@ -584,7 +591,7 @@ begin
ClassTable := FieldTable^.ClassTable;
for i := 0 to ClassTable^.Count - 1 do
begin
Result := ClassTable^.Entries[i];
Result := ClassTable^.Entries[i]{$ifndef VER3_0}^{$endif};
if Result.ClassNameIs(ShortClassName) then
exit;
end;
@ -1701,7 +1708,7 @@ var
FieldClassTable := FieldTable^.ClassTable;
for i := 0 to FieldClassTable^.Count -1 do
begin
Entry := FieldClassTable^.Entries[i];
Entry := FieldClassTable^.Entries[i]{$ifndef VER3_0}^{$endif};
//writeln(format('Looking for %s in field table of class %s. Found %s',
//[AClassName, ComponentClassType.ClassName, Entry.ClassName]));
if Entry.ClassNameIs(ShortClassName) and