mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-13 10:49:17 +02:00
* MIPS: handle get_frame internally, so it sets pi_needs_stackframe flag on current procedure. This makes possible not to force pi_needs_stackframe on every procedure and thus omit saving/restoring $fp register when it is not necessary.
git-svn-id: trunk@25170 -
This commit is contained in:
parent
b33431775f
commit
404c3efa58
@ -217,6 +217,7 @@
|
||||
{ define cpumm}
|
||||
{$define cpurefshaveindexreg}
|
||||
{$define fpc_compiler_has_fixup_jmps}
|
||||
{$define SUPPORT_GET_FRAME}
|
||||
{$endif mips}
|
||||
|
||||
{$ifdef jvm}
|
||||
|
@ -65,8 +65,8 @@ implementation
|
||||
constructor TMIPSProcInfo.create(aparent: tprocinfo);
|
||||
begin
|
||||
inherited create(aparent);
|
||||
{ if (cs_generate_stackframes in current_settings.localswitches) or
|
||||
not (cs_opt_stackframe in current_settings.optimizerswitches) then }
|
||||
if (cs_generate_stackframes in current_settings.localswitches) or
|
||||
not (cs_opt_stackframe in current_settings.optimizerswitches) then
|
||||
include(flags,pi_needs_stackframe);
|
||||
|
||||
floatregssave:=12; { f20-f31 }
|
||||
|
@ -36,6 +36,7 @@ type
|
||||
procedure second_abs_real; override;
|
||||
procedure second_sqr_real; override;
|
||||
procedure second_sqrt_real; override;
|
||||
procedure second_get_frame; override;
|
||||
private
|
||||
procedure load_fpu_location;
|
||||
end;
|
||||
@ -133,6 +134,14 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
procedure tMIPSELinlinenode.second_get_frame;
|
||||
begin
|
||||
location_reset(location,LOC_CREGISTER,OS_ADDR);
|
||||
location.register:=NR_FRAME_POINTER_REG;
|
||||
end;
|
||||
|
||||
|
||||
begin
|
||||
cInlineNode := tMIPSELinlinenode;
|
||||
end.
|
||||
|
@ -76,6 +76,7 @@ var
|
||||
end;
|
||||
|
||||
|
||||
{$ifndef INTERNAL_BACKTRACE}
|
||||
{$define FPC_SYSTEM_HAS_GET_FRAME}
|
||||
function get_frame:pointer;assembler;nostackframe;
|
||||
asm
|
||||
@ -94,6 +95,7 @@ function get_frame:pointer;assembler;nostackframe;
|
||||
// lw $2,0($sp)
|
||||
move $2,$30
|
||||
end;
|
||||
{$endif INTERNAL_BACKTRACE}
|
||||
|
||||
|
||||
{ Try to find previous $fp,$ra register pair
|
||||
|
Loading…
Reference in New Issue
Block a user