diff --git a/src/interpreter/ByteCode.h b/src/interpreter/ByteCode.h index ae59ad96d..023012536 100644 --- a/src/interpreter/ByteCode.h +++ b/src/interpreter/ByteCode.h @@ -2037,6 +2037,7 @@ class GlobalGet32 : public ByteCode { void dump(size_t pos) { printf("global.get32 "); + DUMP_BYTECODE_OFFSET(dstOffset); printf("index: %" PRId32, m_index); } @@ -2063,6 +2064,7 @@ class GlobalGet64 : public ByteCode { void dump(size_t pos) { printf("global.get64 "); + DUMP_BYTECODE_OFFSET(dstOffset); printf("index: %" PRId32, m_index); } @@ -2089,6 +2091,7 @@ class GlobalGet128 : public ByteCode { void dump(size_t pos) { printf("global.get128 "); + DUMP_BYTECODE_OFFSET(dstOffset); printf("index: %" PRId32, m_index); } @@ -2115,6 +2118,7 @@ class GlobalSet32 : public ByteCode { void dump(size_t pos) { printf("global.set32 "); + DUMP_BYTECODE_OFFSET(srcOffset); printf("index: %" PRId32, m_index); } @@ -2141,6 +2145,7 @@ class GlobalSet64 : public ByteCode { void dump(size_t pos) { printf("global.set64 "); + DUMP_BYTECODE_OFFSET(srcOffset); printf("index: %" PRId32, m_index); } @@ -2167,6 +2172,7 @@ class GlobalSet128 : public ByteCode { void dump(size_t pos) { printf("global.set128 "); + DUMP_BYTECODE_OFFSET(srcOffset); printf("index: %" PRId32, m_index); } diff --git a/src/parser/WASMParser.cpp b/src/parser/WASMParser.cpp index 550d41c20..6f06e896f 100644 --- a/src/parser/WASMParser.cpp +++ b/src/parser/WASMParser.cpp @@ -1255,7 +1255,7 @@ class WASMBinaryReader : public wabt::WASMBinaryReaderDelegate { virtual void OnGlobalGetExpr(Index index) override { auto valueType = m_result.m_globalTypes[index]->type(); - auto sz = Walrus::valueStackAllocatedSize(valueType); + auto sz = Walrus::valueSize(valueType); auto stackPos = computeExprResultPosition(valueType); if (sz == 4) { pushByteCode(Walrus::GlobalGet32(stackPos, index), WASMOpcode::GlobalGetOpcode); @@ -1273,7 +1273,7 @@ class WASMBinaryReader : public wabt::WASMBinaryReaderDelegate { auto stackPos = peekVMStack(); ASSERT(peekVMStackValueType() == valueType); - auto sz = Walrus::valueStackAllocatedSize(valueType); + auto sz = Walrus::valueSize(valueType); if (sz == 4) { pushByteCode(Walrus::GlobalSet32(stackPos, index), WASMOpcode::GlobalSetOpcode); } else if (sz == 8) { diff --git a/src/runtime/Value.h b/src/runtime/Value.h index dc3267e95..6b7a2aa52 100644 --- a/src/runtime/Value.h +++ b/src/runtime/Value.h @@ -434,7 +434,7 @@ inline size_t valueFunctionCopyCount(Value::Type type) template inline void Value::readFromStack(uint8_t* ptr) { - ASSERT(valueStackAllocatedSize(m_type) == size); + ASSERT(valueSize(m_type) == size); if (size == 4) { m_i32 = *reinterpret_cast(ptr); } else if (size == 8) {