From 92c220407e54c2b0c3a477267cf2e4f468e3c6a3 Mon Sep 17 00:00:00 2001 From: Steven Massey Date: Thu, 13 May 2021 19:32:12 -0700 Subject: [PATCH] sync --- source/extensions/wasm3_ext.h | 15 ++++++++++++--- source/m3_function.h | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/source/extensions/wasm3_ext.h b/source/extensions/wasm3_ext.h index ca396eb..6bf4fc2 100644 --- a/source/extensions/wasm3_ext.h +++ b/source/extensions/wasm3_ext.h @@ -11,6 +11,7 @@ #define wasm3_ext_h #include "wasm3.h" +//#include "m3_exec_defs.h" #include #if defined(__cplusplus) @@ -29,8 +30,9 @@ extern "C" { // To append a new function, set io_functionIndex to negative. On return, the new function index will be set. // To overwrite an existing function, set io_functionIndex to the desired element. i_signature must match the existing // function signature. - // ** InjectFunction invalidates any existing IM3Function pointers - M3Result m3_InjectFunction (IM3Module io_module, + + // ** InjectFunction invalidates any outstanding IM3Function pointers + M3Result m3_InjectFunction (IM3Module i_module, int32_t * io_functionIndex, // const char * const i_name, const char * const i_signature, @@ -39,7 +41,7 @@ extern "C" { M3Result m3_AddFunctionToTable (IM3Function i_function, uint32_t * o_elementIndex, - uint32_t i_tableIndex); // must be zero + uint32_t i_tableIndex); // i_tableIndex must be zero IM3Function m3_GetFunctionByIndex (IM3Module i_module, @@ -51,7 +53,14 @@ extern "C" { M3Result m3_GetDataSegmentOffset (IM3Module i_module, uint32_t i_index); +//------------------------------------------------------------------------------------------------------------------------------- +#if 0 + M3Result m3_RegisterCustomOpcode (IM3Module i_module, + uint16_t i_opcode, + uint8_t i_numImmediates, + IM3Operation i_operation); +#endif #if 0 M3Result m3_SetStackGlobalIndex (IM3Module io_module, uint32_t i_index); diff --git a/source/m3_function.h b/source/m3_function.h index c4b2504..1936a64 100644 --- a/source/m3_function.h +++ b/source/m3_function.h @@ -61,8 +61,8 @@ typedef struct M3Function #if defined (DEBUG) u32 hits; - u32 index; #endif + u32 index; u16 maxStackSlots;