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

Side by Side Diff: src/compiler/int64-lowering.cc

Issue 1714793003: [wasm] Unittest for Int64Lowering. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Added tests for the other operators we already lower. Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/compiler/wasm-compiler.cc » ('j') | src/wasm/wasm-module.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/int64-lowering.h" 5 #include "src/compiler/int64-lowering.h"
6 #include "src/compiler/common-operator.h" 6 #include "src/compiler/common-operator.h"
7 #include "src/compiler/graph.h" 7 #include "src/compiler/graph.h"
8 #include "src/compiler/linkage.h" 8 #include "src/compiler/linkage.h"
9 #include "src/compiler/machine-operator.h" 9 #include "src/compiler/machine-operator.h"
10 #include "src/compiler/node-properties.h" 10 #include "src/compiler/node-properties.h"
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 case IrOpcode::kParameter: { 202 case IrOpcode::kParameter: {
203 DCHECK(node->InputCount() == 1); 203 DCHECK(node->InputCount() == 1);
204 // Only exchange the node if the parameter count actually changed. We do 204 // Only exchange the node if the parameter count actually changed. We do
205 // not even have to do the default lowering because the the start node, 205 // not even have to do the default lowering because the the start node,
206 // the only input of a parameter node, only changes if the parameter count 206 // the only input of a parameter node, only changes if the parameter count
207 // changes. 207 // changes.
208 if (GetParameterCountAfterLowering(signature()) != 208 if (GetParameterCountAfterLowering(signature()) !=
209 signature()->parameter_count()) { 209 signature()->parameter_count()) {
210 int old_index = ParameterIndexOf(node->op()); 210 int old_index = ParameterIndexOf(node->op());
211 int new_index = GetParameterIndexAfterLowering(signature(), old_index); 211 int new_index = GetParameterIndexAfterLowering(signature(), old_index);
212 // TODO(ahaas): Use NodeProperties::ChangeOp here instead of allocating
213 // a new node.
212 Node* low_node = 214 Node* low_node =
213 graph()->NewNode(common()->Parameter(new_index), graph()->start()); 215 graph()->NewNode(common()->Parameter(new_index), graph()->start());
214 216
215 Node* high_node = nullptr; 217 Node* high_node = nullptr;
216 if (signature()->GetParam(old_index) == 218 if (signature()->GetParam(old_index) ==
217 MachineRepresentation::kWord64) { 219 MachineRepresentation::kWord64) {
218 high_node = graph()->NewNode(common()->Parameter(new_index + 1), 220 high_node = graph()->NewNode(common()->Parameter(new_index + 1),
219 graph()->start()); 221 graph()->start());
220 } 222 }
221 ReplaceNode(node, low_node, high_node); 223 ReplaceNode(node, low_node, high_node);
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 } 293 }
292 294
293 Node* Int64Lowering::GetReplacementHigh(Node* node) { 295 Node* Int64Lowering::GetReplacementHigh(Node* node) {
294 Node* result = replacements_[node->id()].high; 296 Node* result = replacements_[node->id()].high;
295 DCHECK(result); 297 DCHECK(result);
296 return result; 298 return result;
297 } 299 }
298 } // namespace compiler 300 } // namespace compiler
299 } // namespace internal 301 } // namespace internal
300 } // namespace v8 302 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/wasm-compiler.cc » ('j') | src/wasm/wasm-module.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698