Commit Graph

1560 Commits

Author SHA1 Message Date
Wenyong Huang
5a75c31c38
Add VectorCombine pass for JIT and AOT (#2923)
It improves performance for some cases.
And add several vectorize related passes for JIT mode.
2023-12-26 11:27:20 +08:00
Wenyong Huang
1055c9884b
Refine wasm-c-api wasm_func_call (#2922)
Refine params_to_argv, argv_to_results, wasm_func_param_arity,
wasm_func_result_arity to fasten the wasm-c-api call wasm function process.
2023-12-26 11:05:31 +08:00
liang.he
40b430fd24
Add a script to translate jitted function names in flamegraph (#2906) 2023-12-21 10:57:58 +08:00
Daniel Mangum
9779f922b9
Fix boundary check typo in AOT compiler context (#2913)
Fixes typo in docstrings for boundary check in the AOT compiler context.

Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
2023-12-20 09:08:13 +08:00
Enrico Loparco
6dbfeb25dd
Expose API to set log level in embedder (#2907)
Expose API `void wasm_runtime_set_log_level(log_level_t level)`.
2023-12-15 18:49:33 +08:00
Enrico Loparco
b5022015fc
Avoid reporting timestamp if custom logger is used (#2905)
Loggers (e.g. glog) usually come with instrumentation to add timestamp
and other information when reporting. That results in the timestamp
being reported twice, making the output confusing.
2023-12-14 14:55:17 +08:00
YAMAMOTO Takashi
18529253d8
interpreter: Simplify memory.grow a bit (#2899) 2023-12-12 20:24:51 +08:00
Yage Hu
ef0cd22119
Fix memory size not updating after growing in interpreter (#2898)
This commit fixes linear memory size not updating after growing.
This causes `memory.fill` to throw an exception after `memory.grow`.
2023-12-12 08:36:59 +08:00
Enrico Loparco
4aee3cf14e
Avoid memory import failure when wasi-threads is enabled (#2893)
According to the specification:
```
When instantiating a module which is expected to run
with `wasi-threads`, the WASI host must first allocate shared memories to
satisfy the module's imports.
```
Currently, if a test from the spec is executed while having the `multi-module`
feature enabled, WAMR fails with `WASM module load failed: unknown import`.
That happens because spec tests use memory like this:
  `(memory (export "memory") (import "foo" "bar") 1 1 shared)`
and WAMR tries to find a registered module named `foo`.

At the moment, there is no specific module name that can be used to identify
that the memory is imported because using WASI threads:
  https://github.com/WebAssembly/wasi-threads/issues/33,
so this PR only avoids treating the submodule dependency not being found
as a failure.
2023-12-11 22:17:31 +08:00
Huang Qi
269b695f85
Refactor reloc symbols for riscv (#2894) 2023-12-11 14:44:41 +08:00
Yage Hu
bc2d8959dd
Handle ambiguous fstflags on fd_filestat_set_times (#2892)
It's possible to set both `atim` and `atim_now` in the `fstflags`
parameter.  Same goes for `mtin` and `mtim_now`.  However, it's
ambiguous which time should be set in these two cases.  This commit
checks this and returns `EINVAL`.
2023-12-11 14:16:58 +08:00
Enrico Loparco
6cb2ea4935
fix command-reactor: Look for _initialize only if _start not found (#2891)
A wasm module can be either a command or a reactor, so it can export
either `_start` or `_initialize`. Currently, if a command module is run,
`iwasm` still looks for `_initialize`, resulting in the warning:
  `can not find an export 0 named _initialize in the module`.

Change to look for `_initialize` only if `_start` not found to resolve the issue.
2023-12-11 10:10:26 +08:00
Huang Qi
c6848e45a1
Using docker image for nuttx spectest (#2887)
And disable running the nuttx spectest CI every time PR merged since
it will consume too much runners to slow down the other checks.
2023-12-11 09:48:59 +08:00
Maks Litskevich
63696ba603
Fix typo in CI config and suppress STORE_U8 in TSAN (#2802)
This typo prevented sanitizers to work in the CI.
2023-12-11 09:16:30 +08:00
YAMAMOTO Takashi
1dbae404b4
samples/spawn-thread: Tweak to expose a bug (#2888)
this would expose the deadlock bug, which has been fixed by
https://github.com/bytecodealliance/wasm-micro-runtime/pull/2882
2023-12-08 18:35:40 +08:00
Huang Qi
2fb3dc3ec0
Add arm64 to nuttx compilation test (#2886) 2023-12-08 18:21:47 +08:00
YAMAMOTO Takashi
9c3581c179
samples/spawn-thread: Disable libc and pthread (#2883)
because this sample doesn't really require them.
2023-12-08 18:12:37 +08:00
Wenyong Huang
b008ab4fba
Fix possible dead lock in wasm_cluster_spawn_exec_env (#2882)
Fix a deadlock issue like:

wasm_runtime_spawn_exec_env
wasm_cluster_spawn_exec_env (hold cluster->lock)
wasm_runtime_instantiate_internal
wasm_instantiate
execute_post_instantiate_functions
wasm_exec_env_set_module_inst (grab the lock again)

Refer to #2879.
2023-12-08 17:28:57 +08:00
Stephen Berard
df83aef101
Corrects Zephyr include files for current versions of Zephyr (#2881)
This fixes bug #2880.  Zephyr 3.2 made changes to how headers are reference (see [release notes](https://docs.zephyrproject.org/latest/releases/release-notes-3.2.html)).  Work item [49578](https://github.com/zephyrproject-rtos/zephyr/issues/49578) deprecated the old headers names.
The current WAMR codebase references these old headers, thus causing compile errors with
current versions of Zephyr.

This update adds #ifdefs around the header names.  With this change, compiling with Zephyr 3.2.0
and above will use the new header files.  Prior versions will use the existing code.
2023-12-08 17:16:16 +08:00
Huang Qi
a58e596995
compilation_on_nuttx.yml: Use docker image to simplify env setup (#2878) 2023-12-07 18:03:07 +08:00
Wenyong Huang
78be221594
Fix build llvm on macos (#2877)
Perf support is available on Linux only.
2023-12-07 11:09:36 +08:00
Wenyong Huang
f42ffe1d9d
Fix sample basic intToStr was called with wrong length (#2876)
Reported in https://github.com/bytecodealliance/wasm-micro-runtime/issues/2874.
2023-12-07 10:26:28 +08:00
Yage Hu
0b332d8987
Portably handle fd_advise on directory fd (#2875)
This commit adds a check to `fd_advise`.  If the fd is a directory,
return `ebadf`.  This brings iwasm in line with Wasmtime's behavior.
WASI folks have stated that fd_advise should not work on directories
as this is a Linux-specific behavior:
https://github.com/bytecodealliance/wasmtime/issues/6505#issuecomment-1574122949
2023-12-07 09:52:53 +08:00
Wenyong Huang
ac602bda32
Update version number to 1.3.0 and update release notes (#2821)
And refine the code format for wasm_export.h.
2023-12-06 16:27:21 +08:00
Wenyong Huang
67a887e2d3
Fix compilation warnings on Windows (#2868) 2023-12-06 16:12:33 +08:00
Huang Qi
39d0fabda3
Using stable branch for NuttX relative CI (#2872) 2023-12-06 16:09:17 +08:00
Huang Qi
49cd2e011b
Fix float argument handling for riscv32 ilp32d (#2871) 2023-12-06 11:30:07 +08:00
Huang Qi
47993ec72d
Don't launch extra cores in QEMU to save resource (#2867) 2023-12-06 09:46:50 +08:00
Xu Jun
53c3fa27d4
Fix block with type issue in fast interp (#2866)
Reported in https://github.com/bytecodealliance/wasm-micro-runtime/issues/2863.
2023-12-05 17:09:05 +08:00
Wenyong Huang
23c1343fb3
Fix wasm loader handle op_br_table and op_drop (#2864)
- Fix op_br_table arity type check when the dest block is loop block
- Fix op_drop issue when the stack is polymorphic and it is to drop
  an ANY type value in the stack
2023-12-05 16:59:13 +08:00
Huang Qi
7308b1eb00
Update FPU configuration in spec_test_on_nuttx.yml (#2856) 2023-12-04 18:57:18 +08:00
Huang Qi
e350e65b12
Don't add "+d" to riscv cpu features if already given (#2855) 2023-12-04 17:00:21 +08:00
Wenyong Huang
b0d5b8df1d
Fix issues of build/run with llvm-17 (#2853)
- Fix compilation error of using PGOOptions
- Fix LLVM JIT run error due to `llvm_orc_registerEHFrameSectionWrapper`
  symbol not found
2023-12-04 16:40:54 +08:00
Huang Qi
453a29a9d4
Enable spectest on riscv64 (#2843)
Fix relocation issues on riscv and update test scripts and CI to enable
test spec cases on riscv QEMU.
2023-12-04 14:22:47 +08:00
Daniel Mangum
157c289d07
Fix typos of CIDR in docs and help text (#2851)
Fixes typos of CIDR in socket documentation and libc WASI help text.

Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
2023-12-04 11:38:54 +08:00
Daniel Mangum
48e24032ba
doc/build_wamr.md: Fix links to RISC-V named ABIs (#2852)
Fixes links to RISC-V application binary interface names.

Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
2023-12-04 10:05:26 +08:00
YAMAMOTO Takashi
73914caa9b
core/iwasm/interpreter/wasm_loader.c: remove an extra validation (#2845)
* Empty names are spec-wise valid.
* As we ignore unknown custom sections anyway, it's safe to
  accept empty names here.
* Currently, the problem is not exposed on our CI because
   the wabt version used there is a bit old.
2023-12-01 18:29:15 +08:00
YAMAMOTO Takashi
fbd9a760e7
test_wamr.sh: Don't bother to build shared library (#2844)
This script only uses the iwasm command.
2023-12-01 18:12:55 +08:00
TianlongLiang
3d0342fbc8
Fix fast-jit accessing shared memory's fields issue (#2841)
For shared memory, runtime should get the memories pointer from
module_inst first, then get memory instance from memories array,
and then get the fields of the memory instance.
2023-12-01 17:41:24 +08:00
liang.he
162a977006
Use wasm_config_t to pass private configuration to wasm_engine_new (#2837)
Support new a wasm_config_t, set allocation and linux_perf_support
options to it, and then pass it to wasm_engine_new_with_config to
new an engine with private configuration.
2023-12-01 12:34:11 +08:00
liang.he
718f0671e7
Output warning and quit if import/export name contains '\00' (#2806)
Leave it as a limitation when import/export name contains '\00' in wasm file.
p.s. https://github.com/bytecodealliance/wasm-micro-runtime/issues/2789
2023-12-01 11:14:13 +08:00
Enrico Loparco
873558c40e
Get rid of compilation warnings and minor doc fix (#2839) 2023-11-30 08:49:58 +08:00
Enrico Loparco
0455071fc1
Access linear memory size atomically (#2834)
Fixes: https://github.com/bytecodealliance/wasm-micro-runtime/issues/2804
2023-11-29 20:27:17 +08:00
liang.he
b81abd01ef
Add a user tip about flamegraph (#2827) 2023-11-28 13:46:14 +08:00
Wenyong Huang
1d0f789754
Fix typos in libsodium workload (#2825) 2023-11-27 15:53:37 +08:00
liang.he
8aa813f44a
Generate jitdump to support linux perf for LLVM JIT (#2788) 2023-11-27 15:42:00 +08:00
Huang Qi
d7608690c0
Run spec test for classic/fast-interp in NuttX CI (#2817) 2023-11-27 15:24:02 +08:00
liang.he
5377e18623
iwasm: Print help when meeting unknown cmd options (#2824) 2023-11-27 11:16:54 +08:00
Marcin Kolny
5f7079f0f5
Return error when shutdown() fails (#2801)
Fix issue reported in #2787.
2023-11-24 21:03:59 +08:00
Wenyong Huang
1ba4acd1c7
Fix wamr-test-suites script for macos (#2819)
Update the wabt release binary name for macos and fix a syntax error:

```bash
./test_wamr.sh: line 356: syntax error near unexpected token `;'
./test_wamr.sh: line 356: `                    ;&'
```
2023-11-24 16:21:05 +08:00