Refactor the layout of interpreter and AOT module instance:
- Unify the interp/AOT module instance, use the same WASMModuleInstance/
WASMMemoryInstance/WASMTableInstance data structures for both interpreter
and AOT
- Make the offset of most fields the same in module instance for both interpreter
and AOT, append memory instance structure, global data and table instances to
the end of module instance for interpreter mode (like AOT mode)
- For extra fields in WASM module instance, use WASMModuleInstanceExtra to
create a field `e` for interpreter
- Change the LLVM JIT module instance creating process, LLVM JIT uses the WASM
module and module instance same as interpreter/Fast-JIT mode. So that Fast JIT
and LLVM JIT can access the same data structures, and make it possible to
implement the Multi-tier JIT (tier-up from Fast JIT to LLVM JIT) in the future
- Unify some APIs: merge some APIs for module instance and memory instance's
related operations (only implement one copy)
Note that the AOT ABI is same, the AOT file format, AOT relocation types, how AOT
code accesses the AOT module instance and so on are kept unchanged.
Refer to:
https://github.com/bytecodealliance/wasm-micro-runtime/issues/1384
Initial integration of WASI-NN based on #1225:
- Implement the library core/iwasm/libraries/wasi-nn
- Support TensorFlow, CPU, F32 at the first stage
- Add cmake variable `-DWAMR_BUILD_WASI_NN`
- Add test case based on Docker image and update document
Refer to #1573
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.
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
> And another question, I got many warnings while compiling wamr by clang like:
>
> ```
> [10/67] Building C object CMakeFiles/vmlib.dir/home/huang/Work/wasm-micro-runtime/core/iwasm/common/wasm_exec_env.c.o
> In file included from /home/huang/Work/wasm-micro-runtime/core/iwasm/common/wasm_exec_env.c:6:
> In file included from /home/huang/Work/wasm-micro-runtime/core/iwasm/common/wasm_exec_env.h:11:
> /home/huang/Work/wasm-micro-runtime/core/iwasm/common/../interpreter/wasm.h:573:53: warning: unused parameter 'type_count' [-Wunused-parameter]
> wasm_get_smallest_type_idx(WASMType **types, uint32 type_count,
> ^
> 1 warning generated.
> [15/67] Building C object CMakeFiles/vmlib.dir/home/huang/Work/wasm-micro-runtime/core/iwasm/common/wasm_application.c.o
> In file included from /home/huang/Work/wasm-micro-runtime/core/iwasm/common/wasm_application.c:8:
> In file included from /home/huang/Work/wasm-micro-runtime/core/iwasm/common/../interpreter/wasm_runtime.h:9:
> /home/huang/Work/wasm-micro-runtime/core/iwasm/interpreter/wasm.h:573:53: warning: unused parameter 'type_count' [-Wunused-parameter]
> wasm_get_smallest_type_idx(WASMType **types, uint32 type_count,
> ^
> 1 warning generated.
> ```
>
> It can be fixed simply by -Wno-unused-parameter, but should we fix it by `UNUSED(xxx)` manually ?
It would be great to fix these warnings, but it really takes efforts.
Implement WAMR-IDE with vscode extension to enable developing
WebAssembly applications with coding, building, running and
debugging support. Support both Linux and Windows, and only
support putting all the tools in a docker image, e.g. wasi-sdk, wamrc,
iwasm and so on.
Co-authored-by: Wang Ning <justdoitwn@163.com>
Refer to https://github.com/WebAssembly/WASI/blob/main/design/application-abi.md
to check the WASI ABI compatibility:
- Command (main module) may export _start function with signature "()"
- Reactor (sub module) may export _initialize function with signature "()"
- _start and _initialize can not be exported at the same time
- Reactor cannot export _start function
- Command and Reactor must export memory
And
- Rename module->is_wasi_module to module->import_wasi_api
- Refactor wasm_loader_find_export()
- Remove MULTI_MODULE related codes from mini_loader
- Update multi-module samples
- Fix a "use-after-free" issue. Since we reuse the memory instance of sub module,
just to protect it from freeing an imported memory instance
Enable emitting custom name section to aot file when adding
`--enable-dump-call-stack` or `--enable-dump-call-stack` to
wamrc and there is custom name section in wasm file, which
can be generated by wasi-sdk/emcc "-g" option. So aot runtime
can also get the function name from the custom name section
instead of export section, to which developer should use
`--export-all` for wasi-sdk/emcc to generate export function
names.
Implement Windows thread/mutex/cond related APIs to support Windows multi-thread feature
Change Windows HW boundary check implementation for multi-thread: change SEH to VEH
Fix wasm-c-api issue of getting AOTFunctionInstance by index, fix wasm-c-api compile warnings
Enable to build invokeNative_general.c with cmake variable
Fix several issues in lib-pthread
Disable two LLVM passes in multi-thread mode to reserve volatile semantic
Update docker script and document to build iwasm with Docker image
Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
* Add Windows support for C-API and Runtime API libraries and examples.
Signed-off-by: Wu Zhongmin <vwzm@live.com>
Signed-off-by: Xiaokang Qin <xiaokang.qxk@antgroup.com>
* Address the review comments
Signed-off-by: Xiaokang Qin <xiaokang.qxk@antgroup.com>
* Rewrite the the bh_getopt to make it avaliable for more kinds of options
Signed-off-by: Wu Zhongmin <vwzm@live.com>
Signed-off-by: Xiaokang Qin <xiaokang.qxk@antgroup.com>
* Add the license header
Signed-off-by: Xiaokang Qin <xiaokang.qxk@antgroup.com>
Co-authored-by: Zhongmin Wu <vwzm@live.com>
Add registration of libc-wasi to 'wasi_snapshot_preview1' to support cargo-wasi
change zephyr build method from cmake to west
fix problem when preserve space for local vars
fix wasi authority problem
* add 3rd party folders which are downloaded during building into git ignore configuration file.
Change-Id: I5a5d913b701bcf6889d89706df65a22c366e24af
Co-authored-by: luc <luc@luc-ubuntu19.bj.intel.com>
* Add build configuration for Mac
This patch implements Mac build basically based on Linux platform
implementations and configurations.
The document to build it on Mac has been updated as well.
* Update wasm_application.h
* Update lib_export.h
Add comments for the functions.