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

Side by Side Diff: src/compiler/common-operator-reducer.cc

Issue 2473643002: Revert of [turbofan] Support variable size argument popping in TF-generated functions (Closed)
Patch Set: Created 4 years, 1 month 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 | « src/compiler/common-operator.cc ('k') | src/compiler/ia32/code-generator-ia32.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/common-operator-reducer.h" 5 #include "src/compiler/common-operator-reducer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "src/compiler/common-operator.h" 9 #include "src/compiler/common-operator.h"
10 #include "src/compiler/graph.h" 10 #include "src/compiler/graph.h"
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 if (input != value) return NoChange(); 277 if (input != value) return NoChange();
278 } 278 }
279 // We might now be able to further reduce the {merge} node. 279 // We might now be able to further reduce the {merge} node.
280 Revisit(merge); 280 Revisit(merge);
281 return Replace(value); 281 return Replace(value);
282 } 282 }
283 283
284 284
285 Reduction CommonOperatorReducer::ReduceReturn(Node* node) { 285 Reduction CommonOperatorReducer::ReduceReturn(Node* node) {
286 DCHECK_EQ(IrOpcode::kReturn, node->opcode()); 286 DCHECK_EQ(IrOpcode::kReturn, node->opcode());
287 Node* const value = node->InputAt(1); 287 Node* const value = node->InputAt(0);
288 Node* effect = NodeProperties::GetEffectInput(node); 288 Node* effect = NodeProperties::GetEffectInput(node);
289 Node* const control = NodeProperties::GetControlInput(node); 289 Node* const control = NodeProperties::GetControlInput(node);
290 bool changed = false; 290 bool changed = false;
291 if (effect->opcode() == IrOpcode::kCheckpoint) { 291 if (effect->opcode() == IrOpcode::kCheckpoint) {
292 // Any {Return} node can never be used to insert a deoptimization point, 292 // Any {Return} node can never be used to insert a deoptimization point,
293 // hence checkpoints can be cut out of the effect chain flowing into it. 293 // hence checkpoints can be cut out of the effect chain flowing into it.
294 effect = NodeProperties::GetEffectInput(effect); 294 effect = NodeProperties::GetEffectInput(effect);
295 NodeProperties::ReplaceEffectInput(node, effect); 295 NodeProperties::ReplaceEffectInput(node, effect);
296 changed = true; 296 changed = true;
297 } 297 }
298 if (value->opcode() == IrOpcode::kPhi && 298 if (value->opcode() == IrOpcode::kPhi &&
299 NodeProperties::GetControlInput(value) == control && 299 NodeProperties::GetControlInput(value) == control &&
300 effect->opcode() == IrOpcode::kEffectPhi && 300 effect->opcode() == IrOpcode::kEffectPhi &&
301 NodeProperties::GetControlInput(effect) == control && 301 NodeProperties::GetControlInput(effect) == control &&
302 control->opcode() == IrOpcode::kMerge) { 302 control->opcode() == IrOpcode::kMerge) {
303 int const control_input_count = control->InputCount(); 303 int const control_input_count = control->InputCount();
304 DCHECK_NE(0, control_input_count); 304 DCHECK_NE(0, control_input_count);
305 DCHECK_EQ(control_input_count, value->InputCount() - 1); 305 DCHECK_EQ(control_input_count, value->InputCount() - 1);
306 DCHECK_EQ(control_input_count, effect->InputCount() - 1); 306 DCHECK_EQ(control_input_count, effect->InputCount() - 1);
307 DCHECK_EQ(IrOpcode::kEnd, graph()->end()->opcode()); 307 DCHECK_EQ(IrOpcode::kEnd, graph()->end()->opcode());
308 DCHECK_NE(0, graph()->end()->InputCount()); 308 DCHECK_NE(0, graph()->end()->InputCount());
309 for (int i = 0; i < control_input_count; ++i) { 309 for (int i = 0; i < control_input_count; ++i) {
310 // Create a new {Return} and connect it to {end}. We don't need to mark 310 // Create a new {Return} and connect it to {end}. We don't need to mark
311 // {end} as revisit, because we mark {node} as {Dead} below, which was 311 // {end} as revisit, because we mark {node} as {Dead} below, which was
312 // previously connected to {end}, so we know for sure that at some point 312 // previously connected to {end}, so we know for sure that at some point
313 // the reducer logic will visit {end} again. 313 // the reducer logic will visit {end} again.
314 Node* ret = graph()->NewNode(common()->Return(), node->InputAt(0), 314 Node* ret = graph()->NewNode(common()->Return(), value->InputAt(i),
315 value->InputAt(i), effect->InputAt(i), 315 effect->InputAt(i), control->InputAt(i));
316 control->InputAt(i));
317 NodeProperties::MergeControlToEnd(graph(), common(), ret); 316 NodeProperties::MergeControlToEnd(graph(), common(), ret);
318 } 317 }
319 // Mark the merge {control} and return {node} as {dead}. 318 // Mark the merge {control} and return {node} as {dead}.
320 Replace(control, dead()); 319 Replace(control, dead());
321 return Replace(dead()); 320 return Replace(dead());
322 } 321 }
323 return changed ? Changed(node) : NoChange(); 322 return changed ? Changed(node) : NoChange();
324 } 323 }
325 324
326 325
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 node->ReplaceInput(0, a); 381 node->ReplaceInput(0, a);
383 node->ReplaceInput(1, b); 382 node->ReplaceInput(1, b);
384 node->TrimInputCount(2); 383 node->TrimInputCount(2);
385 NodeProperties::ChangeOp(node, op); 384 NodeProperties::ChangeOp(node, op);
386 return Changed(node); 385 return Changed(node);
387 } 386 }
388 387
389 } // namespace compiler 388 } // namespace compiler
390 } // namespace internal 389 } // namespace internal
391 } // namespace v8 390 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/common-operator.cc ('k') | src/compiler/ia32/code-generator-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698