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

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

Issue 2721053002: MIPS: Fix int64->int32 lowering in wasm-to-interpeter entry on big-endian archs. (Closed)
Patch Set: Address code review remarks Created 3 years, 10 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
« no previous file with comments | « no previous file | src/utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/wasm-compiler.cc
diff --git a/src/compiler/wasm-compiler.cc b/src/compiler/wasm-compiler.cc
index ecb1987e56e193b57a6aa9ab58eb0e790f47ad80..e57c7303756a362cfbaa70d70b0d829378ddc9a0 100644
--- a/src/compiler/wasm-compiler.cc
+++ b/src/compiler/wasm-compiler.cc
@@ -2975,30 +2975,30 @@ void WasmGraphBuilder::BuildWasmInterpreterEntry(
Node* param = Param(param_index++);
bool is_i64_as_two_params =
jsgraph()->machine()->Is32() && sig->GetParam(i) == wasm::kWasmI64;
- MachineRepresentation param_rep =
- is_i64_as_two_params ? wasm::kWasmI32 : sig->GetParam(i);
- StoreRepresentation store_rep(param_rep, WriteBarrierKind::kNoWriteBarrier);
- *effect_ =
- graph()->NewNode(jsgraph()->machine()->Store(store_rep), arg_buffer,
- Int32Constant(offset), param, *effect_, *control_);
if (is_i64_as_two_params) {
- offset += 1 << ElementSizeLog2Of(wasm::kWasmI32);
- } else {
- offset += RoundUpToMultipleOfPowOf2(1 << ElementSizeLog2Of(param_rep), 8);
- }
+ StoreRepresentation store_rep(wasm::kWasmI32,
+ WriteBarrierKind::kNoWriteBarrier);
+ *effect_ =
+ graph()->NewNode(jsgraph()->machine()->Store(store_rep), arg_buffer,
+ Int32Constant(offset + kInt64LowerHalfMemoryOffset),
+ param, *effect_, *control_);
- // TODO(clemensh): Respect endianess here. Might need to swap upper and
- // lower word.
- if (is_i64_as_two_params) {
- // Also store the upper half.
param = Param(param_index++);
- StoreRepresentation store_rep(wasm::kWasmI32,
+ *effect_ =
+ graph()->NewNode(jsgraph()->machine()->Store(store_rep), arg_buffer,
+ Int32Constant(offset + kInt64UpperHalfMemoryOffset),
+ param, *effect_, *control_);
+ offset += 8;
+
+ } else {
+ MachineRepresentation param_rep = sig->GetParam(i);
+ StoreRepresentation store_rep(param_rep,
WriteBarrierKind::kNoWriteBarrier);
*effect_ =
graph()->NewNode(jsgraph()->machine()->Store(store_rep), arg_buffer,
Int32Constant(offset), param, *effect_, *control_);
- offset += 1 << ElementSizeLog2Of(wasm::kWasmI32);
+ offset += RoundUpToMultipleOfPowOf2(1 << ElementSizeLog2Of(param_rep), 8);
}
DCHECK(IsAligned(offset, 8));
« no previous file with comments | « no previous file | src/utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698