extensions
Steven Massey 3 years ago
parent 55374f3062
commit e1441d53fd

@ -95,7 +95,7 @@ _ (Module_AddFunction (i_module, funcTypeIndex, NULL));
if (i_doCompilation and not i_module->runtime)
_throw ("module must be loaded into runtime to compile function");
_ (Compile_Function (function));
_ (CompileFunction (function));
_catch:
m3_Free (ftype);

@ -99,8 +99,6 @@ bool IsRegisterSlotAlias (i16 i_slot) { return (i_slot >= d_m3Reg0Slo
bool IsFpRegisterSlotAlias (i16 i_slot) { return (i_slot == d_m3Fp0SlotAlias); }
bool IsIntRegisterSlotAlias (i16 i_slot) { return (i_slot == d_m3Reg0SlotAlias); }
i16 GetNumBlockValues (IM3Compilation o) { return o->stackIndex - o->block.initStackIndex; }
u16 GetTypeNumSlots (u8 i_type)
{
# if d_m3Use32BitSlots
@ -2148,15 +2146,12 @@ const M3OpInfo c_operations [] =
M3OP( "i64.extend16_s", 0, i_64, d_unaryOpList (i64, Extend16_s), NULL ), // 0xc3
M3OP( "i64.extend32_s", 0, i_64, d_unaryOpList (i64, Extend32_s), NULL ), // 0xc4
# ifdef DEBUG // for codepage logging:
# ifdef DEBUG // for codepage logging. the order doesn't matter:
# define d_m3DebugOp(OP) M3OP (#OP, 0, none, { op_##OP })
# define d_m3DebugTypedOp(OP) M3OP (#OP, 0, none, { op_##OP##_i32, op_##OP##_i64, op_##OP##_f32, op_##OP##_f64, })
d_m3DebugOp (Entry), // 0xc5
d_m3DebugOp (Compile), d_m3DebugOp (End),
d_m3DebugOp (Unsupported),
d_m3DebugOp (CallRawFunction),
d_m3DebugOp (Compile), d_m3DebugOp (Entry), d_m3DebugOp (End),
d_m3DebugOp (Unsupported), d_m3DebugOp (CallRawFunction),
d_m3DebugOp (GetGlobal_s32), d_m3DebugOp (GetGlobal_s64), d_m3DebugOp (ContinueLoop), d_m3DebugOp (ContinueLoopIf),
@ -2220,7 +2215,7 @@ const M3OpInfo* GetOpInfo (m3opcode_t opcode)
return NULL;
}
M3Result Compile_BlockStatements (IM3Compilation o)
M3Result CompileBlockStatements (IM3Compilation o)
{
M3Result result = m3Err_none;
bool ended = false;
@ -2325,7 +2320,7 @@ M3Result CompileBlock (IM3Compilation o, IM3FuncType i_blockType, m3opcode_t i
block->depth ++;
block->opcode = i_blockOpcode;
_ (Compile_BlockStatements (o));
_ (CompileBlockStatements (o));
_ (ValidateBlockEnd (o));
@ -2406,7 +2401,7 @@ void SetupCompilation (IM3Compilation o)
}
M3Result Compile_Function (IM3Function io_function)
M3Result CompileFunction (IM3Function io_function)
{
IM3FuncType funcType = io_function->funcType;
@ -2475,7 +2470,7 @@ _ (Compile_ReserveConstants (o));
_ (EmitOp (o, op_Entry));
EmitPointer (o, io_function);
_ (Compile_BlockStatements (o));
_ (CompileBlockStatements (o));
io_function->compiled = pc;

@ -187,8 +187,8 @@ bool IsStackPolymorphic (IM3Compilation o);
M3Result CompileBlock (IM3Compilation io, IM3FuncType i_blockType, m3opcode_t i_blockOpcode);
M3Result Compile_BlockStatements (IM3Compilation io);
M3Result Compile_Function (IM3Function io_function);
M3Result CompileBlockStatements (IM3Compilation io);
M3Result CompileFunction (IM3Function io_function);
u16 GetMaxUsedSlotPlusOne (IM3Compilation o);

@ -535,7 +535,7 @@ M3Result m3_RunStart (IM3Module io_module)
if (not function->compiled)
{
_ (Compile_Function (function));
_ (CompileFunction (function));
}
IM3FuncType ftype = function->funcType;
@ -691,7 +691,7 @@ M3Result m3_FindFunction (IM3Function * o_function, IM3Runtime i_runtime, cons
{
if (not function->compiled)
{
_ (Compile_Function (function))
_ (CompileFunction (function))
}
// Check if start function needs to be called

@ -552,7 +552,7 @@ d_m3Op (CallIndirect)
if (LIKELY(type == function->funcType))
{
if (UNLIKELY(not function->compiled))
r = Compile_Function (function);
r = CompileFunction (function);
if (LIKELY(not r))
{
@ -700,7 +700,7 @@ d_m3Op (Compile)
m3ret_t result = m3Err_none;
if (UNLIKELY(not function->compiled)) // check to see if function was compiled since this operation was emitted.
result = Compile_Function (function);
result = CompileFunction (function);
if (not result)
{

@ -290,7 +290,7 @@ M3Result Parse_InitExpr (M3Module * io_module, bytes_t * io_bytes, cbytes_t i_
#endif
compilation = (M3Compilation){ NULL, io_module, * io_bytes, i_end };
result = Compile_BlockStatements (& compilation);
result = CompileBlockStatements (& compilation);
* io_bytes = compilation.wasm;

Loading…
Cancel
Save