mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-03 02:50:42 +02:00
Merged revision(s) 32502 from branches/svenbarth/packages:
Use indirect reference for the RTL helpers that require RTTI symbols. hlcgobj.pas, thlcgobj: * g_incrrefcount, g_initialize, g_finalize & g_array_rtti_helper: use the indirect symbol of the RTTI if the target supports packages ........ git-svn-id: trunk@34222 -
This commit is contained in:
parent
50865158a4
commit
a2c0dae8a9
@ -469,6 +469,12 @@ unit hlcgobj;
|
|||||||
procedure g_finalize(list : TAsmList;t : tdef;const ref : treference);virtual;
|
procedure g_finalize(list : TAsmList;t : tdef;const ref : treference);virtual;
|
||||||
procedure g_array_rtti_helper(list: TAsmList; t: tdef; const ref: treference; const highloc: tlocation;
|
procedure g_array_rtti_helper(list: TAsmList; t: tdef; const ref: treference; const highloc: tlocation;
|
||||||
const name: string);virtual;
|
const name: string);virtual;
|
||||||
|
protected
|
||||||
|
{ helper called by g_incrrefcount, g_initialize, g_finalize and
|
||||||
|
g_array_rtti_helper to determine whether the RTTI symbol representing
|
||||||
|
t needs to be loaded using the indirect symbol }
|
||||||
|
function def_needs_indirect(t:tdef):boolean;
|
||||||
|
public
|
||||||
|
|
||||||
{# Generates range checking code. It is to note
|
{# Generates range checking code. It is to note
|
||||||
that this routine does not need to be overridden,
|
that this routine does not need to be overridden,
|
||||||
@ -3285,7 +3291,7 @@ implementation
|
|||||||
paramanager.getintparaloc(list,pd,2,cgpara2);
|
paramanager.getintparaloc(list,pd,2,cgpara2);
|
||||||
if is_open_array(t) then
|
if is_open_array(t) then
|
||||||
InternalError(201103054);
|
InternalError(201103054);
|
||||||
reference_reset_symbol(href,RTTIWriter.get_rtti_label(t,initrtti,false),0,sizeof(pint));
|
reference_reset_symbol(href,RTTIWriter.get_rtti_label(t,initrtti,def_needs_indirect(t)),0,sizeof(pint));
|
||||||
if pd.is_pushleftright then
|
if pd.is_pushleftright then
|
||||||
begin
|
begin
|
||||||
a_loadaddr_ref_cgpara(list,t,ref,cgpara1);
|
a_loadaddr_ref_cgpara(list,t,ref,cgpara1);
|
||||||
@ -3333,7 +3339,7 @@ implementation
|
|||||||
pd:=search_system_proc('fpc_initialize');
|
pd:=search_system_proc('fpc_initialize');
|
||||||
paramanager.getintparaloc(list,pd,1,cgpara1);
|
paramanager.getintparaloc(list,pd,1,cgpara1);
|
||||||
paramanager.getintparaloc(list,pd,2,cgpara2);
|
paramanager.getintparaloc(list,pd,2,cgpara2);
|
||||||
reference_reset_symbol(href,RTTIWriter.get_rtti_label(t,initrtti,false),0,sizeof(pint));
|
reference_reset_symbol(href,RTTIWriter.get_rtti_label(t,initrtti,def_needs_indirect(t)),0,sizeof(pint));
|
||||||
if pd.is_pushleftright then
|
if pd.is_pushleftright then
|
||||||
begin
|
begin
|
||||||
a_loadaddr_ref_cgpara(list,t,ref,cgpara1);
|
a_loadaddr_ref_cgpara(list,t,ref,cgpara1);
|
||||||
@ -3383,7 +3389,7 @@ implementation
|
|||||||
pd:=search_system_proc('fpc_finalize');
|
pd:=search_system_proc('fpc_finalize');
|
||||||
paramanager.getintparaloc(list,pd,1,cgpara1);
|
paramanager.getintparaloc(list,pd,1,cgpara1);
|
||||||
paramanager.getintparaloc(list,pd,2,cgpara2);
|
paramanager.getintparaloc(list,pd,2,cgpara2);
|
||||||
reference_reset_symbol(href,RTTIWriter.get_rtti_label(t,initrtti,false),0,sizeof(pint));
|
reference_reset_symbol(href,RTTIWriter.get_rtti_label(t,initrtti,def_needs_indirect(t)),0,sizeof(pint));
|
||||||
if pd.is_pushleftright then
|
if pd.is_pushleftright then
|
||||||
begin
|
begin
|
||||||
a_loadaddr_ref_cgpara(list,t,ref,cgpara1);
|
a_loadaddr_ref_cgpara(list,t,ref,cgpara1);
|
||||||
@ -3425,7 +3431,7 @@ implementation
|
|||||||
paramanager.getintparaloc(list,pd,2,cgpara2);
|
paramanager.getintparaloc(list,pd,2,cgpara2);
|
||||||
paramanager.getintparaloc(list,pd,3,cgpara3);
|
paramanager.getintparaloc(list,pd,3,cgpara3);
|
||||||
|
|
||||||
reference_reset_symbol(href,RTTIWriter.get_rtti_label(t,initrtti,false),0,sizeof(pint));
|
reference_reset_symbol(href,RTTIWriter.get_rtti_label(t,initrtti,def_needs_indirect(t)),0,sizeof(pint));
|
||||||
{ if calling convention is left to right, push parameters 1 and 2 }
|
{ if calling convention is left to right, push parameters 1 and 2 }
|
||||||
if pd.is_pushleftright then
|
if pd.is_pushleftright then
|
||||||
begin
|
begin
|
||||||
@ -3467,6 +3473,14 @@ implementation
|
|||||||
cgpara1.done;
|
cgpara1.done;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function thlcgobj.def_needs_indirect(t:tdef):boolean;
|
||||||
|
begin
|
||||||
|
result:=(tf_supports_packages in target_info.flags) and
|
||||||
|
(target_info.system in systems_indirect_var_imports) and
|
||||||
|
(cs_imported_data in current_settings.localswitches) and
|
||||||
|
(t.owner.moduleid<>current_module.moduleid);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure thlcgobj.g_rangecheck(list: TAsmList; const l: tlocation; fromdef, todef: tdef);
|
procedure thlcgobj.g_rangecheck(list: TAsmList; const l: tlocation; fromdef, todef: tdef);
|
||||||
var
|
var
|
||||||
{$if defined(cpu64bitalu) or defined(cpu32bitalu)}
|
{$if defined(cpu64bitalu) or defined(cpu32bitalu)}
|
||||||
|
Loading…
Reference in New Issue
Block a user