Import WAMR Fast JIT which is a lightweight JIT with quick startup, small footprint,
relatively good performance (~40% to ~50% of LLVM JIT) and good portability.
Platforms supported: Linux, MacOS and Linux SGX.
Arch supported: x86-64.
Since legacy binding for loop unswitch pass was removed and we can't get
it back. Implement its equivalent in `aot_llvm_extra.cpp` and use it in
`aot_compiler.c`.
Follow up to #1183.
Upgrade WAMR-IDE: test-tools/wamr-ide folder
- add `wamr-sdk` to include libc-builtin-sysroot header files
- add `prettier` check and apply script in `package.json`
- update `wasm-toolchain` dockerfile and resource
- enhance `build | run | debug` process to clean up the container
- enhance the change workspace
- enhance `wasm` type project check before building, running and debugging
- format the project_compilation.json
- update documents
Before resolving the module function's export in wasm_mini_loader,
"module->retain_function" need to be initialized, otherwise,
the "__new" function export will lead to abort.
issue: https://github.com/bytecodealliance/wasm-micro-runtime/issues/1332
Co-authored-by: yaozhongxiao <yaozhongxiao@bytedance.com>
Fix build script to enable hw bound check for interpreter when
AOT is disabled, so as to enable spec cases test for interp with
hw bound check. And fix the issues found.
Implement boundary check with hardware trap for interpreter on
64-bit platforms:
- To improve the performance of interpreter and Fast JIT
- To prepare for multi-tier compilation for the feature
Linux/MacOS/Windows 64-bit are enabled.
The existing validation didn't work as expected; e.g. for address
pool: 8.8.8.8/24 the application had access to the 127.0.0.1 address (which
should not).
Fix the issue reported in #1282.
When i32/i64 rotate (rotl/rotr) with 0, the LLVM IRs translated are:
left<<0 | left>>64 and left >>0 | left<<64
The value of left >> 64 and left <<64 in LLVM are treated as poison,
which causes invalid result when executing the aot function.
Directly return left when right is 0 to fix the issue.
Sub module's auxiliary stack boundary and bottom may be different from
main module's counterpart, so when calling sub module, its aux stack info
should be gotten and set to exec_env firstly, or aux stack overflow and out
of bounds memory access exception may be thrown when calling sub
module's function.
Fix the issue reported in PR #1278.
Enhance the hw bound check reported in #1262:
When registering signal handlers for SIGSEGV & SIGBUS in boundary
check with hardware trap, preserve the previous handlers for signal
SIGSEGV and SIGBUS, and forward the signal to the preserved signal
handlers if it isn't handled by hw bound check.
Enable aot compiler and jit based on llvm-14.0 and llvm-15.0git,
replace LLVMBuildLoad/LLVMBuildInBoundsGEP/LLVMBuildCall with
LLVMBuildLoad2/LLVMBuildInBoundsGEP2/LLVMBuildCall2, and pass
them with related types, so as to meet the requirements of opaque
pointers.
And fix several compilation errors for llvm-14.0/15.0git.
Most spec cases and standalone cases are tested.
When WAMR_BUILD_TARGET isn't set, choosing right target is decided
by checking `CMAKE_SIZEOF_VOID_P` variable. However, choosing `X86_32`
target is not doing specifically checking size of void pointer. It is kind
a fallback target for others.
This patch explicitly checks the size of void pointer before setting the target
to `X86_32` to fix the issue.
Fix the following warning introduced by the recent change.
```
In file included from wamr/core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/locking.h:17,
from wamr/core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/posix.h:18,
from wamr/core/iwasm/aot/../common/wasm_runtime_common.h:18,
from wamr/core/iwasm/aot/aot_runtime.h:10,
from wamr/core/iwasm/aot/aot_loader.c:6:
wamr/core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/ssp_config.h:55: error: "CONFIG_HAS_ISATTY" redefined [-Werror]
#define CONFIG_HAS_ISATTY 1
In file included from wamr/core/shared/utils/../platform/include/platform_common.h:13,
from wamr/core/shared/utils/bh_platform.h:9,
from wamr/core/iwasm/aot/aot_runtime.h:9,
from wamr/core/iwasm/aot/aot_loader.c:6:
wamr/core/shared/platform/nuttx/platform_internal.h:75: note: this is the location of the previous definition
#define CONFIG_HAS_ISATTY 0
```
When using clang compiler, the f32/f64 return value might be
invalid when calling invokeNative asm code. Declare the return
type of invokeNative as void, and set volatile for the converted
function pointers to resolve the issue.
Enable dump call stack to a buffer, use API
`wasm_runtime_get_call_stack_buf_size` to get the required buffer size
and use API
`wasm_runtime_dump_call_stack_to_buf` to dump call stack to a buffer
Support integrating 3rd-party toolchain llc compiler or asm compiler
into wamrc by setting environment variable WAMRC_LLC_COMPILER
or WAMRC_ASM_COMPILER, wamrc will use these tools to generate
object file from LLVM IR firstly, and then refactor the object file into
aot file.
Implement Go binding APIs of runtime, module and instance
Add sample, build scripts and update the document
Co-authored-by: venus-taibai <97893654+venus-taibai@users.noreply.github.com>
This header file is supposed to be used by user code, which is not
a part of WAMR. Usually WAMR configuration is not available there,
remove DEBUG_INTERP macro control in it.