Commit Graph

72 Commits

Author SHA1 Message Date
5a13e1bbbc Fix compile warnings of wasm-c-api and add more checks (#592) 2021-03-25 10:13:34 +08:00
02d27e13ee Fix some compilation warnings and enable Windows JIT (#586) 2021-03-22 19:28:51 +08:00
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
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
fe76ce3b68 Update global initialization process for latest spec cases (#553) 2021-03-02 18:24:15 +08:00
79afa493aa Fix windows aot loader fail to resolve symbol issue (#540) 2021-02-23 20:55:50 +08:00
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
370cc83fbd Fix loader fail to lookup registered native symbol issue (#529) 2021-02-19 11:14:40 +08:00
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
5947ea492d Update invokeNative_em64.asm (#511)
Fix the issue of WIN64 parameter passing
2021-02-04 08:50:15 +08:00
a5188f5574 Add checks to avoid wasm_runtime_malloc memory with size 0 (#507)
In some platforms, allocating memory with size 0 may return NULL but not an empty memory block, which causes runtime load, instantiate or execute wasm/aot file failed. We add checks to try to avoid allocating memory in runtime if the size is 0. And in wasm_runtime_malloc/free, output warning if allocate memory with size 0 and free memory with NULL ptr.
Also fix some coding style issues, fix handle riscv32 ilp32d issue, and fix several wasm-c-api issues.

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
2021-01-28 16:16:02 +08:00
da8c879953 Implement riscv support for interpreter (#505) 2021-01-25 18:41:48 +08:00
240ca2ed46 Implement performance profiler and call stack dump, and update toolchain document (#501)
And remove redundant FAST_INTERP macros in wasm_interp_fast.c, and fix wamrc --help wrong line order issue.

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
2021-01-18 13:23:10 +08:00
8ec03a5165 add porting codes of rt-thread (#494) 2021-01-14 11:26:35 +08:00
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
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
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
50f9a3e340 NFC: fix typo in invokeNative_aarch64.s comment (#479)
`inteter` -> `integer`
2020-12-26 09:45:11 +08:00
adb05ea719 Enable SIMD support for Linux SGX platform (#474) 2020-12-21 15:17:36 +08:00
0700dc9cd4 Fix wasi ctx memory free issue when app heap is corrupted (#455) 2020-11-30 17:00:53 +08:00
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
0359805c82 Import FreeRTOS platform experiment codes for further development (#451) 2020-11-26 19:10:05 +08:00
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
a3074df21b Import SIMD feature and add some workload samples (#438) 2020-11-05 18:15:15 +08:00
91b9458ebd Add more checks to enhance app heap's security (#428) 2020-10-22 18:52:33 +08:00
c515fb1b75 Add tensorflow sample under samples/workload/tensorflow (#427) 2020-10-22 16:18:37 +08:00
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
cc0aab1063 Remove '@' when declare function invokeNative to fix compile error (#417) 2020-10-12 16:52:28 +08:00
d8d367b367 Update some assembler directives for darwin target (#395) 2020-09-23 13:10:26 +08:00
dc4b8c4822 remove errno in wasm_application_execute_func (#396) 2020-09-23 11:50:37 +08:00
e501a6963b Fix some coding style issues, fix doc typo and refine some codes (#392) 2020-09-20 08:20:45 +08:00
7c8ccc7c26 Fix the build warnings on Mac (#388)
Signed-off-by: Xiaokang Qin <xiaokang.qxk@antgroup.com>
2020-09-18 18:22:26 +08:00
0226dbbb3d introduce WAMR memory profiling tool (experimental) (#390) 2020-09-18 18:04:56 +08:00
2499e1ec4b Fix issue and compilation warnings of new function call APIs (#383) 2020-09-14 15:30:42 +08:00
5418e09712 Add two apis for wasm function call (#375)
Add below two apis:

bool wasm_runtime_call_wasm_a(WASMExecEnv *exec_env,
                                                      WASMFunctionInstanceCommon *function,
                                                      uint32 num_results, wasm_val_t results[],
                                                      uint32 num_args, wasm_val_t args[])

bool wasm_runtime_call_wasm_v(WASMExecEnv *exec_env,
                                                      WASMFunctionInstanceCommon *function,
                                                      uint32 num_results, wasm_val_t results[],
                                                      uint32 num_args, ...)

Signed-off-by: Xiaokang Qin <xiaokang.qxk@antgroup.com>
2020-09-08 13:03:35 +08:00
2e0cef3ef1 fix exec_env not checked issue, export __heap_base and __data_end in sample to decrease memory usage (#371) 2020-09-05 14:48:08 +08:00
034606b0a9 Change wasm app offset type from int32 to uint32 (#361)
And fix some sign/unsigned conversion compilation warnings.
2020-08-26 18:33:29 +08:00
0103f6429c Refactor error/exception strings to reduce binary size (#359) 2020-08-21 15:11:31 +08:00
1266ebb222 fix coding style for windows build patch (#350) 2020-08-13 16:40:19 +08:00
21efe12505 add win64 support (#348) 2020-08-13 14:41:20 +08:00
8ad9c1775f Add wamrc AoT compiler building support for Windows(MSVC) (#332) 2020-08-11 11:30:51 +08:00
6aeefbebb2 implement atomics opcodes for interpreter (#344) 2020-08-10 19:43:58 +08:00
1b6ddb37d0 Implement libc-WASI for Linux SGX platform and update documents (#343) 2020-08-10 15:12:26 +08:00
aa7b0ba6b6 Fix wamrc link error and arm assembly code issue (#335) 2020-08-05 09:07:30 +08:00
37aae1bc49 make include headers follow strict protoype rule (#331) 2020-08-04 19:53:34 +08:00
2db335c6d4 add spawn thread API and sample (#333) 2020-08-04 17:40:45 +08:00
29e45e1527 implement atomic opcode in AOT/JIT (#329) 2020-08-03 11:30:26 +08:00
cc05f8fb1c Use quicksort to sort native_symbols (#324) 2020-07-31 20:54:03 +08:00
08d01b65c5 Eable post-MVP feature wasm-c-api (#315) 2020-07-23 16:54:13 +08:00
32b2943369 enable pthread for AoT && update AOT current version to 2 (#311) 2020-07-16 20:35:04 +08:00