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

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: Michael's remarks Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/compiler/wasm-compiler.cc » ('j') | no next file with comments »
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 Node* low_node = 212 NodeProperties::ChangeOp(node, common()->Parameter(new_index));
213 graph()->NewNode(common()->Parameter(new_index), graph()->start());
214 213
215 Node* high_node = nullptr; 214 Node* high_node = nullptr;
216 if (signature()->GetParam(old_index) == 215 if (signature()->GetParam(old_index) ==
217 MachineRepresentation::kWord64) { 216 MachineRepresentation::kWord64) {
218 high_node = graph()->NewNode(common()->Parameter(new_index + 1), 217 high_node = graph()->NewNode(common()->Parameter(new_index + 1),
219 graph()->start()); 218 graph()->start());
220 } 219 }
221 ReplaceNode(node, low_node, high_node); 220 ReplaceNode(node, node, high_node);
222 } 221 }
223 break; 222 break;
224 } 223 }
225 case IrOpcode::kReturn: { 224 case IrOpcode::kReturn: {
226 DefaultLowering(node); 225 DefaultLowering(node);
227 int new_return_count = GetReturnCountAfterLowering(signature()); 226 int new_return_count = GetReturnCountAfterLowering(signature());
228 if (signature()->return_count() != new_return_count) { 227 if (signature()->return_count() != new_return_count) {
229 NodeProperties::ChangeOp(node, common()->Return(new_return_count)); 228 NodeProperties::ChangeOp(node, common()->Return(new_return_count));
230 } 229 }
231 break; 230 break;
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 } 290 }
292 291
293 Node* Int64Lowering::GetReplacementHigh(Node* node) { 292 Node* Int64Lowering::GetReplacementHigh(Node* node) {
294 Node* result = replacements_[node->id()].high; 293 Node* result = replacements_[node->id()].high;
295 DCHECK(result); 294 DCHECK(result);
296 return result; 295 return result;
297 } 296 }
298 } // namespace compiler 297 } // namespace compiler
299 } // namespace internal 298 } // namespace internal
300 } // namespace v8 299 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/wasm-compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698