Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(292)

Unified Diff: src/wasm/wasm-debug.cc

Issue 2887053003: MIPS[64]: Reland of `Fix unaligned arguments storage in Wasm-to-interpreter entry` (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/utils.h ('K') | « src/utils.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/wasm-debug.cc
diff --git a/src/wasm/wasm-debug.cc b/src/wasm/wasm-debug.cc
index f942c921276433ed033d03517b2cea509479172f..2f3b83a3bf7d27458f443d9040a7c7df06e94085 100644
--- a/src/wasm/wasm-debug.cc
+++ b/src/wasm/wasm-debug.cc
@@ -178,7 +178,7 @@ class InterpreterHandle {
#define CASE_ARG_TYPE(type, ctype) \
case type: \
DCHECK_EQ(param_size, sizeof(ctype)); \
- wasm_args[i] = WasmVal(ReadUnalignedValue<ctype>(arg_buf_ptr)); \
+ wasm_args[i] = WasmVal(*reinterpret_cast<ctype*>(arg_buf_ptr)); \
break;
switch (sig->GetParam(i)) {
CASE_ARG_TYPE(kWasmI32, uint32_t)
@@ -189,7 +189,7 @@ class InterpreterHandle {
default:
UNREACHABLE();
}
- arg_buf_ptr += param_size;
+ arg_buf_ptr += RoundUpToMultipleOfPowOf2(param_size, 8);
}
uint32_t activation_id = StartActivation(frame_pointer);
@@ -240,7 +240,7 @@ class InterpreterHandle {
#define CASE_RET_TYPE(type, ctype) \
case type: \
DCHECK_EQ(1 << ElementSizeLog2Of(sig->GetReturn(0)), sizeof(ctype)); \
- WriteUnalignedValue<ctype>(arg_buffer, ret_val.to<ctype>()); \
+ *reinterpret_cast<ctype*>(arg_buffer) = ret_val.to<ctype>(); \
break;
switch (sig->GetReturn(0)) {
CASE_RET_TYPE(kWasmI32, uint32_t)
« src/utils.h ('K') | « src/utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698