|
@@ -754,6 +754,8 @@ implementation
|
|
oldaktcallnode : tcallnode;
|
|
oldaktcallnode : tcallnode;
|
|
retlocitem: pcgparalocation;
|
|
retlocitem: pcgparalocation;
|
|
pd : tprocdef;
|
|
pd : tprocdef;
|
|
|
|
+ proc_addr_size: TCgSize;
|
|
|
|
+ proc_addr_voidptrdef: tdef;
|
|
{$ifdef vtentry}
|
|
{$ifdef vtentry}
|
|
sym : tasmsymbol;
|
|
sym : tasmsymbol;
|
|
{$endif vtentry}
|
|
{$endif vtentry}
|
|
@@ -774,6 +776,16 @@ implementation
|
|
regs_to_save_fpu:=paramanager.get_volatile_registers_fpu(procdefinition.proccalloption);
|
|
regs_to_save_fpu:=paramanager.get_volatile_registers_fpu(procdefinition.proccalloption);
|
|
regs_to_save_mm:=paramanager.get_volatile_registers_mm(procdefinition.proccalloption);
|
|
regs_to_save_mm:=paramanager.get_volatile_registers_mm(procdefinition.proccalloption);
|
|
|
|
|
|
|
|
+ proc_addr_size:=int_cgsize(procdefinition.address_size);
|
|
|
|
+{$ifdef i8086}
|
|
|
|
+ if po_far in procdefinition.procoptions then
|
|
|
|
+ proc_addr_voidptrdef:=voidfarpointertype
|
|
|
|
+ else
|
|
|
|
+ proc_addr_voidptrdef:=voidnearpointertype;
|
|
|
|
+{$else i8086}
|
|
|
|
+ proc_addr_voidptrdef:=voidpointertype;
|
|
|
|
+{$endif i8086}
|
|
|
|
+
|
|
{ Include Function result registers }
|
|
{ Include Function result registers }
|
|
if (not is_void(resultdef)) then
|
|
if (not is_void(resultdef)) then
|
|
begin
|
|
begin
|
|
@@ -860,7 +872,7 @@ implementation
|
|
begin
|
|
begin
|
|
{ Load VMT value in register }
|
|
{ Load VMT value in register }
|
|
{ todo: fix vmt type for high level cg }
|
|
{ todo: fix vmt type for high level cg }
|
|
- hlcg.location_force_reg(current_asmdata.CurrAsmList,methodpointer.location,voidpointertype,voidpointertype,false);
|
|
|
|
|
|
+ hlcg.location_force_reg(current_asmdata.CurrAsmList,methodpointer.location,proc_addr_voidptrdef,proc_addr_voidptrdef,false);
|
|
vmtreg:=methodpointer.location.register;
|
|
vmtreg:=methodpointer.location.register;
|
|
end;
|
|
end;
|
|
|
|
|
|
@@ -876,11 +888,11 @@ implementation
|
|
wpoinfomanager.symbol_live(current_procinfo.procdef.mangledname)) then
|
|
wpoinfomanager.symbol_live(current_procinfo.procdef.mangledname)) then
|
|
tobjectdef(tprocdef(procdefinition).struct).register_vmt_call(tprocdef(procdefinition).extnumber);
|
|
tobjectdef(tprocdef(procdefinition).struct).register_vmt_call(tprocdef(procdefinition).extnumber);
|
|
{$ifndef x86}
|
|
{$ifndef x86}
|
|
- pvreg:=cg.getintregister(current_asmdata.CurrAsmList,OS_ADDR);
|
|
|
|
|
|
+ pvreg:=cg.getintregister(current_asmdata.CurrAsmList,proc_addr_size);
|
|
{$endif not x86}
|
|
{$endif not x86}
|
|
- reference_reset_base(href,vmtreg,vmtoffset,sizeof(pint));
|
|
|
|
|
|
+ reference_reset_base(href,vmtreg,vmtoffset,procdefinition.address_size);
|
|
{$ifndef x86}
|
|
{$ifndef x86}
|
|
- cg.a_load_ref_reg(current_asmdata.CurrAsmList,OS_ADDR,OS_ADDR,href,pvreg);
|
|
|
|
|
|
+ cg.a_load_ref_reg(current_asmdata.CurrAsmList,proc_addr_size,proc_addr_size,href,pvreg);
|
|
{$endif not x86}
|
|
{$endif not x86}
|
|
|
|
|
|
{ Load parameters that are in temporary registers in the
|
|
{ Load parameters that are in temporary registers in the
|
|
@@ -968,22 +980,22 @@ implementation
|
|
begin
|
|
begin
|
|
secondpass(right);
|
|
secondpass(right);
|
|
|
|
|
|
- pvreg:=cg.getintregister(current_asmdata.CurrAsmList,OS_ADDR);
|
|
|
|
|
|
+ pvreg:=cg.getintregister(current_asmdata.CurrAsmList,proc_addr_size);
|
|
{ Only load OS_ADDR from the reference (when converting to hlcg:
|
|
{ Only load OS_ADDR from the reference (when converting to hlcg:
|
|
watch out with procedure of object) }
|
|
watch out with procedure of object) }
|
|
if right.location.loc in [LOC_REFERENCE,LOC_CREFERENCE] then
|
|
if right.location.loc in [LOC_REFERENCE,LOC_CREFERENCE] then
|
|
- cg.a_load_ref_reg(current_asmdata.CurrAsmList,OS_ADDR,OS_ADDR,right.location.reference,pvreg)
|
|
|
|
|
|
+ cg.a_load_ref_reg(current_asmdata.CurrAsmList,proc_addr_size,proc_addr_size,right.location.reference,pvreg)
|
|
else if right.location.loc in [LOC_REGISTER,LOC_CREGISTER] then
|
|
else if right.location.loc in [LOC_REGISTER,LOC_CREGISTER] then
|
|
begin
|
|
begin
|
|
{ in case left is a method pointer and we are on a big endian target, then
|
|
{ in case left is a method pointer and we are on a big endian target, then
|
|
the method address is stored in registerhi }
|
|
the method address is stored in registerhi }
|
|
if (target_info.endian=endian_big) and (right.location.size in [OS_PAIR,OS_SPAIR]) then
|
|
if (target_info.endian=endian_big) and (right.location.size in [OS_PAIR,OS_SPAIR]) then
|
|
- hlcg.a_load_reg_reg(current_asmdata.CurrAsmList,voidpointertype,voidpointertype,right.location.registerhi,pvreg)
|
|
|
|
|
|
+ hlcg.a_load_reg_reg(current_asmdata.CurrAsmList,proc_addr_voidptrdef,proc_addr_voidptrdef,right.location.registerhi,pvreg)
|
|
else
|
|
else
|
|
- hlcg.a_load_reg_reg(current_asmdata.CurrAsmList,voidpointertype,voidpointertype,right.location.register,pvreg);
|
|
|
|
|
|
+ hlcg.a_load_reg_reg(current_asmdata.CurrAsmList,proc_addr_voidptrdef,proc_addr_voidptrdef,right.location.register,pvreg);
|
|
end
|
|
end
|
|
else
|
|
else
|
|
- hlcg.a_load_loc_reg(current_asmdata.CurrAsmList,voidpointertype,voidpointertype,right.location,pvreg);
|
|
|
|
|
|
+ hlcg.a_load_loc_reg(current_asmdata.CurrAsmList,proc_addr_voidptrdef,proc_addr_voidptrdef,right.location,pvreg);
|
|
location_freetemp(current_asmdata.CurrAsmList,right.location);
|
|
location_freetemp(current_asmdata.CurrAsmList,right.location);
|
|
|
|
|
|
{ Load parameters that are in temporary registers in the
|
|
{ Load parameters that are in temporary registers in the
|