| Index: src/wasm/wasm-interpreter.cc
|
| diff --git a/src/wasm/wasm-interpreter.cc b/src/wasm/wasm-interpreter.cc
|
| index 7e3127dd533220342e6ffed20725768558bec5f1..20072b9636bd32172b6cf295a9e880afea337312 100644
|
| --- a/src/wasm/wasm-interpreter.cc
|
| +++ b/src/wasm/wasm-interpreter.cc
|
| @@ -1442,9 +1442,9 @@ class ThreadImpl : public WasmInterpreter::Thread {
|
| break;
|
| }
|
|
|
| -#define LOAD_CASE(name, ctype, mtype) \
|
| +#define LOAD_CASE(name, ctype, mtype, machine_type) \
|
| case kExpr##name: { \
|
| - MemoryAccessOperand operand(&decoder, code->at(pc)); \
|
| + MemoryAccessOperand operand(&decoder, code->at(pc), machine_type); \
|
| uint32_t index = Pop().to<uint32_t>(); \
|
| size_t effective_mem_size = instance()->mem_size - sizeof(mtype); \
|
| if (operand.offset > effective_mem_size || \
|
| @@ -1458,25 +1458,25 @@ class ThreadImpl : public WasmInterpreter::Thread {
|
| break; \
|
| }
|
|
|
| - LOAD_CASE(I32LoadMem8S, int32_t, int8_t);
|
| - LOAD_CASE(I32LoadMem8U, int32_t, uint8_t);
|
| - LOAD_CASE(I32LoadMem16S, int32_t, int16_t);
|
| - LOAD_CASE(I32LoadMem16U, int32_t, uint16_t);
|
| - LOAD_CASE(I64LoadMem8S, int64_t, int8_t);
|
| - LOAD_CASE(I64LoadMem8U, int64_t, uint8_t);
|
| - LOAD_CASE(I64LoadMem16S, int64_t, int16_t);
|
| - LOAD_CASE(I64LoadMem16U, int64_t, uint16_t);
|
| - LOAD_CASE(I64LoadMem32S, int64_t, int32_t);
|
| - LOAD_CASE(I64LoadMem32U, int64_t, uint32_t);
|
| - LOAD_CASE(I32LoadMem, int32_t, int32_t);
|
| - LOAD_CASE(I64LoadMem, int64_t, int64_t);
|
| - LOAD_CASE(F32LoadMem, float, float);
|
| - LOAD_CASE(F64LoadMem, double, double);
|
| + LOAD_CASE(I32LoadMem8S, int32_t, int8_t, MachineType::Int8());
|
| + LOAD_CASE(I32LoadMem8U, int32_t, uint8_t, MachineType::Uint8());
|
| + LOAD_CASE(I32LoadMem16S, int32_t, int16_t, MachineType::Int16());
|
| + LOAD_CASE(I32LoadMem16U, int32_t, uint16_t, MachineType::Uint16());
|
| + LOAD_CASE(I64LoadMem8S, int64_t, int8_t, MachineType::Int8());
|
| + LOAD_CASE(I64LoadMem8U, int64_t, uint8_t, MachineType::Uint8());
|
| + LOAD_CASE(I64LoadMem16S, int64_t, int16_t, MachineType::Int16());
|
| + LOAD_CASE(I64LoadMem16U, int64_t, uint16_t, MachineType::Uint16());
|
| + LOAD_CASE(I64LoadMem32S, int64_t, int32_t, MachineType::Int32());
|
| + LOAD_CASE(I64LoadMem32U, int64_t, uint32_t, MachineType::Uint32());
|
| + LOAD_CASE(I32LoadMem, int32_t, int32_t, MachineType::Int32());
|
| + LOAD_CASE(I64LoadMem, int64_t, int64_t, MachineType::Int64());
|
| + LOAD_CASE(F32LoadMem, float, float, MachineType::Float32());
|
| + LOAD_CASE(F64LoadMem, double, double, MachineType::Float64());
|
| #undef LOAD_CASE
|
|
|
| -#define STORE_CASE(name, ctype, mtype) \
|
| +#define STORE_CASE(name, ctype, mtype, machine_type) \
|
| case kExpr##name: { \
|
| - MemoryAccessOperand operand(&decoder, code->at(pc)); \
|
| + MemoryAccessOperand operand(&decoder, code->at(pc), machine_type); \
|
| WasmVal val = Pop(); \
|
| uint32_t index = Pop().to<uint32_t>(); \
|
| size_t effective_mem_size = instance()->mem_size - sizeof(mtype); \
|
| @@ -1491,15 +1491,15 @@ class ThreadImpl : public WasmInterpreter::Thread {
|
| break; \
|
| }
|
|
|
| - STORE_CASE(I32StoreMem8, int32_t, int8_t);
|
| - STORE_CASE(I32StoreMem16, int32_t, int16_t);
|
| - STORE_CASE(I64StoreMem8, int64_t, int8_t);
|
| - STORE_CASE(I64StoreMem16, int64_t, int16_t);
|
| - STORE_CASE(I64StoreMem32, int64_t, int32_t);
|
| - STORE_CASE(I32StoreMem, int32_t, int32_t);
|
| - STORE_CASE(I64StoreMem, int64_t, int64_t);
|
| - STORE_CASE(F32StoreMem, float, float);
|
| - STORE_CASE(F64StoreMem, double, double);
|
| + STORE_CASE(I32StoreMem8, int32_t, int8_t, MachineType::Int8());
|
| + STORE_CASE(I32StoreMem16, int32_t, int16_t, MachineType::Int16());
|
| + STORE_CASE(I64StoreMem8, int64_t, int8_t, MachineType::Int8());
|
| + STORE_CASE(I64StoreMem16, int64_t, int16_t, MachineType::Int16());
|
| + STORE_CASE(I64StoreMem32, int64_t, int32_t, MachineType::Int32());
|
| + STORE_CASE(I32StoreMem, int32_t, int32_t, MachineType::Int32());
|
| + STORE_CASE(I64StoreMem, int64_t, int64_t, MachineType::Int64());
|
| + STORE_CASE(F32StoreMem, float, float, MachineType::Float32());
|
| + STORE_CASE(F64StoreMem, double, double, MachineType::Float64());
|
| #undef STORE_CASE
|
|
|
| #define ASMJS_LOAD_CASE(name, ctype, mtype, defval) \
|
|
|