Commit Graph

770 Commits

Author SHA1 Message Date
alvkeke
8ec03a5165
add porting codes of rt-thread (#494) 2021-01-14 11:26:35 +08:00
Wenyong Huang
8a477786f1
Remove unused block_addr_cache buffer in wasm loader (#493)
And fix possible memory leak issue in aot loader when apply relocation failed.

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
2021-01-08 19:11:12 +08:00
Wenyong Huang
788cbf2a19
Refine aot call_indirect opcode translation (#492)
Re-implement aot call_indirect opcode translation: when calling non-import function, translate it by LLVM call IR to call the function in AOTed code, so as to avoid calling runtime aot_call_indirect API which is much slower. For import function, keep calling aot_call_indirect API due to the possible pointer/string argument conversion.

And add prompt info while app heap is corrupted, change emit_leb to emit_uint32 inter fast-interp to refine footprint.

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
2021-01-05 18:05:30 +08:00
Javan
f2a63d8623
Fix aot bh_assert failed issue on darwin platform x86_64 target (#476) (#488)
Modify the macro control sentences as darwin platform doesn't support mmap with MAP_32BIT flag to put the mapping address into 0-2G range.

Co-authored-by: Wenyong Huang <wenyong.huang@intel.com>
2020-12-30 21:01:36 +08:00
Xiaokang Qin
6c967b71f1
Fix two issues for wasm-c-api (#487)
Fix incorrect func_type unpacking for results
Fix crash for multiple instance usage due to wrong size provided

Signed-off-by: Kanghua Yu <kanghua.ykh@antgroup.com>
Signed-off-by: Xiaokang Qin <xiaokang.qxk@antgroup.com>

Co-authored-by: Kanghua Yu <kanghua.ykh@antgroup.com>
2020-12-30 13:37:19 +08:00
Wenyong Huang
365ec6360b
Update build scripts and documents of workload samples for wasi-sdk-12.0 (#484)
Update the build scripts of sample workloads (meshoptimizer/bwa/wasm-av1) to use the wasi-sdk-12.0 firstly to build the workload and discard clang-11, as wasi-sdk-12 supports wasi, simd and pthread better. And update the related documents.
Also modify wasm mini loader to sync up with the change of wasm normal loader.

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
2020-12-29 14:41:09 +08:00
Wenyong Huang
724858c731
Update wasm app build scripts for wasi-sdk-12 and refine interpreter (#481)
Update wasm app build scripts for wasi-sdk-12.0: add --export=__main_argc_argv, remove --no-threads
Lookup function with name "__main_argc_argv" as main function besides "main"
Change module_malloc to runtime_malloc in wasi native lib
Refine classic interpreter op_block and op_br_table
Refine faster interpreter op_br_table

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
2020-12-28 10:46:31 +08:00
Max Desiatov
13f0b2485b
Update darwin CMakeLists.txt to support Apple Silicon on macOS (#480)
Without this change in a corresponding `CMakeLists.txt` it attempts to build `invokeNative` assembly for `X86_64` on Macs with Apple Silicon.

Co-authored-by: Wenyong Huang <wenyong.huang@intel.com>
2020-12-27 12:16:46 +08:00
Max Desiatov
50f9a3e340
NFC: fix typo in invokeNative_aarch64.s comment (#479)
`inteter` -> `integer`
2020-12-26 09:45:11 +08:00
Yuta Saito
cb0e593c15
Remove debris tlsf in git repo (#475) 2020-12-21 18:24:14 +08:00
Wenyong Huang
adb05ea719
Enable SIMD support for Linux SGX platform (#474) 2020-12-21 15:17:36 +08:00
Yuta Saito
a2294877f5
Fix struct stat fields for darwin (#473)
Darwin doesn't support POSIX compatible stat fields when -fmodule
2020-12-21 10:56:33 +08:00
Wenyong Huang
ad35c3c21b
Implement SIMD float ceil/floor/trunc/nearest opcodes (#472)
Implement SIMD f32x4/f64x2 ceil/floor/trunc/nearest opcodes

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
2020-12-16 15:33:25 +08:00
Wenyong Huang
16e6f41b3a
Fix wamr compiler issues and refine some error messages (#470)
Fix potential memory leak issue when using llvm::EngineBuilder().selectTarget()
Fix issue of accessing aot_value's fields after it is freed
Fix JIT not print failed to link import warning
Change some error messages: 'fail to' to 'failed to'
Update error message when SIMD isn't enabled
Fix install littlevgl wasm app of wasi version failed

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
2020-12-15 13:05:39 +08:00
Huang Qi
619c2b383c
product-mini/nuttx: Use readline for repl mode (#469)
The EOL of NuttX is configurable (CR/LF/CRLF), the implementation
of getline in NuttX need CR or LF as line delimiter(CRLF not supported).
Then we should use readline for better compatibility.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>

Co-authored-by: Huang Qi <huangqi3@xiaomi.com>
2020-12-11 19:48:35 +08:00
Huang Qi
7f4e519edc
product-mini/nuttx: Add support for repl mode (#466)
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>

Co-authored-by: Huang Qi <huangqi3@xiaomi.com>
2020-12-09 16:45:41 +08:00
Huang Qi
35acc7f336
platform/NuttX: Add support for lib pthread (#463)
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>

Co-authored-by: Huang Qi <huangqi3@xiaomi.com>
2020-12-08 17:44:08 +08:00
Huang Qi
b75224ce03
Using posix thread implementation for NuttX (#462)
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>

Co-authored-by: Huang Qi <huangqi3@xiaomi.com>
2020-12-07 21:15:41 +08:00
Wenyong Huang
388530c738
Modify os_cond_reltimedwait to support long time wait (#461)
Modify the argument of os_cond_reltimedwait to uint64 type to support long time wait, and handle possible integer overflow.
2020-12-07 17:37:53 +08:00
Xu Jun
a84d51271c
Support AssemblyScript's new/retain/release APIs (#460) 2020-12-07 16:37:49 +08:00
Wenyong Huang
5176fe2595
Fix timer setTimeout issue and some coding style issues (#459) 2020-12-04 18:07:52 +08:00
Wenyong Huang
2f530e67fc
Fix app manager install atomics app issue and optimize workload scripts (#458) 2020-12-04 15:35:45 +08:00
sophy228
c8b0a1cee1
Fix some issues for Arm platform. (#457)
Motivation:
we found some issues during enable the WAMR on arm devices, such as relocation issues, stack alignment issues.

Proposed change:
We optimized the relocation process for arm platform, for relocation jump table, the SP should be aligned to 16 bytes. And we also make "getentropy" worked for other non-supported platform.
2020-12-02 10:22:55 +08:00
Wenyong Huang
591e4ce536
Refine aot exception throw, remove unnecessary labels (#456) 2020-11-30 17:57:22 +08:00
Wenyong Huang
0700dc9cd4
Fix wasi ctx memory free issue when app heap is corrupted (#455) 2020-11-30 17:00:53 +08:00
Wenyong Huang
282831eba5
Fix some compilation warnings and add esp-idf platform for experiment (#454)
And fix some code indent issues.
2020-11-30 16:03:51 +08:00
Karl Fessel
7d8b79a7a7
Addapt to RIOT changes (#452)
RIOT removed kernel_types.h in favor of sched.h
2020-11-27 09:10:00 +08:00
Wenyong Huang
0359805c82
Import FreeRTOS platform experiment codes for further development (#451) 2020-11-26 19:10:05 +08:00
Wenyong Huang
74be7a0b7c
Add more checks to enhance security (#446)
add more checks to enhance security
clear "wasi proc exit" exception before return to caller in wasm/aot call functions
fix memory profiling issue
change movdqa to movdqu in simd invokeNative asm codes to fix issue of unaligned address access
move setjmp/longjmp from libc-builtin to libc-emcc
fix zephyr platform compilation issue in latest zephyr version
2020-11-24 14:00:09 +08:00
Wenyong Huang
f4770ae8c8
Add more llvm optimization passes (#445)
Add more llvm optimization passes to improve AOT/JIT performance
2020-11-23 10:48:22 +08:00
Wenyong Huang
892af84161
Update sample workload wasm-av1 and add workload XNNPACK (#443) 2020-11-13 17:53:23 +08:00
Jia Zhang
a2641e174a
Enhance the readability of WAMR SGX docs (#442)
The global doc/linux_sgx.md needs to explicitly describe the methods to
build a debug enclave and hardware running mode. Because using debug key
to signing enclave image rather than production key is still not trivial
in reality.

For the adaption of Inclavare Containers part, add a prolog and give
more details in order to enhance the readability.

Signed-off-by: Jia Zhang <zhang.jia@linux.alibaba.com>
2020-11-13 13:11:34 +08:00
Jia Zhang
8f4a1963fc
Update SGX documents (#439)
This commit mainly simplifies the description about building a
debug and hw mode enclave.

Signed-off-by: Jia Zhang <zhang.jia@linux.alibaba.com>

Co-authored-by: root <root@rs1g04412.et2sqa>
2020-11-12 20:59:03 +08:00
Wenyong Huang
a3074df21b
Import SIMD feature and add some workload samples (#438) 2020-11-05 18:15:15 +08:00
Wenyong Huang
667282eea9
Implement stat and getentropy for sgx with ocall to run tensorflow (#436) 2020-10-30 12:36:00 +08:00
YaoLe
ed94b7dcc4
Implement Inclavare Containers PAL interface in WAMR Linux-SGX (#429)
* Implement the PAL interface for rune

Work in progress

Signed-off-by: Le Yao <le.yao@intel.com>

* Support PAL for one runtime with multi-instances

Load runtime into enclave and run multi-instances

Signed-off-by: Le Yao <le.yao@intel.com>
2020-10-29 03:34:34 +00:00
Wang Ning
ad4aa9a85f
Update build script to enable running tensorflow workload in linux-sgx (#435) 2020-10-29 03:33:49 +00:00
Wang Ning
c9c882e43d
Fix compilation error for sgxsdk-2.11 (#431)
sgxsdk-2.11 enable pthread_rwlock APIs support, and causes compilation
error. We use macro SGX_THREAD_LOCK_INITIALIZER to control it.
2020-10-23 18:16:56 +08:00
Wenyong Huang
91b9458ebd
Add more checks to enhance app heap's security (#428) 2020-10-22 18:52:33 +08:00
Wang Ning
c515fb1b75
Add tensorflow sample under samples/workload/tensorflow (#427) 2020-10-22 16:18:37 +08:00
lum1n0us
4787b150b8
Enable multi-module support for wasm-c-api (#426)
it is allowed that all imported functions and globals can be
linked by multi-module feature automatically or by wasm-c-api manually
2020-10-16 17:43:57 +08:00
Karl Fessel
f1fe5d7872
add RIOT-OS support to WAMR (#425)
* add RIOT platform

see riot-os.org

* add simple RIOT example
2020-10-16 11:21:53 +08:00
YAMAMOTO Takashi
2dd3875fd9
nuttx: Fix build for sim on macOS (#423) 2020-10-13 14:14:55 +08:00
YAMAMOTO Takashi
f7903caa65
wasm_loader_ctx_init: Don't use false as a pointer (#422) 2020-10-13 14:13:30 +08:00
Xu Jun
b929ee3f71
Update windows build step, add CI support for windows (#420) 2020-10-13 12:13:18 +08:00
Xu Jun
c87f28eacd
support tail-call in AoT (#419) 2020-10-13 08:34:31 +08:00
Karl Fessel
cc0aab1063
Remove '@' when declare function invokeNative to fix compile error (#417) 2020-10-12 16:52:28 +08:00
Wang Xin
06b045a972 Update readme 2020-09-30 08:30:58 +08:00
Xiaokang Qin
c83a5713f9
Add the fast-interp tail call support (#409)
And also fix one bug in loader for tail-call

Signed-off-by: Xiaokang Qin <xiaokang.qxk@antgroup.com>
2020-09-29 10:35:10 +08:00
Wenyong Huang
dc536538ad
Fix sgx enclave module not destroyed issue when loading module failed (#410) 2020-09-29 10:34:06 +08:00