0.9.0 (unreleased)
Breaking changes:
- For better performance, the Statistics module is disabled by default.
- To enable instruction counting, please use
--enable-instruction-count
. - To enable gas measuring, please use
--enable-gas-measuring
. - To enable time measuring, please use
--enable-time-measuring
. - For the convinence, use
--enable-all-statistics
will enable all available statistics options.
- To enable instruction counting, please use
wasmedgec
AOT compiler tool behavior changes.- For the output file name with extension
.so
,wasmedgec
will output the AOT compiled WASM in shared library format. - For the output file name with extension
.wasm
or other cases,wasmedgec
will output the WASM file with adding the AOT compiled binary in custom sections.wasmedge
runtime will run in AOT mode when it executes the output WASM file.
- For the output file name with extension
- Modulized the API Headers.
- Moved the API header into the
wasmedge
folder. Developers should include thewasmedge/wasmedge.h
for using the WasmEdge shared library after installation. - Moved the enumeration definitions into
enum_errcode.h
,enum_types.h
, andenum_configure.h
in thewasmedge
folder. - Added the
201402L
C++ standard checking if developer includes the headers with a C++ compiler.
- Moved the API header into the
- Adjusted the error code names.
- Please refer to the ErrCode enum definition.
- Renamed the
Interpreter
intoExecutor
.- Renamed the
Interpreter
namespace intoExecutor
. - Moved the headers and sources in the
Interpreter
folder intoExecutor
folder. - Renamed the
Interpreter
APIs and listed below.
- Renamed the
- WasmEdge C API changes.
- Updated the host function related APIs.
- Deleted the data object column in the creation function of
ImportObject
context. - Merged the
HostFunctionContext
intoFunctionInstanceContext
.- Deleted the
WasmEdge_HostFunctionContext
object. Please use theWasmEdge_FunctionInstanceContext
object instead. - Deleted the
WasmEdge_HostFunctionCreate
function. Please use theWasmEdge_FunctionInstanceCreate
function instead. - Deleted the
WasmEdge_HostFunctionCreateBinding
function. Please use theWasmEdge_FunctionInstanceCreateBinding
function instead. - Deleted the
WasmEdge_HostFunctionDelete
function. Please use theWasmEdge_FunctionInstanceDelete
function instead. - Deleted the
WasmEdge_ImportObjectAddHostFunction
function. Please use theWasmEdge_ImportObjectAddFunction
function instead.
- Deleted the
- Added the data object column in the creation function of
FunctionInstance
context. - Instead of the unified data object of the host functions in the same import object before, the data objects are independent in every host function now.
- Deleted the data object column in the creation function of
- Added the WASM types contexts.
- Added the
WasmEdge_TableTypeContext
, which is used for table instances creation. - Added the
WasmEdge_MemoryTypeContext
, which is used for memory instances creation. - Added the
WasmEdge_GlobalTypeContext
, which is used for global instances creation. - Added the member getter functions of the above contexts.
- Added the
- Updated the instances creation APIs.
- Used
WasmEdge_TableTypeContext
for table instances creation.- Removed
WasmEdge_TableInstanceGetRefType
API. - Developers can use the
WasmEdge_TableInstanceGetTableType
API to get the table type instead.
- Removed
- Used
WasmEdge_MemoryTypeContext
for memory instances creation.- Added
WasmEdge_MemoryInstanceGetMemoryType
API.
- Added
- Used
WasmEdge_GlobalTypeContext
for global instances creation.- Removed
WasmEdge_GlobalInstanceGetValType
andWasmEdge_GlobalInstanceGetMutability
API. - Developers can use the
WasmEdge_GlobalInstanceGetGlobalType
API to get the global type instead.
- Removed
- Used
- Refactored for the objects' life cycle to reduce copying.
- Developers should NOT destroy the
WasmEdge_FunctionTypeContext
objects returned fromWasmEdge_VMGetFunctionList
,WasmEdge_VMGetFunctionType
, andWasmEdge_VMGetFunctionTypeRegistered
functions. - Developers should NOT destroy the
WasmEdge_String
objects returned fromWasmEdge_StoreListFunction
,WasmEdge_StoreListFunctionRegistered
,WasmEdge_StoreListTable
,WasmEdge_StoreListTableRegistered
,WasmEdge_StoreListMemory
,WasmEdge_StoreListMemoryRegistered
,WasmEdge_StoreListGlobal
,WasmEdge_StoreListGlobalRegistered
,WasmEdge_StoreListModule
, andWasmEdge_VMGetFunctionList
functions.
- Developers should NOT destroy the
- Renamed the
Interpreter
related APIs.- Replaced
WasmEdge_InterpreterContext
struct withWasmEdge_ExecutorContext
struct. - Replaced
WasmEdge_InterpreterCreate
function withWasmEdge_ExecutorCreate
function. - Replaced
WasmEdge_InterpreterInstantiate
function withWasmEdge_ExecutorInstantiate
function. - Replaced
WasmEdge_InterpreterRegisterImport
function withWasmEdge_ExecutorRegisterImport
function. - Replaced
WasmEdge_InterpreterRegisterModule
function withWasmEdge_ExecutorRegisterModule
function. - Replaced
WasmEdge_InterpreterInvoke
function withWasmEdge_ExecutorInvoke
function. - Replaced
WasmEdge_InterpreterInvokeRegistered
function withWasmEdge_ExecutorInvokeRegistered
function. - Replaced
WasmEdge_InterpreterDelete
function withWasmEdge_ExecutorDelete
function.
- Replaced
- Refactored for statistics options
- Renamed
WasmEdge_ConfigureCompilerSetInstructionCounting
toWasmEdge_ConfigureStatisticsSetInstructionCounting
. - Renamed
WasmEdge_ConfigureCompilerSetCostMeasuring
toWasmEdge_ConfigureStatisticsSetCostMeasuring
. - Renamed
WasmEdge_ConfigureCompilerSetTimeMeasuring
toWasmEdge_ConfigureStatisticsSetTimeMeasuring
. - Renamed
WasmEdge_ConfigureCompilerGetInstructionCounting
toWasmEdge_ConfigureStatisticsGetInstructionCounting
. - Renamed
WasmEdge_ConfigureCompilerGetCostMeasuring
toWasmEdge_ConfigureStatisticsGetCostMeasuring
. - Renamed
WasmEdge_ConfigureCompilerGetTimeMeasuring
toWasmEdge_ConfigureStatisticsGetTimeMeasuring
.
- Renamed
- Updated the host function related APIs.
Features:
- Applied the old WebAssembly proposals options (All turned on by default).
- Developers can use the
disable-import-export-mut-globals
to disable the Import/Export mutable globals proposal inwasmedge
andwasmedgec
. - Developers can use the
disable-non-trap-float-to-int
to disable the Non-trapping float-to-int conversions proposal inwasmedge
andwasmedgec
. - Developers can use the
disable-sign-extension-operators
to disable the Sign-extension operators proposal inwasmedge
andwasmedgec
. - Developers can use the
disable-multi-value
to disable the Multi-value proposal inwasmedge
andwasmedgec
.
- Developers can use the
- New WasmEdge C API for listing imports and exports from AST module contexts.
- Developers can query the
ImportTypeContext
andExportTypeContext
from theASTModuleContext
. - New object
WasmEdge_ImportTypeContext
. - New object
WasmEdge_ExportTypeContext
. - New AST module context functions to query the import and export types.
WasmEdge_ASTModuleListImportsLength
function can query the imports list length from an AST module context.WasmEdge_ASTModuleListExportsLength
function can query the exports list length from an AST module context.WasmEdge_ASTModuleListImports
function can list all import types of an AST module context.WasmEdge_ASTModuleListExports
function can list all export types of an AST module context.
- New import type context functions to query data.
WasmEdge_ImportTypeGetExternalType
function can get the external type of an import type context.WasmEdge_ImportTypeGetModuleName
function can get the import module name.WasmEdge_ImportTypeGetExternalName
function can get the import external name.WasmEdge_ImportTypeGetFunctionType
function can get the function type of an import type context.WasmEdge_ImportTypeGetTableType
function can get the table type of an import type context.WasmEdge_ImportTypeGetMemoryType
function can get the memory type of an import type context.WasmEdge_ImportTypeGetGlobalType
function can get the global type of an import type context.
- New export type context functions to query data.
WasmEdge_ExportTypeGetExternalType
function can get the external type of an export type context.WasmEdge_ExportTypeGetExternalName
function can get the export external name.WasmEdge_ExportTypeGetFunctionType
function can get the function type of an export type context.WasmEdge_ExportTypeGetTableType
function can get the table type of an export type context.WasmEdge_ExportTypeGetMemoryType
function can get the memory type of an export type context.WasmEdge_ExportTypeGetGlobalType
function can get the global type of an export type context.
- For more details of the usages of imports and exports, please refer to the C API documentation.
- Developers can query the
- Exported the WasmEdge C API for AOT compiler related configurations.
WasmEdge_ConfigureCompilerSetOutputFormat
function can set the AOT compiler output format.WasmEdge_ConfigureCompilerGetOutputFormat
function can get the AOT compiler output format.WasmEdge_ConfigureCompilerSetGenericBinary
function can set the option of AOT compiler generic binary output.WasmEdge_ConfigureCompilerIsGenericBinary
function can get the option of AOT compiler generic binary output.
- Provided install and uninstall script for installing/uninstalling WasmEdge on linux(amd64 and aarch64) and macos(amd64 and arm64).
- Supported compiling WebAssembly into a new WebAssembly file with a packed binary section.
Fixed issues:
- Refined the WasmEdge C API behaviors.
- Handle the edge cases of
WasmEdge_String
creation.
- Handle the edge cases of
- Fixed the instruction iteration exception in interpreter mode.
- Forcely added the capacity of instruction vector to prevent from connection of instruction vectors in different function instances.
- Fixed the loader of AOT mode WASM.
- Checked the file header instead of file name extension when loading from file.
- Showed the error message when loading AOT compiled WASM from buffer. For AOT mode, please use the universal WASM binary.
- Fixed the zero address used in AOT mode in load manager.
- Fixed the loading failed for the AOT compiled WASM without intrinsics table.
- Fixed the
VM
creation issue.- Added the loss of intrinsics table setting when creating a VM instance.
- Fixed wasi-socket support on macos.
Refactor:
- Refined headers inclusion in all files.
- Refactor the common headers.
- Removed the unnecessary
genNullRef()
. - Merged the building environment-related definitions into
common
. - Merged the
common/values.h
intocommon/types.h
. - Separated all enumeration definitions.
- Removed the unnecessary
- Refactored the AST nodes.
- Simplified the AST nodes definitions into header-only classes.
- Moved the binary loading functions into
loader
. - Updated the
validator
,executor
,runtime
,api
, andvm
for the AST node changes.
- Refactored the runtime objects.
- Used
AST::FunctionType
,AST::TableType
,AST::MemoryType
, andAST::GlobalType
for instance creation and member handling. - Removed
Runtime::Instance::FType
and usedAST::FunctionType
instead. - Added routines to push function instances into import objects.
- Removed the exported map getter in
StoreManager
. Used the getter fromModuleInstance
instead. - Added the module name mapping in
StoreManager
.
- Used
- Refactored the VM class.
- Returned the reference to function type instead of copying when getting the function list.
- Returned the vector of return value and value type pair when execution.
- Updated the include path for rust binding due to the API headers refactoring.
Documentations:
- Updated the examples in the C API documentation.
- Updated the examples in the host function documentation.
- Updated the examples in the external reference documentation.
Bindings:
- Move rust crate from root path to
bindings/rust
.
Tests:
- Updated and fixed the value comarison in core tests.
- Added
ErrInfo
unit tests. - Added instruction tests for turning on/off the old proposals.
- Moved and updated the
AST
unit tests intoloader
. - Moved and updated the
Interpreter
tests intoExecutor
folder. - Added the unit tests for new APIs.
Misc:
- Enabled GitHub CodeSpaces
- Added
assuming
forassert
checking to help compiler to generate better codes.