Commit Graph

1076 Commits

Author SHA1 Message Date
2c8375ee67 wamr-test-suites: Save .wasm/.aot file to the report dir if test failed (#1937) 2023-02-06 11:04:28 +08:00
42ced88424 Fix stack alignment issue on ia32 (#1934)
The stack of Unix-like (GCC) system should be aligned on 16-byte boundary
according to the x86-32 ABI specification.
2023-02-06 09:07:00 +08:00
c3e9b66b2a Fix jit memory overwritten after instance deinstantiate (#1936)
When de-instantiating the wasm module instance, remove it from the module's
instance list before freeing func_ptrs and fast_jit_func_ptrs of the instance, to avoid
accessing these freed memory in the JIT backend compilation threads.
2023-02-03 11:15:03 +08:00
17f3375d53 Enable gcc-4.8 compilation (#1928) 2023-02-02 19:34:20 +08:00
40a14b51c5 Enable running mode control for runtime and module instance (#1923)
Enable setting running mode when executing a wasm bytecode file
- Four running modes are supported: interpreter, fast-jit, llvm-jit and multi-tier-jit
- Add APIs to set/get the default running mode of the runtime
- Add APIs to set/get the running mode of a wasm module instance
- Add running mode options for iwasm command line tool

And add size/opt level options for LLVM JIT
2023-02-02 18:16:01 +08:00
7bb78dc260 Remove fast jit macro in enum WASMExceptionID (#1933)
The definitions `enum WASMExceptionID` in the compilation of wamrc and the compilation
of Fast JIT are different, since the latter enables the Fast JIT macro while the former doesn't.
This causes that the exception ID in AOT file generated by wamrc may be different from
iwasm binary compiled with Fast JIT enabled, and may result in unexpected behavior.
Remove the macro control to resolve it.
2023-02-02 15:23:44 +08:00
edee2eb956 Loosen the wasi abi compatibility check in loader (#1932)
Change an error to warning when checking wasi abi compatibility in loader, for rust case below:
#[no_mangle]
pub extern "C" fn main() {
    println!("foo");
}
compile it with `cargo build --target wasm32-wasi`, a wasm file is generated with wasi apis imported
and a "void main(void)" function exported.

Other runtime e.g. wasmtime allows to load it and execute the main function with `--invoke` option.
2023-02-02 13:06:30 +08:00
27e7e160af Upgrade toolkits (#1878)
Upgrade the version of related toolkits:
- upgrade llvm to 15.0
- upgrade wasi-sdk to 19.0
- upgrade emsdk to 3.1.28
- upgrade wabt to 1.0.31
- upgrade binaryen to 111

And upgrade the CI scripts, sample workload build scripts, Dockerfiles, and documents.
2023-02-02 09:42:25 +08:00
1614ce12fa wasi-nn: Enable GPU support (#1922)
- Split logic in several dockers
  - runtime: wasi-nn-cpu and wasi-nn- Nvidia-gpu.
  - compilation: wasi-nn-compile. Prepare the testing wasm and generates the TFLites.
- Implement GPU support for TFLite with Opencl.
2023-02-02 08:09:46 +08:00
fe3347d5d2 Fixed the undef error about WAMR_BUILD_MEMORY_PROFILING (#1926) 2023-02-01 17:52:46 +08:00
7d3b2a8773 Make memory profiling show native stack usage (#1917) 2023-02-01 11:52:15 +08:00
0435acdd43 SGX IPFS: Fix a segfault and support seeking beyond the end of files while using SEEK_CUR/SEEK_END (#1916)
The current implementation throws a segmentation fault when padding
files using a large range, because the writing operation overflows the
source buffer, which was a single char.

IPFS previously assumed that the offset for the seek operation was related
to the start of the file (SEEK_SET). It now correctly checks the parameter
'whence' and computes the offset for SEEK_CUR (middle of the file) and
SEEK_END (end of the file).
2023-01-30 08:24:12 +08:00
45c003e6e4 Add docker images auto check and setup support for WAMR-IDE (#1882)
1. Add docker images auto check and setup support for WAMR-IDE
2. Fix bug that the code goes on when user skips install
2023-01-29 09:41:03 +08:00
58316635d4 ci: Enable libc-wasi compilation test on NuttX (#1918) 2023-01-28 12:39:14 +08:00
9eed6686df Refactor WASI-NN to simplify the support for multiple frameworks (#1834)
- Reorganize the library structure
- Use the latest version of `wasi-nn` wit (Oct 25, 2022):
    0f77c48ec1/wasi-nn.wit.md
- Split logic that converts WASM structs to native structs in a separate file
- Simplify addition of new frameworks
2023-01-25 18:32:40 +08:00
965edff4df Remove unused variable in handle_cmd_unload_module (#1913) 2023-01-25 11:07:25 +08:00
b0b8843719 Implement opcode atomic.wait and atomic.notify for Fast JIT (#1914) 2023-01-25 09:53:40 +08:00
cadf9d0ad3 Main thread spread exception when thread-mgr is enabled (#1889)
And refactor clear_wasi_proc_exit_exception, refer to
https://github.com/bytecodealliance/wasm-micro-runtime/pull/1869
2023-01-20 08:54:27 +08:00
cb7ac8fee3 nuttx: Mock socket APIs if NET is disabled (#1896) 2023-01-18 09:16:13 +08:00
64767fddd8 Add some missing macros for int literals in wamr-sdk libc-builtin-sysroot stdint.h (#1888) 2023-01-17 15:25:57 +08:00
a1786428e6 nuttx: Remove fdopendir (#1895)
The newer version of nuttx has implemented fdopendir, and the compiler
reports multiple definitions of it.
2023-01-17 11:16:01 +08:00
e696ac36d7 Fix potential block issue in source debugger (#1887)
Fix issue reported in #1860
2023-01-17 08:45:29 +08:00
622cdbefd6 Prevent undefined behavior from c_api_func_imports == NULL (#1883)
The module instance's c_api_func_imports may be NULL under some circumstances,
add checks before accessing it.
2023-01-14 07:52:39 +08:00
21ba730de3 Document some info about estimating memory usage (#1879)
Only covers limited configurations
2023-01-12 19:04:20 +08:00
f818f4c43f Simplify fcmp intrinsic logic for AOT/XIP (#1881) 2023-01-12 12:05:53 +08:00
219713bfbc Fix go language binding build on macos arm64 (#1875) 2023-01-10 09:15:49 +08:00
4cd88a96d5 Add more types and APIs for attr_container (#1841)
Add more types for attr_container, e.g. uint8, uint32, uint64
Add more APIs for attr_container for int8, int16 and int32 types
Rename fields of the union 'jvalue' and refactor some files that use attr_container
2023-01-09 21:05:30 +08:00
df4b135086 Add WAMR-IDE vscode extension to the Visual Studio Marketplace (#1868)
Publish an extension to the visual studio marketplace using a secret token.
This allows for automation to take place because downloading and installing
the extension is a manual process so it'd be simpler if the extension was
published automatically through the visual studio marketplace.
2023-01-09 18:23:37 +08:00
1f4580fbd8 Enable CI wasi test suite for x86-32 classic/fast interpreter (#1866)
The original CI didn't actually run wasi test suite for x86-32 since the `TEST_ON_X86_32=true`
isn't written into $GITHUB_ENV.

And refine the error output when failed to link import global.
2023-01-06 17:31:39 +08:00
7401718311 Report error in instantiation when meeting unlinked import globals (#1859) 2023-01-06 15:24:11 +08:00
0c4402293d Refine Windows thread waiting list operations (#1853)
Add thread_wait_list_end node for thread data and cond for Windows platform
to speedup the thread join and cond wait operations: no need to traverse the
wait list to get the end node to append the wait node.
2023-01-06 14:51:07 +08:00
c5b7b9d8df feat: Integrate wasi test suite to wamr-test-suites and CI (#1832)
Add [wasi-testsuite](https://github.com/WebAssembly/wasi-testsuite) to set of tests executed from `test_wamr.sh`. 
Additional description here: #1761
2023-01-05 17:16:44 +08:00
bf2be805f9 Add more checks about the imports of wasm_instance_new (#1843)
Check whether the `imports` argument is NULL in wasm_instance_new and check
the import count of each kind.

Fix issue reported by https://github.com/bytecodealliance/wasm-micro-runtime/issues/1833
2023-01-03 17:16:49 +08:00
d5aa354d41 Return result directly if float cmp is called in AOT XIP (#1851) 2022-12-30 16:45:39 +08:00
d309091706 Register missing symbols for f32 to 64 bit integer conversion (#1850) 2022-12-30 15:21:25 +08:00
0090d3e3fc Fix issue of resolving func name in custom name section (#1849)
Should use import_function_count but not import_count to calculate
the func_index in handle_name_section when custom name section
feature is enabled.

And clear the compile warnings of mini loader.
2022-12-30 14:37:04 +08:00
d1fe589d43 Fix fmin/fmax in AOT XIP intrinsics (#1848) 2022-12-29 18:48:55 +08:00
41eb938a95 Fix equal check in AOT XIP float cmp intrinsic (#1847) 2022-12-29 18:11:05 +08:00
6c7ca90229 Use float version library routine for XIP aot_intrinsic_xxx APIs (#1846) 2022-12-29 16:49:27 +08:00
b5f8a2bd08 Add missing soft float intrinsics for risc-v AOT (#1845) 2022-12-29 16:00:33 +08:00
26728cbef2 Remove unnecessary ret value control when spec test is enabled (#1839)
wamr-test-suites scripts can handle the return value correctly when
spec test is enabled.
2022-12-27 16:34:44 +08:00
679a8ab3cb Perfect the codebase for wamr-ide (#1817)
Fix errors and warnings reported by eslint
Add CONTRIBUTING document for vscode-extension
2022-12-27 15:04:36 +08:00
676c3c7b04 Fix failure about preopen of reactor modules (#1816)
Support modes:
- run a commander module only
- run a reactor module only
- run a commander module and a/multiple reactor modules together
  commander propagates WASIArguments to reactors
2022-12-27 12:59:17 +08:00
5d006ad263 Reuse build llvm libraries for spec test on nuttx (#1838)
Fix daily CI break on NuttX.
2022-12-26 14:22:15 +08:00
ba5cdbee3a Fix typo verify_module in aot_compiler.c (#1836) 2022-12-26 12:24:23 +08:00
2953614cb8 Port WAMR to the FreeBSD platform and update the document (#1825) 2022-12-24 10:11:10 +08:00
6fd8001eb6 Update CIs and documents to make naming of generated binaries consistent (#1823) 2022-12-24 09:17:39 +08:00
d04f3988c3 libc-wasi: Fix spurious poll timeout (#1824)
This reverts the "Fix libc-wasi poll_oneoff hang issue" change.
https://github.com/bytecodealliance/wasm-micro-runtime/pull/1300
2022-12-21 17:29:29 +08:00
14288f59b0 Implement Multi-tier JIT (#1774)
Implement 2-level Multi-tier JIT engine: tier-up from Fast JIT to LLVM JIT to
get quick cold startup by Fast JIT and better performance by gradually
switching to LLVM JIT when the LLVM JIT functions are compiled by the
backend threads.

Refer to:
https://github.com/bytecodealliance/wasm-micro-runtime/issues/1302
2022-12-19 11:24:46 +08:00
fb8727ba68 Update release notes and fix issues reported by Coverity (#1813) 2022-12-16 14:16:58 +08:00