Commit Graph

259 Commits

Author SHA1 Message Date
Wenyong Huang
cba4c78273
Enable call wasm-c-api native func directly from interpreter (#656)
And update loader error messages for latest spec cases, fix aot compiler build error based on latest LLVM code base.
2021-06-28 11:59:49 +08:00
LiFeng
c6783ef258
IO: support populate fds into WASM application (#655)
Add new API wasm_runtime_set_wasi_args_ex to support populate stdio fds

Signed-off-by: LiFeng <lifeng68@huawei.com>
2021-06-22 14:41:49 +08:00
Wenyong Huang
77c71e559a
Add wasm-c-api nested function calls sample (#652)
And enable to copy back the return value of wasm main function when calling wasm_application_execute_main, add license headers in wasm-c-api samples, fix several issues reported by klocwork.
2021-06-16 15:26:28 +08:00
Wenyong Huang
1a4aa5ac2f
Enable multi-thread for tensorflow sample, update wasm-c-api document (#651) 2021-06-14 08:58:32 +08:00
Huang Qi
5d9597f064
platform/nuttx: Support riscv based chips (#648)
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2021-06-07 15:37:09 +08:00
Wenyong Huang
a5ffd656fa
Fix wasm-c-api trap message format issue (#644)
And fix two compile warnings.
2021-06-01 15:05:35 +08:00
YAMAMOTO Takashi
15dd651539
Fix os_cond_timedwait and other issues for NuttX sim/macOS (#562) 2021-05-31 09:56:47 +08:00
Wenyong Huang
ba922b0d0d
Refine the wasm-c-api native func call process of aot mode (#640) 2021-05-26 20:57:30 +08:00
Wenyong Huang
1b34606940
Move application entry APIs out of wasm_runtime_common.c (#639)
And fix libc-builtin print float issue
Add a list to track all third party components
Fix compile error when MEMORY_TRACING is enabled

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
2021-05-26 13:22:03 +08:00
Xu Jun
f637438e4e
Spread module custom data to all threads, enable libc-builtin float print (#633) 2021-05-19 14:57:31 +08:00
Wenyong Huang
a14a4487bb
Re-org thread env init/destroy for HW bound check (#631)
And fix cmake_minimum_required() deprecation warning since envoy is using cmake 3.16 or higher version.
2021-05-14 11:13:12 +08:00
Wenyong Huang
17a2167485
Fix wasm-c-api JIT issue and update makefile (#630) 2021-05-13 15:13:52 +08:00
Wenyong Huang
64b5459066
Implement Windows thread/mutex/cond APIs to support multi-thread (#627)
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>
2021-05-11 16:48:49 +08:00
Wenyong Huang
9710d9325f
Fix wasm-c-api JIT mode issue and enable set LLVM_DIR in cmd line (#624) 2021-04-30 09:13:29 +08:00
Wenyong Huang
fa5f4fe940
Implement Windows boundary check with hardware trap (#623) 2021-04-27 17:18:27 +08:00
Wenyong Huang
eb29385963
Implement more wasm-c-apis and enable Envoy integration (#622)
Implement more wasm-c-api APIs to support Envoy integration:
- sync up with latest c-api definition
- change CMakeLists to export necessary headers and install the static library of iwasm
- enable to export tables and memories
- support memorytype and tabletype APIs
- update wasm-c-api sampels
- enable to export importtype APIs

And refine bazel scripts for sample XNNPACK workload, add license headers for sample simple.

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
2021-04-27 17:05:40 +08:00
Bao Haojun
a332a49a0d
Enable sample/simple for aarch64 (#616)
Fixed a typo in aot_reloc_aarch64.c.
Remove -m32 option in host tool CMakeLists.txt and change data type of structure fields to make host tool work in 64-bit.

Signed-off-by: Bao Haojun <baohaojun@lixiang.com>
2021-04-25 19:12:49 +08:00
Xu Jun
684d766e2b
Refine aot call func procedure and fix zephyr timer overflow issue (#617)
1. Refine the aot call function procedure

2. fix timer integer overflow issue on zephyr platform

3. move wasm_exec_env_set_thread_info into lower layer
2021-04-19 21:06:56 +08:00
Wenyong Huang
03d45f1d62
Import reference-types feature (#612)
Implement spec reference-types proposal for interpreter, AOT and JIT, update documents and add sample. And upgrade AOT_CURRENT_VERSION to 3 as AOT file format and AOT module instance layout are changed.

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
2021-04-15 11:29:20 +08:00
Wenyong Huang
7706e4b151
Re-org SIMD code structure for non-x86 target (#611) 2021-04-13 15:23:22 +08:00
Xiaokang Qin
46db353017
Enable SIMD for AARCH64 Platform (#11) (#610)
Signed-off-by: Wu Zhongmin <zhongmin.wzm@antgroup.com>
Signed-off-by: Xiaokang Qin <xiaokang.qxk@antgroup.com>

Co-authored-by: Wu Zhongmin <zhongmin.wzm@antgroup.com>

Co-authored-by: Wu Zhongmin <zhongmin.wzm@antgroup.com>
2021-04-13 14:45:51 +08:00
Wenyong Huang
8b96f4fb71
Update sample workload's scripts to align with latest emcc (#609)
And enable auxiliary stack overflow/underflow check in JIT mode
2021-04-13 13:42:08 +08:00
Wenyong Huang
ee97618bdb
Fix llvm target vendor-sys-abi not correctly set issue on windows platform (#606) 2021-04-09 17:24:01 +08:00
Xu Jun
09eb858a02
add realloc wrapper, fix pthread_join overwrite issue (#605) 2021-04-09 15:27:12 +08:00
Wenyong Huang
dfe52ab42f
Fix compile warnings on windows platform: dll linkage and others (#604) 2021-04-09 14:55:58 +08:00
Wenyong Huang
77c3ddf7d0
Implement aux stack overflow/underflow check for AOT/interp (#601) 2021-04-07 03:15:59 -05:00
Wenyong Huang
fe76c89c25
Fix aot code failed to run on darwin/android issue (#599) 2021-04-02 12:34:21 +08:00
Wenyong Huang
7db2221ad9
Re-org address unalignment access for fast-interp (#597)
And clear some compile warnings on wasm loader, add ${UV_A_LIBS} for some CMakeLists.txt.
2021-04-01 16:50:46 +08:00
Xu Jun
22bcfe204e
fix aux stack overwritten issue when lib-pthread is enabled (#596) 2021-04-01 15:07:00 +08:00
Wenyong Huang
5a13e1bbbc
Fix compile warnings of wasm-c-api and add more checks (#592) 2021-03-25 10:13:34 +08:00
Javan
8f902fa9ae
Enable Android libc wasi support. (#590)
Some libc APIs required by wasi native lib are missing in some Android API versions, only when the version >= 24, all APIs are supported. Add the missing APIs in android platform layer, leave them empty, report error and return failed if they are called. Also update CMakeLists.txt to enable libc wasi by default.

Co-authored-by: Wenyong Huang <wenyong.huang@intel.com>
2021-03-24 15:53:55 +08:00
Wenyong Huang
be54b4c7cc
Fix sample littlevgl/gui build issues on zephyr platform (#588)
Fix sample littlevgl/guil build issues on zephyr platform, modify code of zephyr platform by adding some macros to control some apis to fit different zephyr version, and align to zephyr-v2.3.0 for sample littlevgl/gui as the latest zephyr version (>=v2.4.0) requires that the thread stack for the thread to create must be defined by macro but not allocating stack memory dynamically.

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
2021-03-23 14:20:50 +08:00
Wenyong Huang
02d27e13ee
Fix some compilation warnings and enable Windows JIT (#586) 2021-03-22 19:28:51 +08:00
Wenyong Huang
68ff3a830e
Set AOT code and data readonly after relocation (#579) 2021-03-18 20:03:40 +08:00
Javan
ca67af91bc
Call asc app exported new/pin/unpin APIs to align with its latest compiler (#577)
AssemblyScript's latest compiler 0.18 exports  __new__/__pin__/unpin APIs to allocate/retain/free memory instead of __new/__retain/__release APIs in older version, we lookup functions of both version to make it compatible for both version.
2021-03-18 16:33:02 +08:00
Wenyong Huang
fda3a26903
Fix some relocation type issues in windows (#574)
Implement Windows PE file relocation type IMAGE_REL_AMD64_ADDR64/ADDR32/REL32, implement relocation for symbol "__xmm@xxx"/"__plt@xxx"/".rdata", implement Windows invokeNative simd asm code and enable SIMD by default for windows platform. Also update wamrc tool.

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
2021-03-16 16:59:16 +08:00
Wenyong Huang
b06ae7272f
Remove heap size check when creating wasi ctx (#565)
Remove check for heap_size==0 when creating wasi ctx, as the related data structures are allocated from global heap instead of app heap now, so it also works when app heap isn't created.
Also add v128 type for Windows so as to fix wamrc compilation error in Windows platform.

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
2021-03-10 16:25:07 +08:00
Wenyong Huang
e9e75a6b09
Fix interpreter not update memory size after call native func (#563)
The native function might call wasm function exported, in which the memory.grow opcode might be executed, and interpreter should update memory size after that, or load/store opcodes may run failed with "out of bounds memory access" exception thrown.

Update tensorflow sample patch, allow tensorflow wasm app to grow memory so as to run more models. And fix some compile issues of littlevgl zephyr sample for latest zephyr source code.

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
2021-03-10 15:07:16 +08:00
Wenyong Huang
a1568825e8
Enable to use BH_VPRINTF macro to redirect stdout output (#560)
Enable to use BH_VPRINTF macro for platform Linux/Windows/Darwin/VxWorks to redirect the stdout output from platform os_printf/os_vprintf, or the wasi output from wasm app to the vprintf like callback function specified by BH_VPRINTF macro of cmake WAMR_BH_VPRINTF variable.

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
2021-03-06 22:29:58 +08:00
Wenyong Huang
a4239f1ffd
Enable SIMD by default for wamrc and iwasm (#559)
Enable SIMD by default for wamrc on x86-64 target, for iwasm on platform Linux and Darwin. And update build wamr document, fix app manager compile warning.

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
2021-03-06 21:30:14 +08:00
Wenyong Huang
54e82ec439
Fix app manager fail to install large app file issue (#555)
Remove the limit of app file size no larger than 1 MB, fix possible memory leak issues when fail to install app file, change message size of aee_host_msg_callback() from uint16 type to uint32 type to fix possible integer overflow issue, and fix some coding style issues of app manager.

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
2021-03-03 20:19:24 +08:00
Wenyong Huang
fe76ce3b68
Update global initialization process for latest spec cases (#553) 2021-03-02 18:24:15 +08:00
Wenyong Huang
686733170c
Enhance ems memory allocator (#544)
The total size actually allocated by ealloc_hmu() might be larger than the size required to allocate, we reset the total size after allocating, so that if heap verification feature is enabled, the data to verify can be written to the right place of the suffix verification area. And in gc_realloc_vo_internal(), free the heap lock until the original data is copied to new object to return.

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
2021-02-25 11:53:17 +08:00
Jonathan
79afa493aa
Fix windows aot loader fail to resolve symbol issue (#540) 2021-02-23 20:55:50 +08:00
Xu Jun
fc50404115
add uvwasi implementation to support wasi on windows [experimental] (#534)
add uvwasi implementation to support wasi on windows [experimental] and update windows.yml

Co-authored-by: Wenyong Huang <wenyong.huang@intel.com>
2021-02-22 14:17:46 +08:00
Xu Jun
370cc83fbd
Fix loader fail to lookup registered native symbol issue (#529) 2021-02-19 11:14:40 +08:00
Wenyong Huang
3849ece496
Fix auxiliary stack size not 16-byte aligned issue (#524) 2021-02-10 10:11:32 +08:00
Xu Jun
52f422dba0
fix pthread library issues: (#522)
1. pthread_join can't get return value from exited threads
2. pthread_cond_wait return success when timeout
2021-02-09 10:36:44 +08:00
Wenyong Huang
1630cb2524
Fix duplicated destroy shared memory's lock issue (#514)
And add native symbol node to list head when registering native symbol, so as to lookup developer's registered node firstly when linking.

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
2021-02-07 11:05:48 +08:00
Xu Jun
5947ea492d
Update invokeNative_em64.asm (#511)
Fix the issue of WIN64 parameter passing
2021-02-04 08:50:15 +08:00