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

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

Issue 2731713002: [wasm] Fix interpreter entry for i64 return type (Closed)
Patch Set: Address comments Created 3 years, 9 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 | « src/compiler/int64-lowering.cc ('k') | test/cctest/wasm/test-wasm-interpreter-entry.cc » ('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 b14e0844fc413a402e43e19f7ffb894e8dcc7469..7cafb16dd2712a6a019278ee1fac7a40e6c5500e 100644
--- a/src/compiler/wasm-compiler.cc
+++ b/src/compiler/wasm-compiler.cc
@@ -2971,12 +2971,11 @@ void WasmGraphBuilder::BuildWasmInterpreterEntry(
// Now store all our arguments to the buffer.
int param_index = 0;
int offset = 0;
+
for (int i = 0; i < wasm_count; i++) {
Node* param = Param(param_index++);
- bool is_i64_as_two_params =
- jsgraph()->machine()->Is32() && sig->GetParam(i) == wasm::kWasmI64;
-
- if (is_i64_as_two_params) {
+ if (Int64Lowering::IsI64AsTwoParameters(jsgraph()->machine(),
+ sig->GetParam(i))) {
StoreRepresentation store_rep(wasm::kWasmI32,
WriteBarrierKind::kNoWriteBarrier);
*effect_ =
@@ -3018,26 +3017,24 @@ void WasmGraphBuilder::BuildWasmInterpreterEntry(
arraysize(parameters), effect_, *control_);
// Read back the return value.
- if (jsgraph()->machine()->Is32() && sig->return_count() > 0 &&
- sig->GetReturn() == wasm::kWasmI64) {
+ if (sig->return_count() == 0) {
+ Return(Int32Constant(0));
+ } else if (Int64Lowering::IsI64AsTwoParameters(jsgraph()->machine(),
+ sig->GetReturn())) {
MachineType load_rep = wasm::WasmOpcodes::MachineTypeFor(wasm::kWasmI32);
Node* lower =
graph()->NewNode(jsgraph()->machine()->Load(load_rep), arg_buffer,
Int32Constant(0), *effect_, *control_);
Node* upper =
graph()->NewNode(jsgraph()->machine()->Load(load_rep), arg_buffer,
- Int32Constant(sizeof(int32_t)), *effect_, *control_);
- Return(upper, lower);
+ Int32Constant(sizeof(int32_t)), lower, *control_);
+ *effect_ = upper;
+ Return(lower, upper);
} else {
- Node* val;
- if (sig->return_count() == 0) {
- val = Int32Constant(0);
- } else {
- MachineType load_rep =
- wasm::WasmOpcodes::MachineTypeFor(sig->GetReturn());
- val = graph()->NewNode(jsgraph()->machine()->Load(load_rep), arg_buffer,
- Int32Constant(0), *effect_, *control_);
- }
+ MachineType load_rep = wasm::WasmOpcodes::MachineTypeFor(sig->GetReturn());
+ Node* val =
+ graph()->NewNode(jsgraph()->machine()->Load(load_rep), arg_buffer,
+ Int32Constant(0), *effect_, *control_);
Return(val);
}
}
« no previous file with comments | « src/compiler/int64-lowering.cc ('k') | test/cctest/wasm/test-wasm-interpreter-entry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698