Commit Graph

602 Commits

Author SHA1 Message Date
Nikolay Nikolov
4cb97dcdb3 * fixed warning 2024-01-31 02:33:31 +02:00
Nikolay Nikolov
4cc5cf4d0e + introduced TWasmValidationStacks.PushCtrl 2024-01-31 02:25:44 +02:00
Nikolay Nikolov
18c6e13f45 * fixed warning 2024-01-31 02:19:03 +02:00
Nikolay Nikolov
064adbf3f8 + introduced TWasmValidationStacks.PopVals 2024-01-31 02:15:09 +02:00
Nikolay Nikolov
4d5479741d + introduced TWasmValidationStacks.PushVals 2024-01-31 02:11:59 +02:00
Nikolay Nikolov
2d5c1d43cf + introduced TWasmValidationStacks.PopVal(expect) 2024-01-31 02:10:05 +02:00
Nikolay Nikolov
d575aa5240 + introduced TWasmBasicTypeList 2024-01-31 01:55:38 +02:00
Nikolay Nikolov
1786875319 + implemented TWasmValueStack.GetCount
+ implemented TWasmControlStack.GetCount
+ implemented TWasmValidationStacks.PopVal
2024-01-31 01:52:05 +02:00
Nikolay Nikolov
3f0853692c + implemented methods in TWasmControlStack: Push, Pop, GetItems, SetItems 2024-01-31 01:20:24 +02:00
Nikolay Nikolov
506634f261 * TWasmControlFrame changed to a record 2024-01-31 01:05:02 +02:00
Nikolay Nikolov
6aa49038a5 * inverted the indices of TWasmValueStack, so that item 0 is top of stack 2024-01-22 11:02:32 +02:00
Nikolay Nikolov
fadf43a33b + added TWasmControlStack and frame. Not used, yet. Will be used in the future
for WebAssembly stack tracking and validation.
2024-01-22 10:15:43 +02:00
Nikolay Nikolov
42f447257d + introduced TWasmValueStack for tracking the state of the WebAssembly stack. Not used, yet, but will be in the future. 2024-01-17 11:21:48 +02:00
Nikolay Nikolov
04a077707c * fix warning 2024-01-17 09:43:51 +02:00
Nikolay Nikolov
03fc5d2323 + added a zero/unitialized/unknown value to TWasmBasicType: wbt_Unknown 2024-01-17 08:32:10 +02:00
Nikolay Nikolov
f65e4f2385 * fixed bug in the handling of WebAssembly goto 2024-01-16 08:44:06 +02:00
Nikolay Nikolov
52f0ec579e + added TWasmFuncType.ToString implementation 2023-12-31 21:49:35 +02:00
Nikolay Nikolov
0be3fe9ab4 - removed TWasmObjData.AddFuncType, instead call directly [F]FuncTypes.AddOrGetFuncType 2023-12-31 15:52:27 +02:00
Nikolay Nikolov
57aead9a14 + added const sets for the WebAssembly reference, numeric and vector types 2023-12-24 16:35:39 +02:00
Nikolay Nikolov
2626b85984 + introduced decode_wasm_basic_type function 2023-12-24 14:30:06 +02:00
Nikolay Nikolov
3defa34470 + check whether all br instructions, generated by goto point to a pascal goto label 2023-10-22 05:23:04 +03:00
Nikolay Nikolov
31dff18a61 * refactored the taicpu_wasm_structured_instruction descendants to use a wstyp enum variable, instead of using the 'is' operator to determine the class type 2023-10-22 04:33:29 +03:00
Nikolay Nikolov
5486182f56 + introduced thlcgobj.a_jmp_always_pascal_goto - same as .a_jmp_always, but generated by a pascal goto statement 2023-10-22 04:12:59 +03:00
Nikolay Nikolov
064172d65a * refactored thlcgwasm.a_jmp_always. No functional changes. 2023-10-22 04:03:04 +03:00
Nikolay Nikolov
cf21365a21 * fixed and enabled the is_pascal_goto_target check 2023-10-22 04:01:37 +03:00
Nikolay Nikolov
84e2613ca8 * refactor: wasm_convert_to_flat_asmlist and wasm_convert_to_structured_asmlist now accept a single var parameter 2023-10-22 03:11:28 +03:00
Nikolay Nikolov
545978b290 * fixed the label resolution for asmlists with WebAssembly native exceptions 2023-10-22 01:29:50 +03:00
Nikolay Nikolov
b3e64d70e7 * temporary workaround for the is_pascal_goto_target check not working properly in a_jmp_always 2023-10-22 01:09:26 +03:00
Nikolay Nikolov
84186db35f * support local.get/set/tee with a const parameter in the wasm internal assembler writer 2023-10-22 00:52:37 +03:00
Nikolay Nikolov
b1cec6de2a + allow jumps to goto targets 2023-10-22 00:35:05 +03:00
Nikolay Nikolov
5e9cf637d3 * fixed branch ordering in resolve_labels_via_state_machine 2023-10-21 23:54:40 +03:00
Nikolay Nikolov
6f942996a5 * fixes to the mangling of the entry and exit code during the state machine label resolution 2023-10-21 23:46:00 +03:00
Nikolay Nikolov
f9ecc12e5b + added label resolution via state machine 2023-10-21 23:33:09 +03:00
Nikolay Nikolov
fc9719f5f9 + add the extra allocated locals before inserting the locals list in wasm32 tcpuprocinfo.postprocess_code 2023-10-18 03:54:37 +03:00
Nikolay Nikolov
d50ef3381f * strip block instructions 2023-10-18 03:47:58 +03:00
Nikolay Nikolov
ce742b5b4d * convert loop..end_loop blocks to flat list + branch instruction 2023-10-18 03:45:02 +03:00
Nikolay Nikolov
9584348c40 + added amfrtDeleteAi, support deleting instructions in map_structured_asmlist_inner 2023-10-18 03:31:11 +03:00
Nikolay Nikolov
0f07c966b6 * convert if structured instructions to br_if + labels 2023-10-18 02:31:58 +03:00
Nikolay Nikolov
59128241ad + support mapping of structured instructions also in map_structured_asmlist_inner 2023-10-18 01:59:55 +03:00
Nikolay Nikolov
8b00598cab * set the last=true property of the last tai_local in the locals list in the
beginning of insert_localslist, instead of in the end of prepare_locals
2023-10-18 01:52:44 +03:00
Nikolay Nikolov
5b64e5b957 * insert the wasm locals asm list after resolve_labels_complex, since it will (in the future) be able to allocate more locals, in order to resolve the branches and goto 2023-10-18 01:51:11 +03:00
Nikolay Nikolov
e81cff0408 * moved the insertion of the wasm locals asmlist to a local subroutine 2023-10-18 01:50:31 +03:00
Nikolay Nikolov
0e39e7c12d * moved the preparation of the locals asm list in tcpuprocinfo.postprocess_code to a local subroutine 2023-10-18 01:47:42 +03:00
Nikolay Nikolov
db23f54f8c * Local var templist renamed localslist. No functional changes. 2023-10-18 01:41:25 +03:00
Nikolay Nikolov
edabca1447 + added and implemented tcpuprocinfo.AllocWasmLocal 2023-10-18 00:48:45 +03:00
Nikolay Nikolov
d911e462b2 + added support for params and results in tai_wasmstruc_if.ConvertToBrIf 2023-10-17 03:00:23 +03:00
Nikolay Nikolov
c2173185e7 + added method tai_wasmstruc_if.ConvertToBrIf 2023-10-17 02:11:46 +03:00
Nikolay Nikolov
bc7b113e09 + convert wasm structured list to flat list 2023-10-17 00:14:12 +03:00
Nikolay Nikolov
ea18d11d41 * fixed crash in map_structured_asmlist_inner, when the TAsmList parameter is nil 2023-10-16 23:22:10 +03:00
Nikolay Nikolov
e0c41ebc5a * fixed hang in map_structured_asmlist_inner 2023-10-16 23:21:28 +03:00