Chromium Code Reviews| 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)); |