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

Side by Side Diff: src/compiler/instruction-selector.cc

Issue 1123213002: [turbofan] Connect non-terminating loops via Terminate. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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 | « src/compiler/control-reducer.cc ('k') | src/compiler/js-generic-lowering.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/instruction-selector.h" 5 #include "src/compiler/instruction-selector.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "src/base/adapters.h" 9 #include "src/base/adapters.h"
10 #include "src/compiler/instruction-selector-impl.h" 10 #include "src/compiler/instruction-selector-impl.h"
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 } 467 }
468 case BasicBlock::kTailCall: { 468 case BasicBlock::kTailCall: {
469 DCHECK_EQ(IrOpcode::kTailCall, input->opcode()); 469 DCHECK_EQ(IrOpcode::kTailCall, input->opcode());
470 return VisitTailCall(input); 470 return VisitTailCall(input);
471 } 471 }
472 case BasicBlock::kBranch: { 472 case BasicBlock::kBranch: {
473 DCHECK_EQ(IrOpcode::kBranch, input->opcode()); 473 DCHECK_EQ(IrOpcode::kBranch, input->opcode());
474 BasicBlock* tbranch = block->SuccessorAt(0); 474 BasicBlock* tbranch = block->SuccessorAt(0);
475 BasicBlock* fbranch = block->SuccessorAt(1); 475 BasicBlock* fbranch = block->SuccessorAt(1);
476 if (tbranch == fbranch) return VisitGoto(tbranch); 476 if (tbranch == fbranch) return VisitGoto(tbranch);
477 // Treat special Branch(Always, IfTrue, IfFalse) as Goto(IfTrue).
478 Node* const condition = input->InputAt(0);
479 if (condition->opcode() == IrOpcode::kAlways) return VisitGoto(tbranch);
480 return VisitBranch(input, tbranch, fbranch); 477 return VisitBranch(input, tbranch, fbranch);
481 } 478 }
482 case BasicBlock::kSwitch: { 479 case BasicBlock::kSwitch: {
483 DCHECK_EQ(IrOpcode::kSwitch, input->opcode()); 480 DCHECK_EQ(IrOpcode::kSwitch, input->opcode());
484 SwitchInfo sw; 481 SwitchInfo sw;
485 // Last successor must be Default. 482 // Last successor must be Default.
486 sw.default_branch = block->successors().back(); 483 sw.default_branch = block->successors().back();
487 DCHECK_EQ(IrOpcode::kIfDefault, sw.default_branch->front()->opcode()); 484 DCHECK_EQ(IrOpcode::kIfDefault, sw.default_branch->front()->opcode());
488 // All other successors must be cases. 485 // All other successors must be cases.
489 sw.case_count = block->SuccessorCount() - 1; 486 sw.case_count = block->SuccessorCount() - 1;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 case IrOpcode::kEnd: 540 case IrOpcode::kEnd:
544 case IrOpcode::kBranch: 541 case IrOpcode::kBranch:
545 case IrOpcode::kIfTrue: 542 case IrOpcode::kIfTrue:
546 case IrOpcode::kIfFalse: 543 case IrOpcode::kIfFalse:
547 case IrOpcode::kIfSuccess: 544 case IrOpcode::kIfSuccess:
548 case IrOpcode::kSwitch: 545 case IrOpcode::kSwitch:
549 case IrOpcode::kIfValue: 546 case IrOpcode::kIfValue:
550 case IrOpcode::kIfDefault: 547 case IrOpcode::kIfDefault:
551 case IrOpcode::kEffectPhi: 548 case IrOpcode::kEffectPhi:
552 case IrOpcode::kMerge: 549 case IrOpcode::kMerge:
550 case IrOpcode::kTerminate:
553 // No code needed for these graph artifacts. 551 // No code needed for these graph artifacts.
554 return; 552 return;
555 case IrOpcode::kIfException: 553 case IrOpcode::kIfException:
556 return MarkAsReference(node), VisitIfException(node); 554 return MarkAsReference(node), VisitIfException(node);
557 case IrOpcode::kFinish: 555 case IrOpcode::kFinish:
558 return MarkAsReference(node), VisitFinish(node); 556 return MarkAsReference(node), VisitFinish(node);
559 case IrOpcode::kParameter: { 557 case IrOpcode::kParameter: {
560 MachineType type = 558 MachineType type =
561 linkage()->GetParameterType(ParameterIndexOf(node->op())); 559 linkage()->GetParameterType(ParameterIndexOf(node->op()));
562 MarkAsRepresentation(type, node); 560 MarkAsRepresentation(type, node);
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
1146 MachineOperatorBuilder::Flags 1144 MachineOperatorBuilder::Flags
1147 InstructionSelector::SupportedMachineOperatorFlags() { 1145 InstructionSelector::SupportedMachineOperatorFlags() {
1148 return MachineOperatorBuilder::Flag::kNoFlags; 1146 return MachineOperatorBuilder::Flag::kNoFlags;
1149 } 1147 }
1150 1148
1151 #endif // !V8_TURBOFAN_BACKEND 1149 #endif // !V8_TURBOFAN_BACKEND
1152 1150
1153 } // namespace compiler 1151 } // namespace compiler
1154 } // namespace internal 1152 } // namespace internal
1155 } // namespace v8 1153 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/control-reducer.cc ('k') | src/compiler/js-generic-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698