Index: src/compiler/wasm-compiler.cc |
diff --git a/src/compiler/wasm-compiler.cc b/src/compiler/wasm-compiler.cc |
index da04b3d410d54c659e4a77ae63b22026ac3ac1d8..76fced92693793768f384a185462998c73090751 100644 |
--- a/src/compiler/wasm-compiler.cc |
+++ b/src/compiler/wasm-compiler.cc |
@@ -2951,7 +2951,8 @@ void WasmGraphBuilder::BuildWasmInterpreterEntry( |
// Compute size for the argument buffer. |
int args_size_bytes = 0; |
for (int i = 0; i < wasm_count; i++) { |
- args_size_bytes += 1 << ElementSizeLog2Of(sig->GetParam(i)); |
+ args_size_bytes += |
+ RoundUpToMultipleOfPowOf2(1 << ElementSizeLog2Of(sig->GetParam(i)), 8); |
} |
// The return value is also passed via this buffer: |
@@ -2980,7 +2981,13 @@ void WasmGraphBuilder::BuildWasmInterpreterEntry( |
*effect_ = |
graph()->NewNode(jsgraph()->machine()->Store(store_rep), arg_buffer, |
Int32Constant(offset), param, *effect_, *control_); |
- offset += 1 << ElementSizeLog2Of(param_rep); |
+ |
+ if (is_i64_as_two_params) { |
+ offset += 1 << ElementSizeLog2Of(wasm::kWasmI32); |
+ } else { |
+ offset += RoundUpToMultipleOfPowOf2(1 << ElementSizeLog2Of(param_rep), 8); |
+ } |
+ |
// TODO(clemensh): Respect endianess here. Might need to swap upper and |
// lower word. |
if (is_i64_as_two_params) { |
@@ -2993,6 +3000,8 @@ void WasmGraphBuilder::BuildWasmInterpreterEntry( |
Int32Constant(offset), param, *effect_, *control_); |
offset += 1 << ElementSizeLog2Of(wasm::kWasmI32); |
} |
+ |
+ DCHECK(IsAligned(offset, 8)); |
} |
DCHECK_EQ(param_count, param_index); |
DCHECK_EQ(args_size_bytes, offset); |
@@ -3894,7 +3903,10 @@ Handle<Code> CompileWasmInterpreterEntry(Isolate* isolate, uint32_t func_index, |
Zone zone(isolate->allocator(), ZONE_NAME); |
Graph graph(&zone); |
CommonOperatorBuilder common(&zone); |
- MachineOperatorBuilder machine(&zone); |
+ MachineOperatorBuilder machine( |
+ &zone, MachineType::PointerRepresentation(), |
+ InstructionSelector::SupportedMachineOperatorFlags(), |
+ InstructionSelector::AlignmentRequirements()); |
JSGraph jsgraph(isolate, &graph, &common, nullptr, nullptr, &machine); |
Node* control = nullptr; |