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

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: 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') | src/utils.h » ('J')
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..da879bc6707a27f0a26f786620ba4dafe8aef2e2 100644
--- a/src/compiler/wasm-compiler.cc
+++ b/src/compiler/wasm-compiler.cc
@@ -2975,30 +2975,32 @@ 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 + kInt64LowerBitsMememoryOffset), 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,
+ store_rep = StoreRepresentation(wasm::kWasmI32,
Clemens Hammacher 2017/03/01 08:51:13 This assignment is redundant.
ivica.bogosavljevic 2017/03/01 12:58:48 Acknowledged.
+ WriteBarrierKind::kNoWriteBarrier);
+ *effect_ =
+ graph()->NewNode(jsgraph()->machine()->Store(store_rep), arg_buffer,
+ Int32Constant(offset + kInt64HigherBitsMemoryOffset),
+ 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') | src/utils.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698