extensions
Steven Massey 4 years ago
parent f8329bb3bd
commit 314fe09b05

@ -2080,7 +2080,7 @@ M3Result Compile_ReserveConstants (IM3Compilation o)
// if constants overflow their reserved stack space, the compiler simply emits op_Const
// operations as needed. Compiled expressions (global inits) don't pass through this
// ReserveConstants function and thus always produce inline contants.
numConstants = m3_min (numConstants, d_m3MaxNumFunctionConstants);
numConstants = m3_min (numConstants, d_m3MaxConstantTableSize);
u32 freeSlots = d_m3MaxFunctionStackHeight - o->constSlotIndex;

@ -89,7 +89,7 @@ typedef struct
u16 firstConstSlotIndex;
u16 constSlotIndex; // as const's are encountered during compilation this tracks their location in the "real" stack
u64 constants [d_m3MaxNumFunctionConstants];
u64 constants [d_m3MaxConstantTableSize];
// 'wasmStack' is unused for args/locals. for the dynamic portion of the stack, 'wasmStack' holds slot locations
u16 wasmStack [d_m3MaxFunctionStackHeight];

@ -21,7 +21,7 @@
# define d_m3MaxFunctionStackHeight 2000
# endif
#define d_m3MaxNumFunctionConstants 60
#define d_m3MaxConstantTableSize 60
# ifndef d_m3LogOutput
# define d_m3LogOutput 1

@ -196,7 +196,7 @@ M3Result EvaluateExpression (IM3Module i_module, void * o_expressed, u8 i_type
{
M3Result result = m3Err_none;
u64 stack [d_m3MaxFunctionStackHeight]; // stack on the stack
m3slot_t stack [d_m3MaxFunctionStackHeight]; // stack on the stack
// create a temporary runtime context
M3Runtime runtime;
@ -568,12 +568,9 @@ M3Result m3_CallWithArgs (IM3Function i_function, uint32_t i_argc, const char
if (i_function->name and strcmp (i_function->name, "_start") == 0) // WASI
i_argc = 0;
IM3FuncType ftype = i_function->funcType;
IM3FuncType ftype = i_function->funcType; m3logif (runtime, PrintFuncTypeSignature (ftype));
m3stack_t stack = (m3stack_t) runtime->stack;
m3logif (runtime, PrintFuncTypeSignature (ftype));
if (i_argc != ftype->numArgs)
_throw (m3Err_argumentCountMismatch);

Loading…
Cancel
Save