Commit Graph

768 Commits

Author SHA1 Message Date
Nikolay Nikolov
3762a70423 + use optimize_op_const in thlcgwasm.a_op_const_stack as well 2025-10-11 23:30:35 +03:00
Nikolay Nikolov
12bfa69736 * optimization in thlcgwasm.resize_stack_int_val to avoid some redundant conversions 2025-10-11 23:00:33 +03:00
Nikolay Nikolov
4ad6636f05 + optimization in thlcgwasm.a_load_reg_reg: don't emit any instructions when moving the same size from a register to itself 2025-10-11 21:06:10 +03:00
Nikolay Nikolov
5d058a189a + use optimize_op_const in thlcgwasm.a_op_const_ref 2025-10-11 20:48:34 +03:00
Nikolay Nikolov
03e21a8ca4 + use optimize_op_const in thlcgwasm.a_op_const_reg_reg 2025-10-11 20:36:12 +03:00
Nikolay Nikolov
cbb3225e6a * fixed bug with LOC_SUBSETREG/LOC_CSUBSETREG/LOC_SUBSETREF/LOC_CSUBSETREF in thlcgwasm.a_cmp_ref_loc_stack 2025-10-11 19:31:39 +03:00
Nikolay Nikolov
8531a81aab * fix bug in thlcgwasm.a_load_reg_reg when fromsize is a 32-bit pointer and tosize is 64-bit 2025-10-11 19:31:39 +03:00
Nikolay Nikolov
cfcba50385 * WebAssembly: stop with internal error in case the code generator is requested to a binary operation with two different sized registers 2025-10-11 19:31:39 +03:00
Nikolay Nikolov
2e4e6f5b4e * bitpacked record/array fixes for platforms with 64-bit ALU and 32-bit address space (WebAssembly, JVM) 2025-10-11 19:31:39 +03:00
Nikolay Nikolov
b2509e2f44 * fixed try_table bug in resolve_labels_via_state_machine 2025-10-05 18:49:06 +03:00
Nikolay Nikolov
29bae9fb3c * fixed check in resolve_labels_via_state_machine 2025-10-05 18:40:23 +03:00
Nikolay Nikolov
66db4dfe94 * fixed tai_wasmstruc_try_table.create_from to stop on a_end_try_table, instead of a_end_block 2025-10-05 18:26:43 +03:00
Nikolay Nikolov
1ceaa02f41 + handle try_table in resolve_labels_via_state_machine 2025-10-05 18:16:51 +03:00
Nikolay Nikolov
c19dcab3f5 + support try_table blocks in resolve_labels_of_asmlist_with_try_blocks_recursive 2025-10-05 17:10:48 +03:00
Nikolay Nikolov
a9b5a7df2d + introduced taiwstype.aitws_try_table 2025-10-05 17:01:57 +03:00
Nikolay Nikolov
5be2acb757 + support a_catch,a_catch_ref,a_catch_all and a_catch_all_ref in tcpuprocinfo.ConvertBranchTargetNumbersToLabels 2025-10-05 16:55:49 +03:00
Nikolay Nikolov
f5bf774d35 + implemented tai_wasmstruc_try_table - structured version ot the try_table instruction, used in goto label resolution 2025-10-05 16:43:27 +03:00
Nikolay Nikolov
6a934513ea * tai_wasmstruc_try_catch renamed tai_wasmstruc_legacy_try_catch 2025-10-05 16:22:34 +03:00
Nikolay Nikolov
a067283bce * tai_wasmstruc_try_delegate renamed tai_wasmstruc_legacy_try_delegate 2025-10-05 16:21:56 +03:00
Nikolay Nikolov
fe1f3041ac * tai_wasmstruc_try renamed tai_wasmstruc_legacy_try 2025-10-05 16:20:37 +03:00
Nikolay Nikolov
a6ef71473a * aitws_try_catch renamed aitws_legacy_try_catch 2025-10-05 16:19:34 +03:00
Nikolay Nikolov
30adda9221 * aitws_try_delegate renamed aitws_legacy_try_delegate 2025-10-05 16:19:09 +03:00
Nikolay Nikolov
3818722b23 * fix in exnref exceptions generation code for 'on' nodes 2025-10-05 15:26:10 +03:00
Nikolay Nikolov
4d07da193f * bug fixes to the try..finally exnref exceptions code generation 2025-10-05 13:05:09 +03:00
Nikolay Nikolov
4801ddaf0a * use a_throw instead of a_legacy_throw in twasminlinenode.second_throw_fpcexception, unless legacy exceptions mode is selected 2025-10-05 12:55:27 +03:00
Nikolay Nikolov
8470ed075d + use the new try_table instruction in exnref exceptions mode for 'on' except nodes 2025-10-05 12:38:06 +03:00
Nikolay Nikolov
b1343eca01 * use a_throw instead of a_legacy_throw in exnref exceptions mode 2025-10-05 12:34:20 +03:00
Nikolay Nikolov
5ba5e4fb4e + use the new try_table instruction for try..except code generation in exnref exceptions mode 2025-10-05 12:33:05 +03:00
Nikolay Nikolov
e91acbc569 * use taicpu.op_catch to construct the try_table instruction more easily. No functional changes. 2025-10-05 12:04:25 +03:00
Nikolay Nikolov
621ca7d416 + introduced taicpu.op_catch 2025-10-05 12:02:23 +03:00
Nikolay Nikolov
30c1523d91 + support try_table in resolve_labels_pass2 2025-10-05 11:39:35 +03:00
Nikolay Nikolov
74367b930c * make the newly added internal error numbers unique 2025-10-05 11:39:35 +03:00
Nikolay Nikolov
79a7406408 + handle a_end_try_table in the labels resolution in resolve_labels_pass1 2025-10-05 11:39:35 +03:00
Nikolay Nikolov
263ea6f463 + support writing the try_table instruction in the internal assembler writer 2025-10-05 11:39:35 +03:00
Nikolay Nikolov
425b12b136 * use the new WebAssembly exception handling instruction try_table for try..finally blocks 2025-10-05 11:39:35 +03:00
Nikolay Nikolov
0c79db7ee6 + support writing the catch clauses in the LLVM-MC assembler output for the try_table instruction 2025-10-04 22:05:01 +03:00
Nikolay Nikolov
b0879f9abb * in taicpu.op_XXX call create(op) instead of inherited create(op), because we want to call our overriden constructor 2025-10-04 21:40:38 +03:00
Nikolay Nikolov
15d6f3808f + added a try_table_catch_clauses assembler list field to WebAssembly's taicpu, to hold the catch clause list parameter to the try_table instruction 2025-10-04 21:07:57 +03:00
Nikolay Nikolov
d7f38784b2 * proper llvm-mc name for the end_try_table instruction 2025-10-04 20:41:46 +03:00
Nikolay Nikolov
30c1d10a91 + support try_table/end_try_table in tcpuprocinfo.postprocess_code.resolve_labels_pass1 2025-10-04 20:32:20 +03:00
Nikolay Nikolov
54b4c114cb + added twasmexceptionstatehandler_nativeexnrefexceptions - currently a copy of twasmexceptionstatehandler_nativelegacyexceptions. Will be updated for exnref exceptions later. 2025-10-04 15:28:25 +03:00
Nikolay Nikolov
02d82debaf * twasmexceptionstatehandler_nativeexceptions renamed twasmexceptionstatehandler_nativelegacyexceptions. No functional changes. 2025-10-04 15:12:17 +03:00
Nikolay Nikolov
5414a589b8 + implemented code generation for WebAssembly exnref exceptions by copying the
code generation from the legacy exceptions. This is to make stuff compile in
  the exnref exceptions mode. After that, the code will be adapted to use the
  new try_table instruction.
2025-10-04 15:08:52 +03:00
Nikolay Nikolov
d29cc470f6 + support all subset locations in twasmaddnode.second_generic_compare. This improves support for bitpacked records and arrays in WebAssembly. 2025-09-25 02:15:53 +03:00
Nikolay Nikolov
0a3b8df711 * fixed WebAssembly signed overflow check for the subtraction operation 2025-09-24 22:24:24 +03:00
Nikolay Nikolov
07bcb62d5e + support the throw_ref instruction in the internal WebAssembly assembler writer 2025-09-23 05:15:46 +03:00
Nikolay Nikolov
6eb2be4bb7 + support the throw instruction in the internal WebAssembly assembler writer 2025-09-23 04:59:09 +03:00
Nikolay Nikolov
96e2242e28 + support the end_try_table instruction in the internal WebAssembly assembler writer 2025-09-23 04:39:55 +03:00
Nikolay Nikolov
956db59bc2 * twasmonnode.pass_generate_code_native_exceptions renamed .pass_generate_code_native_legacy_exceptions 2025-09-23 03:16:39 +03:00
Nikolay Nikolov
19acce7c8a * twasmtryfinallynode.pass_generate_code_native_exceptions renamed .pass_generate_code_native_legacy_exceptions 2025-09-23 03:16:02 +03:00