mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-02 00:19:43 +02:00
* deallocate parameter registers in time for newra
* for non-i386, procvars and methodpointers always have to be processed in advance, whether or not newra is defined
This commit is contained in:
parent
a71427cf2c
commit
5a5b7e0192
@ -737,7 +737,7 @@ implementation
|
|||||||
oldaktcallnode:=aktcallnode;
|
oldaktcallnode:=aktcallnode;
|
||||||
aktcallnode:=self;
|
aktcallnode:=self;
|
||||||
|
|
||||||
{$ifndef newra}
|
{$ifndef i386}
|
||||||
{ process procvar. Done here already, because otherwise it may }
|
{ process procvar. Done here already, because otherwise it may }
|
||||||
{ destroy registers containing a parameter for the actual }
|
{ destroy registers containing a parameter for the actual }
|
||||||
{ function call (e.g. if it's a function, its result will }
|
{ function call (e.g. if it's a function, its result will }
|
||||||
@ -763,7 +763,7 @@ implementation
|
|||||||
not(is_cppclass(tprocdef(procdefinition)._class)) then
|
not(is_cppclass(tprocdef(procdefinition)._class)) then
|
||||||
cg.g_maybe_testvmt(exprasmlist,methodpointer.location.register,tprocdef(procdefinition)._class);
|
cg.g_maybe_testvmt(exprasmlist,methodpointer.location.register,tprocdef(procdefinition)._class);
|
||||||
end;
|
end;
|
||||||
{$endif newra}
|
{$endif not i386}
|
||||||
|
|
||||||
if assigned(left) then
|
if assigned(left) then
|
||||||
begin
|
begin
|
||||||
@ -805,7 +805,7 @@ implementation
|
|||||||
if (po_virtualmethod in procdefinition.procoptions) and
|
if (po_virtualmethod in procdefinition.procoptions) and
|
||||||
assigned(methodpointer) then
|
assigned(methodpointer) then
|
||||||
begin
|
begin
|
||||||
{$ifdef newra}
|
{$ifdef i386}
|
||||||
secondpass(methodpointer);
|
secondpass(methodpointer);
|
||||||
location_force_reg(exprasmlist,methodpointer.location,OS_ADDR,false);
|
location_force_reg(exprasmlist,methodpointer.location,OS_ADDR,false);
|
||||||
vmtreg:=methodpointer.location.register;
|
vmtreg:=methodpointer.location.register;
|
||||||
@ -830,6 +830,11 @@ implementation
|
|||||||
vmtreg2:=rg.getabtregisterint(exprasmlist,OS_ADDR);
|
vmtreg2:=rg.getabtregisterint(exprasmlist,OS_ADDR);
|
||||||
rg.ungetregisterint(exprasmlist,vmtreg2);
|
rg.ungetregisterint(exprasmlist,vmtreg2);
|
||||||
cg.a_load_reg_reg(exprasmlist,OS_ADDR,OS_ADDR,vmtreg,vmtreg2);
|
cg.a_load_reg_reg(exprasmlist,OS_ADDR,OS_ADDR,vmtreg,vmtreg2);
|
||||||
|
{$endif newra}
|
||||||
|
{ free the resources allocated for the parameters }
|
||||||
|
paramanager.freeparalocs(exprasmlist,tparaitem(procdefinition.para.first));
|
||||||
|
|
||||||
|
{$ifdef newra}
|
||||||
for i:=first_supreg to last_supreg do
|
for i:=first_supreg to last_supreg do
|
||||||
if i in regs_to_alloc then
|
if i in regs_to_alloc then
|
||||||
begin
|
begin
|
||||||
@ -848,6 +853,9 @@ implementation
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
|
{ free the resources allocated for the parameters }
|
||||||
|
paramanager.freeparalocs(exprasmlist,tparaitem(procdefinition.para.first));
|
||||||
|
|
||||||
{$ifdef newra}
|
{$ifdef newra}
|
||||||
for i:=first_supreg to last_supreg do
|
for i:=first_supreg to last_supreg do
|
||||||
if i in regs_to_alloc then
|
if i in regs_to_alloc then
|
||||||
@ -866,9 +874,10 @@ implementation
|
|||||||
else
|
else
|
||||||
{ now procedure variable case }
|
{ now procedure variable case }
|
||||||
begin
|
begin
|
||||||
{$ifdef newra}
|
{$ifdef i386}
|
||||||
secondpass(right);
|
secondpass(right);
|
||||||
|
{$endif i386}
|
||||||
|
{$ifdef newra}
|
||||||
if right.location.loc in [LOC_REFERENCE,LOC_CREFERENCE] then
|
if right.location.loc in [LOC_REFERENCE,LOC_CREFERENCE] then
|
||||||
begin
|
begin
|
||||||
helpref:=right.location.reference;
|
helpref:=right.location.reference;
|
||||||
@ -892,6 +901,12 @@ implementation
|
|||||||
|
|
||||||
reference_release(exprasmlist,helpref);
|
reference_release(exprasmlist,helpref);
|
||||||
location_freetemp(exprasmlist,right.location);
|
location_freetemp(exprasmlist,right.location);
|
||||||
|
{$endif newra}
|
||||||
|
|
||||||
|
{ free the resources allocated for the parameters }
|
||||||
|
paramanager.freeparalocs(exprasmlist,tparaitem(procdefinition.para.first));
|
||||||
|
|
||||||
|
{$ifdef newra}
|
||||||
for i:=first_supreg to last_supreg do
|
for i:=first_supreg to last_supreg do
|
||||||
if i in regs_to_alloc then
|
if i in regs_to_alloc then
|
||||||
begin
|
begin
|
||||||
@ -920,9 +935,6 @@ implementation
|
|||||||
{$endif newra}
|
{$endif newra}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ free the resources allocated for the parameters }
|
|
||||||
paramanager.freeparalocs(exprasmlist,tparaitem(procdefinition.para.first));
|
|
||||||
|
|
||||||
{ Need to remove the parameters from the stack? }
|
{ Need to remove the parameters from the stack? }
|
||||||
if (po_clearstack in procdefinition.procoptions) then
|
if (po_clearstack in procdefinition.procoptions) then
|
||||||
begin
|
begin
|
||||||
@ -1412,7 +1424,12 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.90 2003-06-09 14:54:26 jonas
|
Revision 1.91 2003-06-12 18:38:45 jonas
|
||||||
|
* deallocate parameter registers in time for newra
|
||||||
|
* for non-i386, procvars and methodpointers always have to be processed
|
||||||
|
in advance, whether or not newra is defined
|
||||||
|
|
||||||
|
Revision 1.90 2003/06/09 14:54:26 jonas
|
||||||
* (de)allocation of registers for parameters is now performed properly
|
* (de)allocation of registers for parameters is now performed properly
|
||||||
(and checked on the ppc)
|
(and checked on the ppc)
|
||||||
- removed obsolete allocation of all parameter registers at the start
|
- removed obsolete allocation of all parameter registers at the start
|
||||||
|
Loading…
Reference in New Issue
Block a user