Commit Graph

530 Commits

Author SHA1 Message Date
Nikolay Nikolov
8bd18fc6d3 Merge remote-tracking branch 'origin/main' into wasm_js_promise_integration 2023-06-17 17:11:23 +03:00
Nikolay Nikolov
2f1ccd6f2a + support 'promising last' exports 2023-06-16 11:00:19 +03:00
Nikolay Nikolov
9d893b5d0d * tcpuprocdef.promising_export_name renamed promising_first_export_name 2023-06-16 10:50:35 +03:00
Nikolay Nikolov
9ea1f6de19 + added 'last' or 'first' to the internal promising wrapper name 2023-06-13 12:15:46 +03:00
Nikolay Nikolov
c67bcf0032 + introduced tcpuprocdef.add_promising_export 2023-06-13 11:57:23 +03:00
Pierre Muller
ad1812f90a Handle the specific NaN pattern of mips floating-point unit 2023-06-11 15:56:54 +01:00
Nikolay Nikolov
15c95e0ac7 + initial implementation of WebAssembly promising exports 2023-06-11 16:43:45 +03:00
Nikolay Nikolov
b247302871 + initial attempt (not fully working, yet) at implementing WebAssembly suspending externals 2023-06-11 14:07:35 +03:00
Nikolay Nikolov
8eea58f649 + support WebAssembly reference types as WebAssembly globals 2023-06-11 10:31:12 +03:00
Nikolay Nikolov
d38dbcac8f * use tcallparanode.parasym to find the tparavarsym in twasmcallnode.pass_typecheck 2023-06-11 09:29:07 +03:00
Nikolay Nikolov
e6cbdba0bd * fixed crash in twasmcallnode.pass_typecheck when there is no procdefinition (for generic methods) 2023-06-11 09:23:56 +03:00
Nikolay Nikolov
c117c0abf5 * fixed another crash, introduced in 6ff566350c 2023-06-11 09:06:59 +03:00
Nikolay Nikolov
3d55ac9d09 * fixed bug, introduced in 6ff566350c, due to
missing parenthesis
2023-06-11 09:01:07 +03:00
Nikolay Nikolov
6ff566350c * disallow passing WebAssembly reference types as untyped var/constref/const parameters 2023-06-11 08:56:27 +03:00
Nikolay Nikolov
8cd6606970 + support nil comparison of WebAssembly reference types (externref and funcref) 2023-06-11 07:17:04 +03:00
Nikolay Nikolov
9daabb2123 + support using nil constants for setting values of WebAssembly reference types (funcref and externref) 2023-06-11 06:23:02 +03:00
Nikolay Nikolov
ca03841724 - removed redundant semicolon 2023-06-11 06:07:13 +03:00
Nikolay Nikolov
a47a1c093a * disallow conversion between regular pointers and WasmExternRef 2023-06-11 05:28:39 +03:00
Nikolay Nikolov
8b138aa059 + also check for assigned(left) after calling inherited in twasmaddrnode.pass_typecheck, to avoid another crash 2023-06-11 04:11:02 +03:00
Nikolay Nikolov
84b60d3f00 * check for codegenerror in twasmaddrnode.pass_typecheck and exit early, to avoid crashes 2023-06-11 04:05:17 +03:00
Nikolay Nikolov
8743f72f11 + disallow taking the address of WebAssembly externref type 2023-06-11 04:01:58 +03:00
Nikolay Nikolov
a0b78ad1f7 + WebAssembly internal assembler support for the ref.is_null instruction 2023-06-07 06:38:25 +03:00
Nikolay Nikolov
2039509cfb + WebAssembly internal asm support for the ref.null instruction 2023-06-07 06:13:17 +03:00
Nikolay Nikolov
11712658b0 + implemented WebAssembly code generator support for funcref and externref data
types, using new register types R_FUNCREFREGISTER and R_EXTERNREFREGISTER
2023-06-07 05:25:57 +03:00
Nikolay Nikolov
e555eddeda * fixed the textual representation of the ref.null instruction for llvm-mc 2023-06-07 03:36:28 +03:00
Nikolay Nikolov
48556ab039 + enable the reference types extension in llvm-mc via a command line option 2023-06-07 03:30:40 +03:00
Nikolay Nikolov
3b3a0a660c * the a_ref_null instruction split into two subinstructions - a_ref_null_externref and a_ref_null_funcref 2023-06-07 01:42:46 +03:00
Nikolay Nikolov
1f76366125 + introduced the is_wasm_reference_type(tdef) helper 2023-06-05 05:00:31 +03:00
Nikolay Nikolov
5cc4096f41 * formatting 2023-06-05 04:56:03 +03:00
Nikolay Nikolov
c33f47a707 + introduced is_wasm_externref(tdef) helper 2023-06-05 04:55:33 +03:00
Nikolay Nikolov
022d2804a9 + introduced is_wasm_funcref(tdef) helper 2023-06-05 04:51:03 +03:00
Nikolay Nikolov
dd09bf64b3 + handle externref parameters in create_functype_common 2023-06-05 04:37:54 +03:00
Nikolay Nikolov
a778fb2eaa + support externref in defToWasmBasic 2023-06-05 04:31:53 +03:00
Nikolay Nikolov
3e21d24098 + magically insert a void externref type in the System unit, called WasmExternRef 2023-06-05 04:26:57 +03:00
Nikolay Nikolov
c925c1aaa6 + introduced flag is_wasm_externref to tcpupointerdef for wasm32. This is to be
used for declaring WebAssembly externref reference types.
2023-06-05 04:09:56 +03:00
Nikolay Nikolov
ad69c6e1b5 + also support funcref parameters in create_functype_common 2023-06-05 02:53:44 +03:00
Nikolay Nikolov
bebe53ef9f * added support and simplified the handling of results in create_functype_common for reference types 2023-06-05 02:46:34 +03:00
Nikolay Nikolov
60cde554fd + handle wasm funcrefs in tgcpu.defToWasmBasic 2023-06-05 02:44:34 +03:00
Nikolay Nikolov
4143912b72 * use a TFPList, instead of a dynamic array in twasmnodeutils.InsertObjectInfo.
No functional changes.
2023-04-01 17:17:42 +03:00
Nikolay Nikolov
e82c98bfce * wasm32: generate module info by traversing through current_module and its
used_units list recursively. This should fix #40229
2023-04-01 04:25:15 +03:00
Nikolay Nikolov
f32ef29253 * WebAssembly high level code generator: use the global.get and global.set
instructions to access references to symbols of type AT_WASM_GLOBAL
2022-07-26 02:13:09 +03:00
Nikolay Nikolov
c6af4df9b9 + declare user-defined wasm globals in the llvm-mc assembly output 2022-07-25 05:35:00 +03:00
Nikolay Nikolov
6e1d7b4e57 + introduced methods for converting WebAssembly global var types from a Pascal type to TWasmBasicType 2022-07-25 02:44:51 +03:00
Nikolay Nikolov
7bd1ac4507 * fixed comment 2022-07-25 01:57:13 +03:00
Nikolay Nikolov
90b8b9d121 * don't reserve bss data for wasm global vars 2022-07-25 01:17:28 +03:00
Nikolay Nikolov
8d441929a8 + introduced tcpustaticvarsym.is_wasm_global 2022-07-25 01:09:09 +03:00
Nikolay Nikolov
5395e52539 - disable the cs_opt_nodecse optimization from the -O2 for the WebAssembly target, because it causes a crash, when compiling the classes unit 2022-07-15 21:40:18 +03:00
Nikolay Nikolov
b900be6142 + added WebAssembly intrinsics for reading __tls_size, __tls_align and __tls_base 2022-07-14 04:15:47 +03:00
Nikolay Nikolov
7475d22154 + declare the three magic global variables (__tls_size, __tls_align, __tls_base), created by the linker, when WebAssembly multithreading is enabled 2022-07-14 03:57:06 +03:00
Nikolay Nikolov
4db653998b + generate proper WebAssembly threadvar access when multithreading is turned on 2022-07-14 02:39:07 +03:00