mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-13 18:49:11 +02:00
+ introduced the AT_WASM_EXCEPTION_TAG asm symbol type, use that for specifying
the parameter to the 'throw' and 'catch' instructions
This commit is contained in:
parent
e0ad427b6c
commit
82b6450f19
@ -72,7 +72,10 @@ interface
|
|||||||
{ GNU indirect function (ELF targets) }
|
{ GNU indirect function (ELF targets) }
|
||||||
AT_GNU_IFUNC,
|
AT_GNU_IFUNC,
|
||||||
{ WebAssembly global variable }
|
{ WebAssembly global variable }
|
||||||
AT_WASM_GLOBAL
|
AT_WASM_GLOBAL,
|
||||||
|
{ WebAssembly exception tag (used as a parameter for the 'throw' and
|
||||||
|
'catch' instructions) }
|
||||||
|
AT_WASM_EXCEPTION_TAG
|
||||||
);
|
);
|
||||||
|
|
||||||
{ is the label only there for getting an DataOffset (e.g. for i/o
|
{ is the label only there for getting an DataOffset (e.g. for i/o
|
||||||
|
@ -84,7 +84,7 @@ interface
|
|||||||
// additional memory
|
// additional memory
|
||||||
'memory.grow 0', 'memory.size 0',
|
'memory.grow 0', 'memory.size 0',
|
||||||
// exceptions
|
// exceptions
|
||||||
'try','catch __FPC_exception','catch_all','delegate','throw __FPC_exception','rethrow','end_try'
|
'try','catch','catch_all','delegate','throw','rethrow','end_try'
|
||||||
);
|
);
|
||||||
|
|
||||||
gas_wasm_basic_type_str : array [TWasmBasicType] of string = ('i32','i64','f32','f64');
|
gas_wasm_basic_type_str : array [TWasmBasicType] of string = ('i32','i64','f32','f64');
|
||||||
|
@ -691,7 +691,7 @@ implementation
|
|||||||
hlcg.g_exception_reason_save_const(current_asmdata.CurrAsmList,exceptionreasontype,0,excepttemps.reasonbuf);
|
hlcg.g_exception_reason_save_const(current_asmdata.CurrAsmList,exceptionreasontype,0,excepttemps.reasonbuf);
|
||||||
current_asmdata.CurrAsmList.concat(taicpu.op_const(a_br,4)); // jump to the 'finally' section
|
current_asmdata.CurrAsmList.concat(taicpu.op_const(a_br,4)); // jump to the 'finally' section
|
||||||
|
|
||||||
current_asmdata.CurrAsmList.concat(taicpu.op_none(a_catch));
|
current_asmdata.CurrAsmList.concat(taicpu.op_sym(a_catch,current_asmdata.RefAsmSymbol(FPC_EXCEPTION_TAG_SYM,AT_WASM_EXCEPTION_TAG)));
|
||||||
thlcgwasm(hlcg).decblock;
|
thlcgwasm(hlcg).decblock;
|
||||||
{ exceptionreason:=1 (exception) }
|
{ exceptionreason:=1 (exception) }
|
||||||
hlcg.g_exception_reason_save_const(current_asmdata.CurrAsmList,exceptionreasontype,1,excepttemps.reasonbuf);
|
hlcg.g_exception_reason_save_const(current_asmdata.CurrAsmList,exceptionreasontype,1,excepttemps.reasonbuf);
|
||||||
|
@ -159,7 +159,7 @@ implementation
|
|||||||
procedure twasminlinenode.second_throw_fpcexception;
|
procedure twasminlinenode.second_throw_fpcexception;
|
||||||
begin
|
begin
|
||||||
location_reset(location,LOC_VOID,OS_NO);
|
location_reset(location,LOC_VOID,OS_NO);
|
||||||
current_asmdata.CurrAsmList.Concat(taicpu.op_none(a_throw));
|
current_asmdata.CurrAsmList.Concat(taicpu.op_sym(a_throw,current_asmdata.RefAsmSymbol(FPC_EXCEPTION_TAG_SYM,AT_WASM_EXCEPTION_TAG)));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user