mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 04:49:19 +02:00
+ respect the nostackframe directive in WebAssembly inline asm routines
This commit is contained in:
parent
83a8d584e0
commit
4adac78f85
@ -2051,6 +2051,9 @@ implementation
|
|||||||
pd:=tcpuprocdef(current_procinfo.procdef);
|
pd:=tcpuprocdef(current_procinfo.procdef);
|
||||||
g_procdef(list,pd);
|
g_procdef(list,pd);
|
||||||
|
|
||||||
|
if not nostackframe then
|
||||||
|
begin
|
||||||
|
|
||||||
ttgwasm(tg).allocframepointer(list,pd.frame_pointer_ref);
|
ttgwasm(tg).allocframepointer(list,pd.frame_pointer_ref);
|
||||||
if pd.base_pointer_ref.base<>NR_LOCAL_STACK_POINTER_REG then
|
if pd.base_pointer_ref.base<>NR_LOCAL_STACK_POINTER_REG then
|
||||||
ttgwasm(tg).allocbasepointer(list,pd.base_pointer_ref);
|
ttgwasm(tg).allocbasepointer(list,pd.base_pointer_ref);
|
||||||
@ -2077,18 +2080,22 @@ implementation
|
|||||||
decstack(list,1);
|
decstack(list,1);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure thlcgwasm.g_proc_exit(list: TAsmList; parasize: longint; nostackframe: boolean);
|
procedure thlcgwasm.g_proc_exit(list: TAsmList; parasize: longint; nostackframe: boolean);
|
||||||
var
|
var
|
||||||
pd: tcpuprocdef;
|
pd: tcpuprocdef;
|
||||||
begin
|
begin
|
||||||
pd:=tcpuprocdef(current_procinfo.procdef);
|
pd:=tcpuprocdef(current_procinfo.procdef);
|
||||||
|
if not nostackframe then
|
||||||
|
begin
|
||||||
list.Concat(taicpu.op_ref(a_local_get,pd.base_pointer_ref));
|
list.Concat(taicpu.op_ref(a_local_get,pd.base_pointer_ref));
|
||||||
incstack(list,1);
|
incstack(list,1);
|
||||||
list.Concat(taicpu.op_sym(a_global_set,RefStackPointerSym));
|
list.Concat(taicpu.op_sym(a_global_set,RefStackPointerSym));
|
||||||
decstack(list,1);
|
decstack(list,1);
|
||||||
|
|
||||||
list.concat(taicpu.op_none(a_return));
|
list.concat(taicpu.op_none(a_return));
|
||||||
|
end;
|
||||||
list.concat(taicpu.op_none(a_end_function));
|
list.concat(taicpu.op_none(a_end_function));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user