Enable AoT and wamr-sdk, and change arguments of call wasm API (#157)
* Implement memory profiler, optimize memory usage, modify code indent
* Implement memory.grow and limit heap space base offset to 1G; modify iwasm build type to Release and 64 bit by default
* Add a new extension library: connection
* Fix bug of reading magic number and version in big endian platform
* Re-org platform APIs: move most platform APIs from iwasm to shared-lib
* Enhance wasm loader to fix some security issues
* Fix issue about illegal load of EXC_RETURN into PC on stm32 board
* Updates that let a restricted version of the interpreter run in SGX
* Enable native/app address validation and conversion for wasm app
* Remove wasm_application_exectue_* APIs from wasm_export.h which makes confused
* Refine binary size and fix several minor issues
Optimize interpreter LOAD/STORE opcodes to decrease the binary size
Fix issues when using iwasm library: _bh_log undefined, bh_memory.h not found
Remove unused _stdin/_stdout/_stderr global variables resolve in libc wrapper
Add macros of global heap size, stack size, heap size for Zephyr main.c
Clear compile warning of wasm_application.c
* Add more strict security checks for libc wrapper API's
* Use one libc wrapper copy for sgx and other platforms; remove bh_printf macro for other platform header files
* Enhance security of libc strcpy/sprintf wrapper function
* Fix issue of call native for x86_64/arm/mips, add module inst parameter for native wrapper functions
* Remove get_module_inst() and fix issue of call native
* Refine wgl lib: remove module_inst parameter from widget functions; move function index check to runtime instantiate
* Refine interpreter call native process, refine memory boudary check
* Fix issues of invokeNative function of arm/mips/general version
* Add a switch to build simple sample without gui support
* Add BUILD_TARGET setting in makefile to replace cpu compiler flags in source code
* Re-org shared lib header files, remove unused info; fix compile issues of vxworks
* Add build target general
* Remove unused files
* Update license header
* test push
* Restore file
* Sync up with internal/feature
* Sync up with internal/feature
* Rename build_wamr_app to build_wasm_app
* Fix small issues of README
* Enhance malformed wasm file checking
Fix issue of print hex int and implement utf8 string check
Fix wasi file read/write right issue
Fix minor issue of build wasm app doc
* Sync up with internal/feature
* Sync up with internal/feature: fix interpreter arm issue, fix read leb issue
* Sync up with internal/feature
* Fix bug of config.h and rename wasi config.h to ssp_config.h
* Sync up with internal/feature
* Import wamr aot
* update document
* update document
* Update document, disable WASI in 32bit
* update document
* remove files
* update document
* Update document
* update document
* update document
* update samples
* Sync up with internal repo
2020-01-21 05:26:14 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2019 Intel Corporation. All rights reserved.
|
|
|
|
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _AOT_COMPILER_H_
|
|
|
|
#define _AOT_COMPILER_H_
|
|
|
|
|
|
|
|
#include "aot.h"
|
|
|
|
#include "aot_llvm.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2021-09-02 04:49:01 +00:00
|
|
|
typedef AOTIntCond IntCond;
|
|
|
|
typedef AOTFloatCond FloatCond;
|
Enable AoT and wamr-sdk, and change arguments of call wasm API (#157)
* Implement memory profiler, optimize memory usage, modify code indent
* Implement memory.grow and limit heap space base offset to 1G; modify iwasm build type to Release and 64 bit by default
* Add a new extension library: connection
* Fix bug of reading magic number and version in big endian platform
* Re-org platform APIs: move most platform APIs from iwasm to shared-lib
* Enhance wasm loader to fix some security issues
* Fix issue about illegal load of EXC_RETURN into PC on stm32 board
* Updates that let a restricted version of the interpreter run in SGX
* Enable native/app address validation and conversion for wasm app
* Remove wasm_application_exectue_* APIs from wasm_export.h which makes confused
* Refine binary size and fix several minor issues
Optimize interpreter LOAD/STORE opcodes to decrease the binary size
Fix issues when using iwasm library: _bh_log undefined, bh_memory.h not found
Remove unused _stdin/_stdout/_stderr global variables resolve in libc wrapper
Add macros of global heap size, stack size, heap size for Zephyr main.c
Clear compile warning of wasm_application.c
* Add more strict security checks for libc wrapper API's
* Use one libc wrapper copy for sgx and other platforms; remove bh_printf macro for other platform header files
* Enhance security of libc strcpy/sprintf wrapper function
* Fix issue of call native for x86_64/arm/mips, add module inst parameter for native wrapper functions
* Remove get_module_inst() and fix issue of call native
* Refine wgl lib: remove module_inst parameter from widget functions; move function index check to runtime instantiate
* Refine interpreter call native process, refine memory boudary check
* Fix issues of invokeNative function of arm/mips/general version
* Add a switch to build simple sample without gui support
* Add BUILD_TARGET setting in makefile to replace cpu compiler flags in source code
* Re-org shared lib header files, remove unused info; fix compile issues of vxworks
* Add build target general
* Remove unused files
* Update license header
* test push
* Restore file
* Sync up with internal/feature
* Sync up with internal/feature
* Rename build_wamr_app to build_wasm_app
* Fix small issues of README
* Enhance malformed wasm file checking
Fix issue of print hex int and implement utf8 string check
Fix wasi file read/write right issue
Fix minor issue of build wasm app doc
* Sync up with internal/feature
* Sync up with internal/feature: fix interpreter arm issue, fix read leb issue
* Sync up with internal/feature
* Fix bug of config.h and rename wasi config.h to ssp_config.h
* Sync up with internal/feature
* Import wamr aot
* update document
* update document
* Update document, disable WASI in 32bit
* update document
* remove files
* update document
* Update document
* update document
* update document
* update samples
* Sync up with internal repo
2020-01-21 05:26:14 +00:00
|
|
|
|
|
|
|
typedef enum IntArithmetic {
|
2021-10-13 07:13:00 +00:00
|
|
|
INT_ADD = 0,
|
|
|
|
INT_SUB,
|
|
|
|
INT_MUL,
|
|
|
|
INT_DIV_S,
|
|
|
|
INT_DIV_U,
|
|
|
|
INT_REM_S,
|
|
|
|
INT_REM_U
|
Enable AoT and wamr-sdk, and change arguments of call wasm API (#157)
* Implement memory profiler, optimize memory usage, modify code indent
* Implement memory.grow and limit heap space base offset to 1G; modify iwasm build type to Release and 64 bit by default
* Add a new extension library: connection
* Fix bug of reading magic number and version in big endian platform
* Re-org platform APIs: move most platform APIs from iwasm to shared-lib
* Enhance wasm loader to fix some security issues
* Fix issue about illegal load of EXC_RETURN into PC on stm32 board
* Updates that let a restricted version of the interpreter run in SGX
* Enable native/app address validation and conversion for wasm app
* Remove wasm_application_exectue_* APIs from wasm_export.h which makes confused
* Refine binary size and fix several minor issues
Optimize interpreter LOAD/STORE opcodes to decrease the binary size
Fix issues when using iwasm library: _bh_log undefined, bh_memory.h not found
Remove unused _stdin/_stdout/_stderr global variables resolve in libc wrapper
Add macros of global heap size, stack size, heap size for Zephyr main.c
Clear compile warning of wasm_application.c
* Add more strict security checks for libc wrapper API's
* Use one libc wrapper copy for sgx and other platforms; remove bh_printf macro for other platform header files
* Enhance security of libc strcpy/sprintf wrapper function
* Fix issue of call native for x86_64/arm/mips, add module inst parameter for native wrapper functions
* Remove get_module_inst() and fix issue of call native
* Refine wgl lib: remove module_inst parameter from widget functions; move function index check to runtime instantiate
* Refine interpreter call native process, refine memory boudary check
* Fix issues of invokeNative function of arm/mips/general version
* Add a switch to build simple sample without gui support
* Add BUILD_TARGET setting in makefile to replace cpu compiler flags in source code
* Re-org shared lib header files, remove unused info; fix compile issues of vxworks
* Add build target general
* Remove unused files
* Update license header
* test push
* Restore file
* Sync up with internal/feature
* Sync up with internal/feature
* Rename build_wamr_app to build_wasm_app
* Fix small issues of README
* Enhance malformed wasm file checking
Fix issue of print hex int and implement utf8 string check
Fix wasi file read/write right issue
Fix minor issue of build wasm app doc
* Sync up with internal/feature
* Sync up with internal/feature: fix interpreter arm issue, fix read leb issue
* Sync up with internal/feature
* Fix bug of config.h and rename wasi config.h to ssp_config.h
* Sync up with internal/feature
* Import wamr aot
* update document
* update document
* Update document, disable WASI in 32bit
* update document
* remove files
* update document
* Update document
* update document
* update document
* update samples
* Sync up with internal repo
2020-01-21 05:26:14 +00:00
|
|
|
} IntArithmetic;
|
|
|
|
|
2020-11-05 10:15:15 +00:00
|
|
|
typedef enum V128Arithmetic {
|
2021-10-13 07:13:00 +00:00
|
|
|
V128_ADD = 0,
|
|
|
|
V128_SUB,
|
|
|
|
V128_MUL,
|
|
|
|
V128_DIV,
|
|
|
|
V128_NEG,
|
|
|
|
V128_MIN,
|
|
|
|
V128_MAX,
|
2020-11-05 10:15:15 +00:00
|
|
|
} V128Arithmetic;
|
|
|
|
|
Enable AoT and wamr-sdk, and change arguments of call wasm API (#157)
* Implement memory profiler, optimize memory usage, modify code indent
* Implement memory.grow and limit heap space base offset to 1G; modify iwasm build type to Release and 64 bit by default
* Add a new extension library: connection
* Fix bug of reading magic number and version in big endian platform
* Re-org platform APIs: move most platform APIs from iwasm to shared-lib
* Enhance wasm loader to fix some security issues
* Fix issue about illegal load of EXC_RETURN into PC on stm32 board
* Updates that let a restricted version of the interpreter run in SGX
* Enable native/app address validation and conversion for wasm app
* Remove wasm_application_exectue_* APIs from wasm_export.h which makes confused
* Refine binary size and fix several minor issues
Optimize interpreter LOAD/STORE opcodes to decrease the binary size
Fix issues when using iwasm library: _bh_log undefined, bh_memory.h not found
Remove unused _stdin/_stdout/_stderr global variables resolve in libc wrapper
Add macros of global heap size, stack size, heap size for Zephyr main.c
Clear compile warning of wasm_application.c
* Add more strict security checks for libc wrapper API's
* Use one libc wrapper copy for sgx and other platforms; remove bh_printf macro for other platform header files
* Enhance security of libc strcpy/sprintf wrapper function
* Fix issue of call native for x86_64/arm/mips, add module inst parameter for native wrapper functions
* Remove get_module_inst() and fix issue of call native
* Refine wgl lib: remove module_inst parameter from widget functions; move function index check to runtime instantiate
* Refine interpreter call native process, refine memory boudary check
* Fix issues of invokeNative function of arm/mips/general version
* Add a switch to build simple sample without gui support
* Add BUILD_TARGET setting in makefile to replace cpu compiler flags in source code
* Re-org shared lib header files, remove unused info; fix compile issues of vxworks
* Add build target general
* Remove unused files
* Update license header
* test push
* Restore file
* Sync up with internal/feature
* Sync up with internal/feature
* Rename build_wamr_app to build_wasm_app
* Fix small issues of README
* Enhance malformed wasm file checking
Fix issue of print hex int and implement utf8 string check
Fix wasi file read/write right issue
Fix minor issue of build wasm app doc
* Sync up with internal/feature
* Sync up with internal/feature: fix interpreter arm issue, fix read leb issue
* Sync up with internal/feature
* Fix bug of config.h and rename wasi config.h to ssp_config.h
* Sync up with internal/feature
* Import wamr aot
* update document
* update document
* Update document, disable WASI in 32bit
* update document
* remove files
* update document
* Update document
* update document
* update document
* update samples
* Sync up with internal repo
2020-01-21 05:26:14 +00:00
|
|
|
typedef enum IntBitwise {
|
2021-10-13 07:13:00 +00:00
|
|
|
INT_AND = 0,
|
|
|
|
INT_OR,
|
|
|
|
INT_XOR,
|
Enable AoT and wamr-sdk, and change arguments of call wasm API (#157)
* Implement memory profiler, optimize memory usage, modify code indent
* Implement memory.grow and limit heap space base offset to 1G; modify iwasm build type to Release and 64 bit by default
* Add a new extension library: connection
* Fix bug of reading magic number and version in big endian platform
* Re-org platform APIs: move most platform APIs from iwasm to shared-lib
* Enhance wasm loader to fix some security issues
* Fix issue about illegal load of EXC_RETURN into PC on stm32 board
* Updates that let a restricted version of the interpreter run in SGX
* Enable native/app address validation and conversion for wasm app
* Remove wasm_application_exectue_* APIs from wasm_export.h which makes confused
* Refine binary size and fix several minor issues
Optimize interpreter LOAD/STORE opcodes to decrease the binary size
Fix issues when using iwasm library: _bh_log undefined, bh_memory.h not found
Remove unused _stdin/_stdout/_stderr global variables resolve in libc wrapper
Add macros of global heap size, stack size, heap size for Zephyr main.c
Clear compile warning of wasm_application.c
* Add more strict security checks for libc wrapper API's
* Use one libc wrapper copy for sgx and other platforms; remove bh_printf macro for other platform header files
* Enhance security of libc strcpy/sprintf wrapper function
* Fix issue of call native for x86_64/arm/mips, add module inst parameter for native wrapper functions
* Remove get_module_inst() and fix issue of call native
* Refine wgl lib: remove module_inst parameter from widget functions; move function index check to runtime instantiate
* Refine interpreter call native process, refine memory boudary check
* Fix issues of invokeNative function of arm/mips/general version
* Add a switch to build simple sample without gui support
* Add BUILD_TARGET setting in makefile to replace cpu compiler flags in source code
* Re-org shared lib header files, remove unused info; fix compile issues of vxworks
* Add build target general
* Remove unused files
* Update license header
* test push
* Restore file
* Sync up with internal/feature
* Sync up with internal/feature
* Rename build_wamr_app to build_wasm_app
* Fix small issues of README
* Enhance malformed wasm file checking
Fix issue of print hex int and implement utf8 string check
Fix wasi file read/write right issue
Fix minor issue of build wasm app doc
* Sync up with internal/feature
* Sync up with internal/feature: fix interpreter arm issue, fix read leb issue
* Sync up with internal/feature
* Fix bug of config.h and rename wasi config.h to ssp_config.h
* Sync up with internal/feature
* Import wamr aot
* update document
* update document
* Update document, disable WASI in 32bit
* update document
* remove files
* update document
* Update document
* update document
* update document
* update samples
* Sync up with internal repo
2020-01-21 05:26:14 +00:00
|
|
|
} IntBitwise;
|
|
|
|
|
2020-11-05 10:15:15 +00:00
|
|
|
typedef enum V128Bitwise {
|
2021-10-13 07:13:00 +00:00
|
|
|
V128_NOT,
|
|
|
|
V128_AND,
|
|
|
|
V128_ANDNOT,
|
|
|
|
V128_OR,
|
|
|
|
V128_XOR,
|
|
|
|
V128_BITSELECT,
|
2020-11-05 10:15:15 +00:00
|
|
|
} V128Bitwise;
|
|
|
|
|
Enable AoT and wamr-sdk, and change arguments of call wasm API (#157)
* Implement memory profiler, optimize memory usage, modify code indent
* Implement memory.grow and limit heap space base offset to 1G; modify iwasm build type to Release and 64 bit by default
* Add a new extension library: connection
* Fix bug of reading magic number and version in big endian platform
* Re-org platform APIs: move most platform APIs from iwasm to shared-lib
* Enhance wasm loader to fix some security issues
* Fix issue about illegal load of EXC_RETURN into PC on stm32 board
* Updates that let a restricted version of the interpreter run in SGX
* Enable native/app address validation and conversion for wasm app
* Remove wasm_application_exectue_* APIs from wasm_export.h which makes confused
* Refine binary size and fix several minor issues
Optimize interpreter LOAD/STORE opcodes to decrease the binary size
Fix issues when using iwasm library: _bh_log undefined, bh_memory.h not found
Remove unused _stdin/_stdout/_stderr global variables resolve in libc wrapper
Add macros of global heap size, stack size, heap size for Zephyr main.c
Clear compile warning of wasm_application.c
* Add more strict security checks for libc wrapper API's
* Use one libc wrapper copy for sgx and other platforms; remove bh_printf macro for other platform header files
* Enhance security of libc strcpy/sprintf wrapper function
* Fix issue of call native for x86_64/arm/mips, add module inst parameter for native wrapper functions
* Remove get_module_inst() and fix issue of call native
* Refine wgl lib: remove module_inst parameter from widget functions; move function index check to runtime instantiate
* Refine interpreter call native process, refine memory boudary check
* Fix issues of invokeNative function of arm/mips/general version
* Add a switch to build simple sample without gui support
* Add BUILD_TARGET setting in makefile to replace cpu compiler flags in source code
* Re-org shared lib header files, remove unused info; fix compile issues of vxworks
* Add build target general
* Remove unused files
* Update license header
* test push
* Restore file
* Sync up with internal/feature
* Sync up with internal/feature
* Rename build_wamr_app to build_wasm_app
* Fix small issues of README
* Enhance malformed wasm file checking
Fix issue of print hex int and implement utf8 string check
Fix wasi file read/write right issue
Fix minor issue of build wasm app doc
* Sync up with internal/feature
* Sync up with internal/feature: fix interpreter arm issue, fix read leb issue
* Sync up with internal/feature
* Fix bug of config.h and rename wasi config.h to ssp_config.h
* Sync up with internal/feature
* Import wamr aot
* update document
* update document
* Update document, disable WASI in 32bit
* update document
* remove files
* update document
* Update document
* update document
* update document
* update samples
* Sync up with internal repo
2020-01-21 05:26:14 +00:00
|
|
|
typedef enum IntShift {
|
2021-10-13 07:13:00 +00:00
|
|
|
INT_SHL = 0,
|
|
|
|
INT_SHR_S,
|
|
|
|
INT_SHR_U,
|
|
|
|
INT_ROTL,
|
|
|
|
INT_ROTR
|
Enable AoT and wamr-sdk, and change arguments of call wasm API (#157)
* Implement memory profiler, optimize memory usage, modify code indent
* Implement memory.grow and limit heap space base offset to 1G; modify iwasm build type to Release and 64 bit by default
* Add a new extension library: connection
* Fix bug of reading magic number and version in big endian platform
* Re-org platform APIs: move most platform APIs from iwasm to shared-lib
* Enhance wasm loader to fix some security issues
* Fix issue about illegal load of EXC_RETURN into PC on stm32 board
* Updates that let a restricted version of the interpreter run in SGX
* Enable native/app address validation and conversion for wasm app
* Remove wasm_application_exectue_* APIs from wasm_export.h which makes confused
* Refine binary size and fix several minor issues
Optimize interpreter LOAD/STORE opcodes to decrease the binary size
Fix issues when using iwasm library: _bh_log undefined, bh_memory.h not found
Remove unused _stdin/_stdout/_stderr global variables resolve in libc wrapper
Add macros of global heap size, stack size, heap size for Zephyr main.c
Clear compile warning of wasm_application.c
* Add more strict security checks for libc wrapper API's
* Use one libc wrapper copy for sgx and other platforms; remove bh_printf macro for other platform header files
* Enhance security of libc strcpy/sprintf wrapper function
* Fix issue of call native for x86_64/arm/mips, add module inst parameter for native wrapper functions
* Remove get_module_inst() and fix issue of call native
* Refine wgl lib: remove module_inst parameter from widget functions; move function index check to runtime instantiate
* Refine interpreter call native process, refine memory boudary check
* Fix issues of invokeNative function of arm/mips/general version
* Add a switch to build simple sample without gui support
* Add BUILD_TARGET setting in makefile to replace cpu compiler flags in source code
* Re-org shared lib header files, remove unused info; fix compile issues of vxworks
* Add build target general
* Remove unused files
* Update license header
* test push
* Restore file
* Sync up with internal/feature
* Sync up with internal/feature
* Rename build_wamr_app to build_wasm_app
* Fix small issues of README
* Enhance malformed wasm file checking
Fix issue of print hex int and implement utf8 string check
Fix wasi file read/write right issue
Fix minor issue of build wasm app doc
* Sync up with internal/feature
* Sync up with internal/feature: fix interpreter arm issue, fix read leb issue
* Sync up with internal/feature
* Fix bug of config.h and rename wasi config.h to ssp_config.h
* Sync up with internal/feature
* Import wamr aot
* update document
* update document
* Update document, disable WASI in 32bit
* update document
* remove files
* update document
* Update document
* update document
* update document
* update samples
* Sync up with internal repo
2020-01-21 05:26:14 +00:00
|
|
|
} IntShift;
|
|
|
|
|
|
|
|
typedef enum FloatMath {
|
2021-10-13 07:13:00 +00:00
|
|
|
FLOAT_ABS = 0,
|
|
|
|
FLOAT_NEG,
|
|
|
|
FLOAT_CEIL,
|
|
|
|
FLOAT_FLOOR,
|
|
|
|
FLOAT_TRUNC,
|
|
|
|
FLOAT_NEAREST,
|
|
|
|
FLOAT_SQRT
|
Enable AoT and wamr-sdk, and change arguments of call wasm API (#157)
* Implement memory profiler, optimize memory usage, modify code indent
* Implement memory.grow and limit heap space base offset to 1G; modify iwasm build type to Release and 64 bit by default
* Add a new extension library: connection
* Fix bug of reading magic number and version in big endian platform
* Re-org platform APIs: move most platform APIs from iwasm to shared-lib
* Enhance wasm loader to fix some security issues
* Fix issue about illegal load of EXC_RETURN into PC on stm32 board
* Updates that let a restricted version of the interpreter run in SGX
* Enable native/app address validation and conversion for wasm app
* Remove wasm_application_exectue_* APIs from wasm_export.h which makes confused
* Refine binary size and fix several minor issues
Optimize interpreter LOAD/STORE opcodes to decrease the binary size
Fix issues when using iwasm library: _bh_log undefined, bh_memory.h not found
Remove unused _stdin/_stdout/_stderr global variables resolve in libc wrapper
Add macros of global heap size, stack size, heap size for Zephyr main.c
Clear compile warning of wasm_application.c
* Add more strict security checks for libc wrapper API's
* Use one libc wrapper copy for sgx and other platforms; remove bh_printf macro for other platform header files
* Enhance security of libc strcpy/sprintf wrapper function
* Fix issue of call native for x86_64/arm/mips, add module inst parameter for native wrapper functions
* Remove get_module_inst() and fix issue of call native
* Refine wgl lib: remove module_inst parameter from widget functions; move function index check to runtime instantiate
* Refine interpreter call native process, refine memory boudary check
* Fix issues of invokeNative function of arm/mips/general version
* Add a switch to build simple sample without gui support
* Add BUILD_TARGET setting in makefile to replace cpu compiler flags in source code
* Re-org shared lib header files, remove unused info; fix compile issues of vxworks
* Add build target general
* Remove unused files
* Update license header
* test push
* Restore file
* Sync up with internal/feature
* Sync up with internal/feature
* Rename build_wamr_app to build_wasm_app
* Fix small issues of README
* Enhance malformed wasm file checking
Fix issue of print hex int and implement utf8 string check
Fix wasi file read/write right issue
Fix minor issue of build wasm app doc
* Sync up with internal/feature
* Sync up with internal/feature: fix interpreter arm issue, fix read leb issue
* Sync up with internal/feature
* Fix bug of config.h and rename wasi config.h to ssp_config.h
* Sync up with internal/feature
* Import wamr aot
* update document
* update document
* Update document, disable WASI in 32bit
* update document
* remove files
* update document
* Update document
* update document
* update document
* update samples
* Sync up with internal repo
2020-01-21 05:26:14 +00:00
|
|
|
} FloatMath;
|
|
|
|
|
|
|
|
typedef enum FloatArithmetic {
|
2021-10-13 07:13:00 +00:00
|
|
|
FLOAT_ADD = 0,
|
|
|
|
FLOAT_SUB,
|
|
|
|
FLOAT_MUL,
|
|
|
|
FLOAT_DIV,
|
|
|
|
FLOAT_MIN,
|
|
|
|
FLOAT_MAX,
|
Enable AoT and wamr-sdk, and change arguments of call wasm API (#157)
* Implement memory profiler, optimize memory usage, modify code indent
* Implement memory.grow and limit heap space base offset to 1G; modify iwasm build type to Release and 64 bit by default
* Add a new extension library: connection
* Fix bug of reading magic number and version in big endian platform
* Re-org platform APIs: move most platform APIs from iwasm to shared-lib
* Enhance wasm loader to fix some security issues
* Fix issue about illegal load of EXC_RETURN into PC on stm32 board
* Updates that let a restricted version of the interpreter run in SGX
* Enable native/app address validation and conversion for wasm app
* Remove wasm_application_exectue_* APIs from wasm_export.h which makes confused
* Refine binary size and fix several minor issues
Optimize interpreter LOAD/STORE opcodes to decrease the binary size
Fix issues when using iwasm library: _bh_log undefined, bh_memory.h not found
Remove unused _stdin/_stdout/_stderr global variables resolve in libc wrapper
Add macros of global heap size, stack size, heap size for Zephyr main.c
Clear compile warning of wasm_application.c
* Add more strict security checks for libc wrapper API's
* Use one libc wrapper copy for sgx and other platforms; remove bh_printf macro for other platform header files
* Enhance security of libc strcpy/sprintf wrapper function
* Fix issue of call native for x86_64/arm/mips, add module inst parameter for native wrapper functions
* Remove get_module_inst() and fix issue of call native
* Refine wgl lib: remove module_inst parameter from widget functions; move function index check to runtime instantiate
* Refine interpreter call native process, refine memory boudary check
* Fix issues of invokeNative function of arm/mips/general version
* Add a switch to build simple sample without gui support
* Add BUILD_TARGET setting in makefile to replace cpu compiler flags in source code
* Re-org shared lib header files, remove unused info; fix compile issues of vxworks
* Add build target general
* Remove unused files
* Update license header
* test push
* Restore file
* Sync up with internal/feature
* Sync up with internal/feature
* Rename build_wamr_app to build_wasm_app
* Fix small issues of README
* Enhance malformed wasm file checking
Fix issue of print hex int and implement utf8 string check
Fix wasi file read/write right issue
Fix minor issue of build wasm app doc
* Sync up with internal/feature
* Sync up with internal/feature: fix interpreter arm issue, fix read leb issue
* Sync up with internal/feature
* Fix bug of config.h and rename wasi config.h to ssp_config.h
* Sync up with internal/feature
* Import wamr aot
* update document
* update document
* Update document, disable WASI in 32bit
* update document
* remove files
* update document
* Update document
* update document
* update document
* update samples
* Sync up with internal repo
2020-01-21 05:26:14 +00:00
|
|
|
} FloatArithmetic;
|
|
|
|
|
2021-04-15 03:29:20 +00:00
|
|
|
static inline bool
|
|
|
|
check_type_compatible(uint8 src_type, uint8 dst_type)
|
|
|
|
{
|
2021-10-13 07:13:00 +00:00
|
|
|
if (src_type == dst_type) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ext i1 to i32 */
|
|
|
|
if (src_type == VALUE_TYPE_I1 && dst_type == VALUE_TYPE_I32) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* i32 <==> func.ref, i32 <==> extern.ref */
|
|
|
|
if (src_type == VALUE_TYPE_I32
|
|
|
|
&& (dst_type == VALUE_TYPE_EXTERNREF
|
|
|
|
|| dst_type == VALUE_TYPE_FUNCREF)) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (dst_type == VALUE_TYPE_I32
|
|
|
|
&& (src_type == VALUE_TYPE_FUNCREF
|
|
|
|
|| src_type == VALUE_TYPE_EXTERNREF)) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
2021-04-15 03:29:20 +00:00
|
|
|
}
|
|
|
|
|
2021-10-13 07:13:00 +00:00
|
|
|
#define CHECK_STACK() \
|
|
|
|
do { \
|
|
|
|
if (!func_ctx->block_stack.block_list_end) { \
|
|
|
|
aot_set_last_error("WASM block stack underflow."); \
|
|
|
|
goto fail; \
|
|
|
|
} \
|
|
|
|
if (!func_ctx->block_stack.block_list_end->value_stack \
|
|
|
|
.value_list_end) { \
|
|
|
|
aot_set_last_error("WASM data stack underflow."); \
|
|
|
|
goto fail; \
|
|
|
|
} \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
#define POP(llvm_value, value_type) \
|
|
|
|
do { \
|
|
|
|
AOTValue *aot_value; \
|
|
|
|
CHECK_STACK(); \
|
|
|
|
aot_value = aot_value_stack_pop( \
|
|
|
|
&func_ctx->block_stack.block_list_end->value_stack); \
|
|
|
|
if (!check_type_compatible(aot_value->type, value_type)) { \
|
|
|
|
aot_set_last_error("invalid WASM stack data type."); \
|
|
|
|
wasm_runtime_free(aot_value); \
|
|
|
|
goto fail; \
|
|
|
|
} \
|
|
|
|
if (aot_value->type == value_type) \
|
|
|
|
llvm_value = aot_value->value; \
|
|
|
|
else { \
|
|
|
|
if (aot_value->type == VALUE_TYPE_I1) { \
|
|
|
|
if (!(llvm_value = \
|
|
|
|
LLVMBuildZExt(comp_ctx->builder, aot_value->value, \
|
|
|
|
I32_TYPE, "i1toi32"))) { \
|
|
|
|
aot_set_last_error("invalid WASM stack " \
|
|
|
|
"data type."); \
|
|
|
|
wasm_runtime_free(aot_value); \
|
|
|
|
goto fail; \
|
|
|
|
} \
|
|
|
|
} \
|
|
|
|
else { \
|
|
|
|
bh_assert(aot_value->type == VALUE_TYPE_I32 \
|
|
|
|
|| aot_value->type == VALUE_TYPE_FUNCREF \
|
|
|
|
|| aot_value->type == VALUE_TYPE_EXTERNREF); \
|
|
|
|
bh_assert(value_type == VALUE_TYPE_I32 \
|
|
|
|
|| value_type == VALUE_TYPE_FUNCREF \
|
|
|
|
|| value_type == VALUE_TYPE_EXTERNREF); \
|
|
|
|
llvm_value = aot_value->value; \
|
|
|
|
} \
|
|
|
|
} \
|
|
|
|
wasm_runtime_free(aot_value); \
|
|
|
|
} while (0)
|
Enable AoT and wamr-sdk, and change arguments of call wasm API (#157)
* Implement memory profiler, optimize memory usage, modify code indent
* Implement memory.grow and limit heap space base offset to 1G; modify iwasm build type to Release and 64 bit by default
* Add a new extension library: connection
* Fix bug of reading magic number and version in big endian platform
* Re-org platform APIs: move most platform APIs from iwasm to shared-lib
* Enhance wasm loader to fix some security issues
* Fix issue about illegal load of EXC_RETURN into PC on stm32 board
* Updates that let a restricted version of the interpreter run in SGX
* Enable native/app address validation and conversion for wasm app
* Remove wasm_application_exectue_* APIs from wasm_export.h which makes confused
* Refine binary size and fix several minor issues
Optimize interpreter LOAD/STORE opcodes to decrease the binary size
Fix issues when using iwasm library: _bh_log undefined, bh_memory.h not found
Remove unused _stdin/_stdout/_stderr global variables resolve in libc wrapper
Add macros of global heap size, stack size, heap size for Zephyr main.c
Clear compile warning of wasm_application.c
* Add more strict security checks for libc wrapper API's
* Use one libc wrapper copy for sgx and other platforms; remove bh_printf macro for other platform header files
* Enhance security of libc strcpy/sprintf wrapper function
* Fix issue of call native for x86_64/arm/mips, add module inst parameter for native wrapper functions
* Remove get_module_inst() and fix issue of call native
* Refine wgl lib: remove module_inst parameter from widget functions; move function index check to runtime instantiate
* Refine interpreter call native process, refine memory boudary check
* Fix issues of invokeNative function of arm/mips/general version
* Add a switch to build simple sample without gui support
* Add BUILD_TARGET setting in makefile to replace cpu compiler flags in source code
* Re-org shared lib header files, remove unused info; fix compile issues of vxworks
* Add build target general
* Remove unused files
* Update license header
* test push
* Restore file
* Sync up with internal/feature
* Sync up with internal/feature
* Rename build_wamr_app to build_wasm_app
* Fix small issues of README
* Enhance malformed wasm file checking
Fix issue of print hex int and implement utf8 string check
Fix wasi file read/write right issue
Fix minor issue of build wasm app doc
* Sync up with internal/feature
* Sync up with internal/feature: fix interpreter arm issue, fix read leb issue
* Sync up with internal/feature
* Fix bug of config.h and rename wasi config.h to ssp_config.h
* Sync up with internal/feature
* Import wamr aot
* update document
* update document
* Update document, disable WASI in 32bit
* update document
* remove files
* update document
* Update document
* update document
* update document
* update samples
* Sync up with internal repo
2020-01-21 05:26:14 +00:00
|
|
|
|
|
|
|
#define POP_I32(v) POP(v, VALUE_TYPE_I32)
|
|
|
|
#define POP_I64(v) POP(v, VALUE_TYPE_I64)
|
|
|
|
#define POP_F32(v) POP(v, VALUE_TYPE_F32)
|
|
|
|
#define POP_F64(v) POP(v, VALUE_TYPE_F64)
|
2020-11-05 10:15:15 +00:00
|
|
|
#define POP_V128(v) POP(v, VALUE_TYPE_V128)
|
2021-04-15 03:29:20 +00:00
|
|
|
#define POP_FUNCREF(v) POP(v, VALUE_TYPE_FUNCREF)
|
|
|
|
#define POP_EXTERNREF(v) POP(v, VALUE_TYPE_EXTERNREF)
|
Enable AoT and wamr-sdk, and change arguments of call wasm API (#157)
* Implement memory profiler, optimize memory usage, modify code indent
* Implement memory.grow and limit heap space base offset to 1G; modify iwasm build type to Release and 64 bit by default
* Add a new extension library: connection
* Fix bug of reading magic number and version in big endian platform
* Re-org platform APIs: move most platform APIs from iwasm to shared-lib
* Enhance wasm loader to fix some security issues
* Fix issue about illegal load of EXC_RETURN into PC on stm32 board
* Updates that let a restricted version of the interpreter run in SGX
* Enable native/app address validation and conversion for wasm app
* Remove wasm_application_exectue_* APIs from wasm_export.h which makes confused
* Refine binary size and fix several minor issues
Optimize interpreter LOAD/STORE opcodes to decrease the binary size
Fix issues when using iwasm library: _bh_log undefined, bh_memory.h not found
Remove unused _stdin/_stdout/_stderr global variables resolve in libc wrapper
Add macros of global heap size, stack size, heap size for Zephyr main.c
Clear compile warning of wasm_application.c
* Add more strict security checks for libc wrapper API's
* Use one libc wrapper copy for sgx and other platforms; remove bh_printf macro for other platform header files
* Enhance security of libc strcpy/sprintf wrapper function
* Fix issue of call native for x86_64/arm/mips, add module inst parameter for native wrapper functions
* Remove get_module_inst() and fix issue of call native
* Refine wgl lib: remove module_inst parameter from widget functions; move function index check to runtime instantiate
* Refine interpreter call native process, refine memory boudary check
* Fix issues of invokeNative function of arm/mips/general version
* Add a switch to build simple sample without gui support
* Add BUILD_TARGET setting in makefile to replace cpu compiler flags in source code
* Re-org shared lib header files, remove unused info; fix compile issues of vxworks
* Add build target general
* Remove unused files
* Update license header
* test push
* Restore file
* Sync up with internal/feature
* Sync up with internal/feature
* Rename build_wamr_app to build_wasm_app
* Fix small issues of README
* Enhance malformed wasm file checking
Fix issue of print hex int and implement utf8 string check
Fix wasi file read/write right issue
Fix minor issue of build wasm app doc
* Sync up with internal/feature
* Sync up with internal/feature: fix interpreter arm issue, fix read leb issue
* Sync up with internal/feature
* Fix bug of config.h and rename wasi config.h to ssp_config.h
* Sync up with internal/feature
* Import wamr aot
* update document
* update document
* Update document, disable WASI in 32bit
* update document
* remove files
* update document
* Update document
* update document
* update document
* update samples
* Sync up with internal repo
2020-01-21 05:26:14 +00:00
|
|
|
|
2021-10-13 07:13:00 +00:00
|
|
|
#define POP_COND(llvm_value) \
|
|
|
|
do { \
|
|
|
|
AOTValue *aot_value; \
|
|
|
|
CHECK_STACK(); \
|
|
|
|
aot_value = aot_value_stack_pop( \
|
|
|
|
&func_ctx->block_stack.block_list_end->value_stack); \
|
|
|
|
if (aot_value->type != VALUE_TYPE_I1 \
|
|
|
|
&& aot_value->type != VALUE_TYPE_I32) { \
|
|
|
|
aot_set_last_error("invalid WASM stack data type."); \
|
|
|
|
wasm_runtime_free(aot_value); \
|
|
|
|
goto fail; \
|
|
|
|
} \
|
|
|
|
if (aot_value->type == VALUE_TYPE_I1) \
|
|
|
|
llvm_value = aot_value->value; \
|
|
|
|
else { \
|
|
|
|
if (!(llvm_value = \
|
|
|
|
LLVMBuildICmp(comp_ctx->builder, LLVMIntNE, \
|
|
|
|
aot_value->value, I32_ZERO, "i1_cond"))) { \
|
|
|
|
aot_set_last_error("llvm build trunc failed."); \
|
|
|
|
wasm_runtime_free(aot_value); \
|
|
|
|
goto fail; \
|
|
|
|
} \
|
|
|
|
} \
|
|
|
|
wasm_runtime_free(aot_value); \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
#define PUSH(llvm_value, value_type) \
|
|
|
|
do { \
|
|
|
|
AOTValue *aot_value; \
|
|
|
|
if (!func_ctx->block_stack.block_list_end) { \
|
|
|
|
aot_set_last_error("WASM block stack underflow."); \
|
|
|
|
goto fail; \
|
|
|
|
} \
|
|
|
|
aot_value = wasm_runtime_malloc(sizeof(AOTValue)); \
|
|
|
|
if (!aot_value) { \
|
|
|
|
aot_set_last_error("allocate memory failed."); \
|
|
|
|
goto fail; \
|
|
|
|
} \
|
|
|
|
memset(aot_value, 0, sizeof(AOTValue)); \
|
|
|
|
aot_value->type = value_type; \
|
|
|
|
aot_value->value = llvm_value; \
|
|
|
|
aot_value_stack_push( \
|
|
|
|
&func_ctx->block_stack.block_list_end->value_stack, aot_value); \
|
|
|
|
} while (0)
|
Enable AoT and wamr-sdk, and change arguments of call wasm API (#157)
* Implement memory profiler, optimize memory usage, modify code indent
* Implement memory.grow and limit heap space base offset to 1G; modify iwasm build type to Release and 64 bit by default
* Add a new extension library: connection
* Fix bug of reading magic number and version in big endian platform
* Re-org platform APIs: move most platform APIs from iwasm to shared-lib
* Enhance wasm loader to fix some security issues
* Fix issue about illegal load of EXC_RETURN into PC on stm32 board
* Updates that let a restricted version of the interpreter run in SGX
* Enable native/app address validation and conversion for wasm app
* Remove wasm_application_exectue_* APIs from wasm_export.h which makes confused
* Refine binary size and fix several minor issues
Optimize interpreter LOAD/STORE opcodes to decrease the binary size
Fix issues when using iwasm library: _bh_log undefined, bh_memory.h not found
Remove unused _stdin/_stdout/_stderr global variables resolve in libc wrapper
Add macros of global heap size, stack size, heap size for Zephyr main.c
Clear compile warning of wasm_application.c
* Add more strict security checks for libc wrapper API's
* Use one libc wrapper copy for sgx and other platforms; remove bh_printf macro for other platform header files
* Enhance security of libc strcpy/sprintf wrapper function
* Fix issue of call native for x86_64/arm/mips, add module inst parameter for native wrapper functions
* Remove get_module_inst() and fix issue of call native
* Refine wgl lib: remove module_inst parameter from widget functions; move function index check to runtime instantiate
* Refine interpreter call native process, refine memory boudary check
* Fix issues of invokeNative function of arm/mips/general version
* Add a switch to build simple sample without gui support
* Add BUILD_TARGET setting in makefile to replace cpu compiler flags in source code
* Re-org shared lib header files, remove unused info; fix compile issues of vxworks
* Add build target general
* Remove unused files
* Update license header
* test push
* Restore file
* Sync up with internal/feature
* Sync up with internal/feature
* Rename build_wamr_app to build_wasm_app
* Fix small issues of README
* Enhance malformed wasm file checking
Fix issue of print hex int and implement utf8 string check
Fix wasi file read/write right issue
Fix minor issue of build wasm app doc
* Sync up with internal/feature
* Sync up with internal/feature: fix interpreter arm issue, fix read leb issue
* Sync up with internal/feature
* Fix bug of config.h and rename wasi config.h to ssp_config.h
* Sync up with internal/feature
* Import wamr aot
* update document
* update document
* Update document, disable WASI in 32bit
* update document
* remove files
* update document
* Update document
* update document
* update document
* update samples
* Sync up with internal repo
2020-01-21 05:26:14 +00:00
|
|
|
|
|
|
|
#define PUSH_I32(v) PUSH(v, VALUE_TYPE_I32)
|
|
|
|
#define PUSH_I64(v) PUSH(v, VALUE_TYPE_I64)
|
|
|
|
#define PUSH_F32(v) PUSH(v, VALUE_TYPE_F32)
|
|
|
|
#define PUSH_F64(v) PUSH(v, VALUE_TYPE_F64)
|
2020-11-05 10:15:15 +00:00
|
|
|
#define PUSH_V128(v) PUSH(v, VALUE_TYPE_V128)
|
Enable AoT and wamr-sdk, and change arguments of call wasm API (#157)
* Implement memory profiler, optimize memory usage, modify code indent
* Implement memory.grow and limit heap space base offset to 1G; modify iwasm build type to Release and 64 bit by default
* Add a new extension library: connection
* Fix bug of reading magic number and version in big endian platform
* Re-org platform APIs: move most platform APIs from iwasm to shared-lib
* Enhance wasm loader to fix some security issues
* Fix issue about illegal load of EXC_RETURN into PC on stm32 board
* Updates that let a restricted version of the interpreter run in SGX
* Enable native/app address validation and conversion for wasm app
* Remove wasm_application_exectue_* APIs from wasm_export.h which makes confused
* Refine binary size and fix several minor issues
Optimize interpreter LOAD/STORE opcodes to decrease the binary size
Fix issues when using iwasm library: _bh_log undefined, bh_memory.h not found
Remove unused _stdin/_stdout/_stderr global variables resolve in libc wrapper
Add macros of global heap size, stack size, heap size for Zephyr main.c
Clear compile warning of wasm_application.c
* Add more strict security checks for libc wrapper API's
* Use one libc wrapper copy for sgx and other platforms; remove bh_printf macro for other platform header files
* Enhance security of libc strcpy/sprintf wrapper function
* Fix issue of call native for x86_64/arm/mips, add module inst parameter for native wrapper functions
* Remove get_module_inst() and fix issue of call native
* Refine wgl lib: remove module_inst parameter from widget functions; move function index check to runtime instantiate
* Refine interpreter call native process, refine memory boudary check
* Fix issues of invokeNative function of arm/mips/general version
* Add a switch to build simple sample without gui support
* Add BUILD_TARGET setting in makefile to replace cpu compiler flags in source code
* Re-org shared lib header files, remove unused info; fix compile issues of vxworks
* Add build target general
* Remove unused files
* Update license header
* test push
* Restore file
* Sync up with internal/feature
* Sync up with internal/feature
* Rename build_wamr_app to build_wasm_app
* Fix small issues of README
* Enhance malformed wasm file checking
Fix issue of print hex int and implement utf8 string check
Fix wasi file read/write right issue
Fix minor issue of build wasm app doc
* Sync up with internal/feature
* Sync up with internal/feature: fix interpreter arm issue, fix read leb issue
* Sync up with internal/feature
* Fix bug of config.h and rename wasi config.h to ssp_config.h
* Sync up with internal/feature
* Import wamr aot
* update document
* update document
* Update document, disable WASI in 32bit
* update document
* remove files
* update document
* Update document
* update document
* update document
* update samples
* Sync up with internal repo
2020-01-21 05:26:14 +00:00
|
|
|
#define PUSH_COND(v) PUSH(v, VALUE_TYPE_I1)
|
2021-04-15 03:29:20 +00:00
|
|
|
#define PUSH_FUNCREF(v) PUSH(v, VALUE_TYPE_FUNCREF)
|
|
|
|
#define PUSH_EXTERNREF(v) PUSH(v, VALUE_TYPE_EXTERNREF)
|
Enable AoT and wamr-sdk, and change arguments of call wasm API (#157)
* Implement memory profiler, optimize memory usage, modify code indent
* Implement memory.grow and limit heap space base offset to 1G; modify iwasm build type to Release and 64 bit by default
* Add a new extension library: connection
* Fix bug of reading magic number and version in big endian platform
* Re-org platform APIs: move most platform APIs from iwasm to shared-lib
* Enhance wasm loader to fix some security issues
* Fix issue about illegal load of EXC_RETURN into PC on stm32 board
* Updates that let a restricted version of the interpreter run in SGX
* Enable native/app address validation and conversion for wasm app
* Remove wasm_application_exectue_* APIs from wasm_export.h which makes confused
* Refine binary size and fix several minor issues
Optimize interpreter LOAD/STORE opcodes to decrease the binary size
Fix issues when using iwasm library: _bh_log undefined, bh_memory.h not found
Remove unused _stdin/_stdout/_stderr global variables resolve in libc wrapper
Add macros of global heap size, stack size, heap size for Zephyr main.c
Clear compile warning of wasm_application.c
* Add more strict security checks for libc wrapper API's
* Use one libc wrapper copy for sgx and other platforms; remove bh_printf macro for other platform header files
* Enhance security of libc strcpy/sprintf wrapper function
* Fix issue of call native for x86_64/arm/mips, add module inst parameter for native wrapper functions
* Remove get_module_inst() and fix issue of call native
* Refine wgl lib: remove module_inst parameter from widget functions; move function index check to runtime instantiate
* Refine interpreter call native process, refine memory boudary check
* Fix issues of invokeNative function of arm/mips/general version
* Add a switch to build simple sample without gui support
* Add BUILD_TARGET setting in makefile to replace cpu compiler flags in source code
* Re-org shared lib header files, remove unused info; fix compile issues of vxworks
* Add build target general
* Remove unused files
* Update license header
* test push
* Restore file
* Sync up with internal/feature
* Sync up with internal/feature
* Rename build_wamr_app to build_wasm_app
* Fix small issues of README
* Enhance malformed wasm file checking
Fix issue of print hex int and implement utf8 string check
Fix wasi file read/write right issue
Fix minor issue of build wasm app doc
* Sync up with internal/feature
* Sync up with internal/feature: fix interpreter arm issue, fix read leb issue
* Sync up with internal/feature
* Fix bug of config.h and rename wasi config.h to ssp_config.h
* Sync up with internal/feature
* Import wamr aot
* update document
* update document
* Update document, disable WASI in 32bit
* update document
* remove files
* update document
* Update document
* update document
* update document
* update samples
* Sync up with internal repo
2020-01-21 05:26:14 +00:00
|
|
|
|
|
|
|
#define TO_LLVM_TYPE(wasm_type) \
|
|
|
|
wasm_type_to_llvm_type(&comp_ctx->basic_types, wasm_type)
|
|
|
|
|
|
|
|
#define I32_TYPE comp_ctx->basic_types.int32_type
|
|
|
|
#define I64_TYPE comp_ctx->basic_types.int64_type
|
|
|
|
#define F32_TYPE comp_ctx->basic_types.float32_type
|
|
|
|
#define F64_TYPE comp_ctx->basic_types.float64_type
|
|
|
|
#define VOID_TYPE comp_ctx->basic_types.void_type
|
|
|
|
#define INT1_TYPE comp_ctx->basic_types.int1_type
|
|
|
|
#define INT8_TYPE comp_ctx->basic_types.int8_type
|
|
|
|
#define INT16_TYPE comp_ctx->basic_types.int16_type
|
|
|
|
#define MD_TYPE comp_ctx->basic_types.meta_data_type
|
|
|
|
#define INT8_PTR_TYPE comp_ctx->basic_types.int8_ptr_type
|
|
|
|
#define INT16_PTR_TYPE comp_ctx->basic_types.int16_ptr_type
|
|
|
|
#define INT32_PTR_TYPE comp_ctx->basic_types.int32_ptr_type
|
|
|
|
#define INT64_PTR_TYPE comp_ctx->basic_types.int64_ptr_type
|
|
|
|
#define F32_PTR_TYPE comp_ctx->basic_types.float32_ptr_type
|
|
|
|
#define F64_PTR_TYPE comp_ctx->basic_types.float64_ptr_type
|
2021-04-15 03:29:20 +00:00
|
|
|
#define FUNC_REF_TYPE comp_ctx->basic_types.funcref_type
|
|
|
|
#define EXTERN_REF_TYPE comp_ctx->basic_types.externref_type
|
Enable AoT and wamr-sdk, and change arguments of call wasm API (#157)
* Implement memory profiler, optimize memory usage, modify code indent
* Implement memory.grow and limit heap space base offset to 1G; modify iwasm build type to Release and 64 bit by default
* Add a new extension library: connection
* Fix bug of reading magic number and version in big endian platform
* Re-org platform APIs: move most platform APIs from iwasm to shared-lib
* Enhance wasm loader to fix some security issues
* Fix issue about illegal load of EXC_RETURN into PC on stm32 board
* Updates that let a restricted version of the interpreter run in SGX
* Enable native/app address validation and conversion for wasm app
* Remove wasm_application_exectue_* APIs from wasm_export.h which makes confused
* Refine binary size and fix several minor issues
Optimize interpreter LOAD/STORE opcodes to decrease the binary size
Fix issues when using iwasm library: _bh_log undefined, bh_memory.h not found
Remove unused _stdin/_stdout/_stderr global variables resolve in libc wrapper
Add macros of global heap size, stack size, heap size for Zephyr main.c
Clear compile warning of wasm_application.c
* Add more strict security checks for libc wrapper API's
* Use one libc wrapper copy for sgx and other platforms; remove bh_printf macro for other platform header files
* Enhance security of libc strcpy/sprintf wrapper function
* Fix issue of call native for x86_64/arm/mips, add module inst parameter for native wrapper functions
* Remove get_module_inst() and fix issue of call native
* Refine wgl lib: remove module_inst parameter from widget functions; move function index check to runtime instantiate
* Refine interpreter call native process, refine memory boudary check
* Fix issues of invokeNative function of arm/mips/general version
* Add a switch to build simple sample without gui support
* Add BUILD_TARGET setting in makefile to replace cpu compiler flags in source code
* Re-org shared lib header files, remove unused info; fix compile issues of vxworks
* Add build target general
* Remove unused files
* Update license header
* test push
* Restore file
* Sync up with internal/feature
* Sync up with internal/feature
* Rename build_wamr_app to build_wasm_app
* Fix small issues of README
* Enhance malformed wasm file checking
Fix issue of print hex int and implement utf8 string check
Fix wasi file read/write right issue
Fix minor issue of build wasm app doc
* Sync up with internal/feature
* Sync up with internal/feature: fix interpreter arm issue, fix read leb issue
* Sync up with internal/feature
* Fix bug of config.h and rename wasi config.h to ssp_config.h
* Sync up with internal/feature
* Import wamr aot
* update document
* update document
* Update document, disable WASI in 32bit
* update document
* remove files
* update document
* Update document
* update document
* update document
* update samples
* Sync up with internal repo
2020-01-21 05:26:14 +00:00
|
|
|
|
|
|
|
#define I32_CONST(v) LLVMConstInt(I32_TYPE, v, true)
|
|
|
|
#define I64_CONST(v) LLVMConstInt(I64_TYPE, v, true)
|
|
|
|
#define F32_CONST(v) LLVMConstReal(F32_TYPE, v)
|
|
|
|
#define F64_CONST(v) LLVMConstReal(F64_TYPE, v)
|
|
|
|
#define I8_CONST(v) LLVMConstInt(INT8_TYPE, v, true)
|
|
|
|
|
2021-09-17 11:12:57 +00:00
|
|
|
#define LLVM_CONST(name) (comp_ctx->llvm_consts.name)
|
2021-10-13 07:13:00 +00:00
|
|
|
#define I8_ZERO LLVM_CONST(i8_zero)
|
|
|
|
#define I32_ZERO LLVM_CONST(i32_zero)
|
|
|
|
#define I64_ZERO LLVM_CONST(i64_zero)
|
|
|
|
#define F32_ZERO LLVM_CONST(f32_zero)
|
|
|
|
#define F64_ZERO LLVM_CONST(f64_zero)
|
|
|
|
#define I32_ONE LLVM_CONST(i32_one)
|
|
|
|
#define I32_TWO LLVM_CONST(i32_two)
|
|
|
|
#define I32_THREE LLVM_CONST(i32_three)
|
|
|
|
#define I32_FOUR LLVM_CONST(i32_four)
|
|
|
|
#define I32_FIVE LLVM_CONST(i32_five)
|
|
|
|
#define I32_SIX LLVM_CONST(i32_six)
|
|
|
|
#define I32_SEVEN LLVM_CONST(i32_seven)
|
|
|
|
#define I32_EIGHT LLVM_CONST(i32_eight)
|
2021-09-17 11:12:57 +00:00
|
|
|
#define I32_NEG_ONE LLVM_CONST(i32_neg_one)
|
|
|
|
#define I64_NEG_ONE LLVM_CONST(i64_neg_one)
|
2021-10-13 07:13:00 +00:00
|
|
|
#define I32_MIN LLVM_CONST(i32_min)
|
|
|
|
#define I64_MIN LLVM_CONST(i64_min)
|
|
|
|
#define I32_31 LLVM_CONST(i32_31)
|
|
|
|
#define I32_32 LLVM_CONST(i32_32)
|
|
|
|
#define I64_63 LLVM_CONST(i64_63)
|
|
|
|
#define I64_64 LLVM_CONST(i64_64)
|
|
|
|
#define REF_NULL I32_NEG_ONE
|
|
|
|
|
|
|
|
#define V128_TYPE comp_ctx->basic_types.v128_type
|
|
|
|
#define V128_PTR_TYPE comp_ctx->basic_types.v128_ptr_type
|
2020-11-05 10:15:15 +00:00
|
|
|
#define V128_i8x16_TYPE comp_ctx->basic_types.i8x16_vec_type
|
|
|
|
#define V128_i16x8_TYPE comp_ctx->basic_types.i16x8_vec_type
|
|
|
|
#define V128_i32x4_TYPE comp_ctx->basic_types.i32x4_vec_type
|
|
|
|
#define V128_i64x2_TYPE comp_ctx->basic_types.i64x2_vec_type
|
|
|
|
#define V128_f32x4_TYPE comp_ctx->basic_types.f32x4_vec_type
|
|
|
|
#define V128_f64x2_TYPE comp_ctx->basic_types.f64x2_vec_type
|
|
|
|
|
2021-09-17 11:12:57 +00:00
|
|
|
#define V128_i8x16_ZERO LLVM_CONST(i8x16_vec_zero)
|
|
|
|
#define V128_i16x8_ZERO LLVM_CONST(i16x8_vec_zero)
|
|
|
|
#define V128_i32x4_ZERO LLVM_CONST(i32x4_vec_zero)
|
|
|
|
#define V128_i64x2_ZERO LLVM_CONST(i64x2_vec_zero)
|
|
|
|
#define V128_f32x4_ZERO LLVM_CONST(f32x4_vec_zero)
|
|
|
|
#define V128_f64x2_ZERO LLVM_CONST(f64x2_vec_zero)
|
2021-04-15 03:29:20 +00:00
|
|
|
|
2021-10-13 07:13:00 +00:00
|
|
|
#define TO_V128_i8x16(v) \
|
|
|
|
LLVMBuildBitCast(comp_ctx->builder, v, V128_i8x16_TYPE, "i8x16_val")
|
|
|
|
#define TO_V128_i16x8(v) \
|
|
|
|
LLVMBuildBitCast(comp_ctx->builder, v, V128_i16x8_TYPE, "i16x8_val")
|
|
|
|
#define TO_V128_i32x4(v) \
|
|
|
|
LLVMBuildBitCast(comp_ctx->builder, v, V128_i32x4_TYPE, "i32x4_val")
|
|
|
|
#define TO_V128_i64x2(v) \
|
|
|
|
LLVMBuildBitCast(comp_ctx->builder, v, V128_i64x2_TYPE, "i64x2_val")
|
|
|
|
#define TO_V128_f32x4(v) \
|
|
|
|
LLVMBuildBitCast(comp_ctx->builder, v, V128_f32x4_TYPE, "f32x4_val")
|
|
|
|
#define TO_V128_f64x2(v) \
|
|
|
|
LLVMBuildBitCast(comp_ctx->builder, v, V128_f64x2_TYPE, "f64x2_val")
|
|
|
|
|
|
|
|
#define CHECK_LLVM_CONST(v) \
|
|
|
|
do { \
|
|
|
|
if (!v) { \
|
|
|
|
aot_set_last_error("create llvm const failed."); \
|
|
|
|
goto fail; \
|
|
|
|
} \
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
#define GET_AOT_FUNCTION(name, argc) \
|
|
|
|
do { \
|
|
|
|
if (!(func_type = \
|
|
|
|
LLVMFunctionType(ret_type, param_types, argc, false))) { \
|
|
|
|
aot_set_last_error("llvm add function type failed."); \
|
2021-12-10 10:13:17 +00:00
|
|
|
goto fail; \
|
2021-10-13 07:13:00 +00:00
|
|
|
} \
|
|
|
|
if (comp_ctx->is_jit_mode) { \
|
|
|
|
/* JIT mode, call the function directly */ \
|
|
|
|
if (!(func_ptr_type = LLVMPointerType(func_type, 0))) { \
|
|
|
|
aot_set_last_error("llvm add pointer type failed."); \
|
2021-12-10 10:13:17 +00:00
|
|
|
goto fail; \
|
2021-10-13 07:13:00 +00:00
|
|
|
} \
|
|
|
|
if (!(value = I64_CONST((uint64)(uintptr_t)name)) \
|
|
|
|
|| !(func = LLVMConstIntToPtr(value, func_ptr_type))) { \
|
|
|
|
aot_set_last_error("create LLVM value failed."); \
|
2021-12-10 10:13:17 +00:00
|
|
|
goto fail; \
|
2021-10-13 07:13:00 +00:00
|
|
|
} \
|
|
|
|
} \
|
2021-11-11 06:14:21 +00:00
|
|
|
else if (comp_ctx->is_indirect_mode) { \
|
|
|
|
int32 func_index; \
|
|
|
|
if (!(func_ptr_type = LLVMPointerType(func_type, 0))) { \
|
|
|
|
aot_set_last_error("create LLVM function type failed."); \
|
2021-12-10 10:13:17 +00:00
|
|
|
goto fail; \
|
2021-11-11 06:14:21 +00:00
|
|
|
} \
|
|
|
|
\
|
|
|
|
func_index = aot_get_native_symbol_index(comp_ctx, #name); \
|
|
|
|
if (func_index < 0) { \
|
2021-12-10 10:13:17 +00:00
|
|
|
goto fail; \
|
2021-11-11 06:14:21 +00:00
|
|
|
} \
|
|
|
|
if (!(func = aot_get_func_from_table( \
|
|
|
|
comp_ctx, func_ctx->native_symbol, func_ptr_type, \
|
|
|
|
func_index))) { \
|
2021-12-10 10:13:17 +00:00
|
|
|
goto fail; \
|
2021-11-11 06:14:21 +00:00
|
|
|
} \
|
|
|
|
} \
|
2021-10-13 07:13:00 +00:00
|
|
|
else { \
|
|
|
|
char *func_name = #name; \
|
|
|
|
/* AOT mode, delcare the function */ \
|
2022-01-20 10:40:13 +00:00
|
|
|
if (!(func = LLVMGetNamedFunction(func_ctx->module, func_name)) \
|
|
|
|
&& !(func = LLVMAddFunction(func_ctx->module, func_name, \
|
2021-10-13 07:13:00 +00:00
|
|
|
func_type))) { \
|
|
|
|
aot_set_last_error("llvm add function failed."); \
|
2021-12-10 10:13:17 +00:00
|
|
|
goto fail; \
|
2021-10-13 07:13:00 +00:00
|
|
|
} \
|
|
|
|
} \
|
|
|
|
} while (0)
|
2021-04-15 03:29:20 +00:00
|
|
|
|
Enable AoT and wamr-sdk, and change arguments of call wasm API (#157)
* Implement memory profiler, optimize memory usage, modify code indent
* Implement memory.grow and limit heap space base offset to 1G; modify iwasm build type to Release and 64 bit by default
* Add a new extension library: connection
* Fix bug of reading magic number and version in big endian platform
* Re-org platform APIs: move most platform APIs from iwasm to shared-lib
* Enhance wasm loader to fix some security issues
* Fix issue about illegal load of EXC_RETURN into PC on stm32 board
* Updates that let a restricted version of the interpreter run in SGX
* Enable native/app address validation and conversion for wasm app
* Remove wasm_application_exectue_* APIs from wasm_export.h which makes confused
* Refine binary size and fix several minor issues
Optimize interpreter LOAD/STORE opcodes to decrease the binary size
Fix issues when using iwasm library: _bh_log undefined, bh_memory.h not found
Remove unused _stdin/_stdout/_stderr global variables resolve in libc wrapper
Add macros of global heap size, stack size, heap size for Zephyr main.c
Clear compile warning of wasm_application.c
* Add more strict security checks for libc wrapper API's
* Use one libc wrapper copy for sgx and other platforms; remove bh_printf macro for other platform header files
* Enhance security of libc strcpy/sprintf wrapper function
* Fix issue of call native for x86_64/arm/mips, add module inst parameter for native wrapper functions
* Remove get_module_inst() and fix issue of call native
* Refine wgl lib: remove module_inst parameter from widget functions; move function index check to runtime instantiate
* Refine interpreter call native process, refine memory boudary check
* Fix issues of invokeNative function of arm/mips/general version
* Add a switch to build simple sample without gui support
* Add BUILD_TARGET setting in makefile to replace cpu compiler flags in source code
* Re-org shared lib header files, remove unused info; fix compile issues of vxworks
* Add build target general
* Remove unused files
* Update license header
* test push
* Restore file
* Sync up with internal/feature
* Sync up with internal/feature
* Rename build_wamr_app to build_wasm_app
* Fix small issues of README
* Enhance malformed wasm file checking
Fix issue of print hex int and implement utf8 string check
Fix wasi file read/write right issue
Fix minor issue of build wasm app doc
* Sync up with internal/feature
* Sync up with internal/feature: fix interpreter arm issue, fix read leb issue
* Sync up with internal/feature
* Fix bug of config.h and rename wasi config.h to ssp_config.h
* Sync up with internal/feature
* Import wamr aot
* update document
* update document
* Update document, disable WASI in 32bit
* update document
* remove files
* update document
* Update document
* update document
* update document
* update samples
* Sync up with internal repo
2020-01-21 05:26:14 +00:00
|
|
|
bool
|
|
|
|
aot_compile_wasm(AOTCompContext *comp_ctx);
|
|
|
|
|
|
|
|
bool
|
|
|
|
aot_emit_llvm_file(AOTCompContext *comp_ctx, const char *file_name);
|
|
|
|
|
|
|
|
bool
|
2021-10-13 07:13:00 +00:00
|
|
|
aot_emit_aot_file(AOTCompContext *comp_ctx, AOTCompData *comp_data,
|
Enable AoT and wamr-sdk, and change arguments of call wasm API (#157)
* Implement memory profiler, optimize memory usage, modify code indent
* Implement memory.grow and limit heap space base offset to 1G; modify iwasm build type to Release and 64 bit by default
* Add a new extension library: connection
* Fix bug of reading magic number and version in big endian platform
* Re-org platform APIs: move most platform APIs from iwasm to shared-lib
* Enhance wasm loader to fix some security issues
* Fix issue about illegal load of EXC_RETURN into PC on stm32 board
* Updates that let a restricted version of the interpreter run in SGX
* Enable native/app address validation and conversion for wasm app
* Remove wasm_application_exectue_* APIs from wasm_export.h which makes confused
* Refine binary size and fix several minor issues
Optimize interpreter LOAD/STORE opcodes to decrease the binary size
Fix issues when using iwasm library: _bh_log undefined, bh_memory.h not found
Remove unused _stdin/_stdout/_stderr global variables resolve in libc wrapper
Add macros of global heap size, stack size, heap size for Zephyr main.c
Clear compile warning of wasm_application.c
* Add more strict security checks for libc wrapper API's
* Use one libc wrapper copy for sgx and other platforms; remove bh_printf macro for other platform header files
* Enhance security of libc strcpy/sprintf wrapper function
* Fix issue of call native for x86_64/arm/mips, add module inst parameter for native wrapper functions
* Remove get_module_inst() and fix issue of call native
* Refine wgl lib: remove module_inst parameter from widget functions; move function index check to runtime instantiate
* Refine interpreter call native process, refine memory boudary check
* Fix issues of invokeNative function of arm/mips/general version
* Add a switch to build simple sample without gui support
* Add BUILD_TARGET setting in makefile to replace cpu compiler flags in source code
* Re-org shared lib header files, remove unused info; fix compile issues of vxworks
* Add build target general
* Remove unused files
* Update license header
* test push
* Restore file
* Sync up with internal/feature
* Sync up with internal/feature
* Rename build_wamr_app to build_wasm_app
* Fix small issues of README
* Enhance malformed wasm file checking
Fix issue of print hex int and implement utf8 string check
Fix wasi file read/write right issue
Fix minor issue of build wasm app doc
* Sync up with internal/feature
* Sync up with internal/feature: fix interpreter arm issue, fix read leb issue
* Sync up with internal/feature
* Fix bug of config.h and rename wasi config.h to ssp_config.h
* Sync up with internal/feature
* Import wamr aot
* update document
* update document
* Update document, disable WASI in 32bit
* update document
* remove files
* update document
* Update document
* update document
* update document
* update samples
* Sync up with internal repo
2020-01-21 05:26:14 +00:00
|
|
|
const char *file_name);
|
|
|
|
|
2021-10-13 07:13:00 +00:00
|
|
|
uint8 *
|
|
|
|
aot_emit_aot_file_buf(AOTCompContext *comp_ctx, AOTCompData *comp_data,
|
2021-07-06 09:05:59 +00:00
|
|
|
uint32 *p_aot_file_size);
|
2021-05-26 12:57:30 +00:00
|
|
|
|
Enable AoT and wamr-sdk, and change arguments of call wasm API (#157)
* Implement memory profiler, optimize memory usage, modify code indent
* Implement memory.grow and limit heap space base offset to 1G; modify iwasm build type to Release and 64 bit by default
* Add a new extension library: connection
* Fix bug of reading magic number and version in big endian platform
* Re-org platform APIs: move most platform APIs from iwasm to shared-lib
* Enhance wasm loader to fix some security issues
* Fix issue about illegal load of EXC_RETURN into PC on stm32 board
* Updates that let a restricted version of the interpreter run in SGX
* Enable native/app address validation and conversion for wasm app
* Remove wasm_application_exectue_* APIs from wasm_export.h which makes confused
* Refine binary size and fix several minor issues
Optimize interpreter LOAD/STORE opcodes to decrease the binary size
Fix issues when using iwasm library: _bh_log undefined, bh_memory.h not found
Remove unused _stdin/_stdout/_stderr global variables resolve in libc wrapper
Add macros of global heap size, stack size, heap size for Zephyr main.c
Clear compile warning of wasm_application.c
* Add more strict security checks for libc wrapper API's
* Use one libc wrapper copy for sgx and other platforms; remove bh_printf macro for other platform header files
* Enhance security of libc strcpy/sprintf wrapper function
* Fix issue of call native for x86_64/arm/mips, add module inst parameter for native wrapper functions
* Remove get_module_inst() and fix issue of call native
* Refine wgl lib: remove module_inst parameter from widget functions; move function index check to runtime instantiate
* Refine interpreter call native process, refine memory boudary check
* Fix issues of invokeNative function of arm/mips/general version
* Add a switch to build simple sample without gui support
* Add BUILD_TARGET setting in makefile to replace cpu compiler flags in source code
* Re-org shared lib header files, remove unused info; fix compile issues of vxworks
* Add build target general
* Remove unused files
* Update license header
* test push
* Restore file
* Sync up with internal/feature
* Sync up with internal/feature
* Rename build_wamr_app to build_wasm_app
* Fix small issues of README
* Enhance malformed wasm file checking
Fix issue of print hex int and implement utf8 string check
Fix wasi file read/write right issue
Fix minor issue of build wasm app doc
* Sync up with internal/feature
* Sync up with internal/feature: fix interpreter arm issue, fix read leb issue
* Sync up with internal/feature
* Fix bug of config.h and rename wasi config.h to ssp_config.h
* Sync up with internal/feature
* Import wamr aot
* update document
* update document
* Update document, disable WASI in 32bit
* update document
* remove files
* update document
* Update document
* update document
* update document
* update samples
* Sync up with internal repo
2020-01-21 05:26:14 +00:00
|
|
|
bool
|
|
|
|
aot_emit_object_file(AOTCompContext *comp_ctx, char *file_name);
|
|
|
|
|
2022-06-20 05:13:41 +00:00
|
|
|
char *
|
|
|
|
aot_generate_tempfile_name(const char *prefix, const char *extension,
|
|
|
|
char *buffer, uint32 len);
|
|
|
|
|
Enable AoT and wamr-sdk, and change arguments of call wasm API (#157)
* Implement memory profiler, optimize memory usage, modify code indent
* Implement memory.grow and limit heap space base offset to 1G; modify iwasm build type to Release and 64 bit by default
* Add a new extension library: connection
* Fix bug of reading magic number and version in big endian platform
* Re-org platform APIs: move most platform APIs from iwasm to shared-lib
* Enhance wasm loader to fix some security issues
* Fix issue about illegal load of EXC_RETURN into PC on stm32 board
* Updates that let a restricted version of the interpreter run in SGX
* Enable native/app address validation and conversion for wasm app
* Remove wasm_application_exectue_* APIs from wasm_export.h which makes confused
* Refine binary size and fix several minor issues
Optimize interpreter LOAD/STORE opcodes to decrease the binary size
Fix issues when using iwasm library: _bh_log undefined, bh_memory.h not found
Remove unused _stdin/_stdout/_stderr global variables resolve in libc wrapper
Add macros of global heap size, stack size, heap size for Zephyr main.c
Clear compile warning of wasm_application.c
* Add more strict security checks for libc wrapper API's
* Use one libc wrapper copy for sgx and other platforms; remove bh_printf macro for other platform header files
* Enhance security of libc strcpy/sprintf wrapper function
* Fix issue of call native for x86_64/arm/mips, add module inst parameter for native wrapper functions
* Remove get_module_inst() and fix issue of call native
* Refine wgl lib: remove module_inst parameter from widget functions; move function index check to runtime instantiate
* Refine interpreter call native process, refine memory boudary check
* Fix issues of invokeNative function of arm/mips/general version
* Add a switch to build simple sample without gui support
* Add BUILD_TARGET setting in makefile to replace cpu compiler flags in source code
* Re-org shared lib header files, remove unused info; fix compile issues of vxworks
* Add build target general
* Remove unused files
* Update license header
* test push
* Restore file
* Sync up with internal/feature
* Sync up with internal/feature
* Rename build_wamr_app to build_wasm_app
* Fix small issues of README
* Enhance malformed wasm file checking
Fix issue of print hex int and implement utf8 string check
Fix wasi file read/write right issue
Fix minor issue of build wasm app doc
* Sync up with internal/feature
* Sync up with internal/feature: fix interpreter arm issue, fix read leb issue
* Sync up with internal/feature
* Fix bug of config.h and rename wasi config.h to ssp_config.h
* Sync up with internal/feature
* Import wamr aot
* update document
* update document
* Update document, disable WASI in 32bit
* update document
* remove files
* update document
* Update document
* update document
* update document
* update samples
* Sync up with internal repo
2020-01-21 05:26:14 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
} /* end of extern "C" */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* end of _AOT_COMPILER_H_ */
|