mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 04:09:11 +02:00
* replaced the 'if br end_if' sequence with the 'br_if' instruction, when
generating WebAssembly code for try..finally blocks (in all exception modes)
This commit is contained in:
parent
dcae87bd52
commit
0da5d57c1e
@ -893,12 +893,8 @@ implementation
|
|||||||
reasonreg:=hlcg.getintregister(current_asmdata.CurrAsmList,exceptionreasontype);
|
reasonreg:=hlcg.getintregister(current_asmdata.CurrAsmList,exceptionreasontype);
|
||||||
hlcg.g_exception_reason_load(current_asmdata.CurrAsmList,exceptionreasontype,exceptionreasontype,excepttemps.reasonbuf,reasonreg);
|
hlcg.g_exception_reason_load(current_asmdata.CurrAsmList,exceptionreasontype,exceptionreasontype,excepttemps.reasonbuf,reasonreg);
|
||||||
thlcgwasm(hlcg).a_cmp_const_reg_stack(current_asmdata.CurrAsmList,exceptionreasontype,OC_EQ,reason,reasonreg);
|
thlcgwasm(hlcg).a_cmp_const_reg_stack(current_asmdata.CurrAsmList,exceptionreasontype,OC_EQ,reason,reasonreg);
|
||||||
current_asmdata.CurrAsmList.concat(taicpu.op_none(a_if));
|
current_asmdata.CurrAsmList.concat(taicpu.op_const(a_br_if,br));
|
||||||
thlcgwasm(hlcg).incblock;
|
|
||||||
thlcgwasm(hlcg).decstack(current_asmdata.CurrAsmList,1);
|
thlcgwasm(hlcg).decstack(current_asmdata.CurrAsmList,1);
|
||||||
current_asmdata.CurrAsmList.concat(taicpu.op_const(a_br,br+1));
|
|
||||||
current_asmdata.CurrAsmList.concat(taicpu.op_none(a_end_if));
|
|
||||||
thlcgwasm(hlcg).decblock;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
@ -1080,12 +1076,8 @@ implementation
|
|||||||
reasonreg:=hlcg.getintregister(current_asmdata.CurrAsmList,exceptionreasontype);
|
reasonreg:=hlcg.getintregister(current_asmdata.CurrAsmList,exceptionreasontype);
|
||||||
hlcg.g_exception_reason_load(current_asmdata.CurrAsmList,exceptionreasontype,exceptionreasontype,excepttemps.reasonbuf,reasonreg);
|
hlcg.g_exception_reason_load(current_asmdata.CurrAsmList,exceptionreasontype,exceptionreasontype,excepttemps.reasonbuf,reasonreg);
|
||||||
thlcgwasm(hlcg).a_cmp_const_reg_stack(current_asmdata.CurrAsmList,exceptionreasontype,OC_EQ,reason,reasonreg);
|
thlcgwasm(hlcg).a_cmp_const_reg_stack(current_asmdata.CurrAsmList,exceptionreasontype,OC_EQ,reason,reasonreg);
|
||||||
current_asmdata.CurrAsmList.concat(taicpu.op_none(a_if));
|
current_asmdata.CurrAsmList.concat(taicpu.op_const(a_br_if,br));
|
||||||
thlcgwasm(hlcg).incblock;
|
|
||||||
thlcgwasm(hlcg).decstack(current_asmdata.CurrAsmList,1);
|
thlcgwasm(hlcg).decstack(current_asmdata.CurrAsmList,1);
|
||||||
current_asmdata.CurrAsmList.concat(taicpu.op_const(a_br,br+1));
|
|
||||||
current_asmdata.CurrAsmList.concat(taicpu.op_none(a_end_if));
|
|
||||||
thlcgwasm(hlcg).decblock;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure generate_exceptreason_throw(reason: tcgint);
|
procedure generate_exceptreason_throw(reason: tcgint);
|
||||||
@ -1292,12 +1284,8 @@ implementation
|
|||||||
reasonreg:=hlcg.getintregister(current_asmdata.CurrAsmList,exceptionreasontype);
|
reasonreg:=hlcg.getintregister(current_asmdata.CurrAsmList,exceptionreasontype);
|
||||||
hlcg.g_exception_reason_load(current_asmdata.CurrAsmList,exceptionreasontype,exceptionreasontype,excepttemps.reasonbuf,reasonreg);
|
hlcg.g_exception_reason_load(current_asmdata.CurrAsmList,exceptionreasontype,exceptionreasontype,excepttemps.reasonbuf,reasonreg);
|
||||||
thlcgwasm(hlcg).a_cmp_const_reg_stack(current_asmdata.CurrAsmList,exceptionreasontype,OC_EQ,reason,reasonreg);
|
thlcgwasm(hlcg).a_cmp_const_reg_stack(current_asmdata.CurrAsmList,exceptionreasontype,OC_EQ,reason,reasonreg);
|
||||||
current_asmdata.CurrAsmList.concat(taicpu.op_none(a_if));
|
current_asmdata.CurrAsmList.concat(taicpu.op_const(a_br_if,br));
|
||||||
thlcgwasm(hlcg).incblock;
|
|
||||||
thlcgwasm(hlcg).decstack(current_asmdata.CurrAsmList,1);
|
thlcgwasm(hlcg).decstack(current_asmdata.CurrAsmList,1);
|
||||||
current_asmdata.CurrAsmList.concat(taicpu.op_const(a_br,br+1));
|
|
||||||
current_asmdata.CurrAsmList.concat(taicpu.op_none(a_end_if));
|
|
||||||
thlcgwasm(hlcg).decblock;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure generate_exceptreason_reraise(reason: tcgint);
|
procedure generate_exceptreason_reraise(reason: tcgint);
|
||||||
|
Loading…
Reference in New Issue
Block a user