|
|
|
@ -1486,13 +1486,15 @@ _ (EmitOp (o, op_CallIndirect));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
M3Result Compile_Memory_Current (IM3Compilation o, m3opcode_t i_opcode)
|
|
|
|
|
M3Result Compile_Memory_Size (IM3Compilation o, m3opcode_t i_opcode)
|
|
|
|
|
{
|
|
|
|
|
M3Result result;
|
|
|
|
|
|
|
|
|
|
i8 reserved;
|
|
|
|
|
_ (ReadLEB_i7 (& reserved, & o->wasm, o->wasmEnd));
|
|
|
|
|
|
|
|
|
|
_ (PreserveRegisterIfOccupied (o, c_m3Type_i32));
|
|
|
|
|
|
|
|
|
|
_ (EmitOp (o, op_MemCurrent));
|
|
|
|
|
|
|
|
|
|
_ (PushRegister (o, c_m3Type_i32));
|
|
|
|
@ -1971,8 +1973,8 @@ const M3OpInfo c_operations [] =
|
|
|
|
|
M3OP( "i64.store16", -2, none, d_binOpList (i64, Store_i16), Compile_Load_Store ), // 0x3d
|
|
|
|
|
M3OP( "i64.store32", -2, none, d_binOpList (i64, Store_i32), Compile_Load_Store ), // 0x3e
|
|
|
|
|
|
|
|
|
|
M3OP( "memory.current", 1, i_32, d_logOp (MemCurrent), Compile_Memory_Current ), // 0x3f
|
|
|
|
|
M3OP( "memory.grow", 1, i_32, d_logOp (MemGrow), Compile_Memory_Grow ), // 0x40
|
|
|
|
|
M3OP( "memory.size", 1, i_32, d_logOp (MemCurrent), Compile_Memory_Size ), // 0x3f
|
|
|
|
|
M3OP( "memory.grow", 1, i_32, d_logOp (MemGrow), Compile_Memory_Grow ), // 0x40
|
|
|
|
|
|
|
|
|
|
M3OP( "i32.const", 1, i_32, d_logOp (Const32), Compile_Const_i32 ), // 0x41
|
|
|
|
|
M3OP( "i64.const", 1, i_64, d_logOp (Const64), Compile_Const_i64 ), // 0x42
|
|
|
|
@ -2190,14 +2192,9 @@ M3Result Compile_BlockStatements (IM3Compilation o)
|
|
|
|
|
|
|
|
|
|
while (o->wasm < o->wasmEnd)
|
|
|
|
|
{ emit_stack_dump (o);
|
|
|
|
|
m3opcode_t opcode;
|
|
|
|
|
o->lastOpcodeStart = o->wasm;
|
|
|
|
|
m3opcode_t opcode = * (o->wasm++); log_opcode (o, opcode);
|
|
|
|
|
|
|
|
|
|
#ifndef d_m3CompileExtendedOpcode
|
|
|
|
|
if (UNLIKELY(opcode == 0xFC)) {
|
|
|
|
|
opcode = (opcode << 8) | (* (o->wasm++));
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
_ (Read_opcode (& opcode, & o->wasm, o->wasmEnd)); log_opcode (o, opcode);
|
|
|
|
|
|
|
|
|
|
IM3OpInfo opinfo = GetOpInfo(opcode);
|
|
|
|
|
_throwif (m3Err_unknownOpcode, opinfo == NULL);
|
|
|
|
|