From 7089677a22f5cee3cbf35f4e384768ab00d2a40b Mon Sep 17 00:00:00 2001 From: svenbarth Date: Wed, 14 Dec 2016 18:40:16 +0000 Subject: [PATCH] * change RecInitTable into a direct reference to avoid an unnecessary indirection as both the full and init RTTI of a record always reside inside the same unit git-svn-id: trunk@35128 - --- compiler/ncgrtti.pas | 4 +++- rtl/inc/rtti.inc | 4 ++-- rtl/objpas/typinfo.pp | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/compiler/ncgrtti.pas b/compiler/ncgrtti.pas index a466af9e7f..221f3735a3 100644 --- a/compiler/ncgrtti.pas +++ b/compiler/ncgrtti.pas @@ -863,7 +863,9 @@ implementation begin { point to more optimal init table } include(def.defstates,ds_init_table_used); - write_rtti_reference(tcb,def,initrtti); + { we use a direct reference as the init RTTI is always in the same + unit as the full RTTI } + tcb.emit_tai(Tai_const.Create_sym(ref_rtti(def,initrtti,false)),voidpointertype); end; tcb.emit_ord_const(def.size,u32inttype); diff --git a/rtl/inc/rtti.inc b/rtl/inc/rtti.inc index 8764daabf1..7d2c4ef161 100644 --- a/rtl/inc/rtti.inc +++ b/rtl/inc/rtti.inc @@ -49,7 +49,7 @@ type {$endif USE_PACKED} record {$ifndef VER3_0} - InitTable: PPointer; + InitTable: Pointer; {$endif VER3_0} Size: Longint; Count: Longint; @@ -116,7 +116,7 @@ begin { check terminator, maybe we are already in init table } if Assigned(PRecordInfoInit(typeInfo)^.Terminator) then { point to more optimal initrtti } - result:=PRecordInfoFull(result)^.InitTable^; + result:=PRecordInfoFull(result)^.InitTable; {$endif VER3_0} end; diff --git a/rtl/objpas/typinfo.pp b/rtl/objpas/typinfo.pp index 925094db8e..a1f5c3d435 100644 --- a/rtl/objpas/typinfo.pp +++ b/rtl/objpas/typinfo.pp @@ -270,7 +270,7 @@ unit typinfo; tkRecord: ( {$ifndef VER3_0} - RecInitTable: PPointer; + RecInitTable: Pointer; { points to TTypeInfo followed by init table } {$endif VER3_0} RecSize: Integer; ManagedFldCount: Integer;