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

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

Issue 875263004: [turbofan] Ensure that NTLs are always properly connected to the end. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 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 "src/compiler/instruction-selector-impl.h" 7 #include "src/compiler/instruction-selector-impl.h"
8 #include "src/compiler/node-matchers.h" 8 #include "src/compiler/node-matchers.h"
9 #include "src/compiler/node-properties-inl.h" 9 #include "src/compiler/node-properties-inl.h"
10 #include "src/compiler/pipeline.h" 10 #include "src/compiler/pipeline.h"
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 return VisitGoto(block->SuccessorAt(0)); 501 return VisitGoto(block->SuccessorAt(0));
502 case BasicBlock::kBranch: { 502 case BasicBlock::kBranch: {
503 DCHECK_EQ(IrOpcode::kBranch, input->opcode()); 503 DCHECK_EQ(IrOpcode::kBranch, input->opcode());
504 BasicBlock* tbranch = block->SuccessorAt(0); 504 BasicBlock* tbranch = block->SuccessorAt(0);
505 BasicBlock* fbranch = block->SuccessorAt(1); 505 BasicBlock* fbranch = block->SuccessorAt(1);
506 // SSA deconstruction requires targets of branches not to have phis. 506 // SSA deconstruction requires targets of branches not to have phis.
507 // Edge split form guarantees this property, but is more strict. 507 // Edge split form guarantees this property, but is more strict.
508 CheckNoPhis(tbranch); 508 CheckNoPhis(tbranch);
509 CheckNoPhis(fbranch); 509 CheckNoPhis(fbranch);
510 if (tbranch == fbranch) return VisitGoto(tbranch); 510 if (tbranch == fbranch) return VisitGoto(tbranch);
511 // Treat special Branch(Always, IfTrue, IfFalse) as Goto(IfTrue).
512 Node* const condition = input->InputAt(0);
513 if (condition->opcode() == IrOpcode::kAlways) return VisitGoto(tbranch);
511 return VisitBranch(input, tbranch, fbranch); 514 return VisitBranch(input, tbranch, fbranch);
512 } 515 }
513 case BasicBlock::kReturn: { 516 case BasicBlock::kReturn: {
514 // If the result itself is a return, return its input. 517 // If the result itself is a return, return its input.
515 Node* value = (input != NULL && input->opcode() == IrOpcode::kReturn) 518 Node* value = (input != NULL && input->opcode() == IrOpcode::kReturn)
516 ? input->InputAt(0) 519 ? input->InputAt(0)
517 : input; 520 : input;
518 return VisitReturn(value); 521 return VisitReturn(value);
519 } 522 }
520 case BasicBlock::kThrow: 523 case BasicBlock::kThrow:
(...skipping 13 matching lines...) Expand all
534 MachineType InstructionSelector::GetMachineType(Node* node) { 537 MachineType InstructionSelector::GetMachineType(Node* node) {
535 DCHECK_NOT_NULL(schedule()->block(node)); // should only use scheduled nodes. 538 DCHECK_NOT_NULL(schedule()->block(node)); // should only use scheduled nodes.
536 switch (node->opcode()) { 539 switch (node->opcode()) {
537 case IrOpcode::kStart: 540 case IrOpcode::kStart:
538 case IrOpcode::kLoop: 541 case IrOpcode::kLoop:
539 case IrOpcode::kEnd: 542 case IrOpcode::kEnd:
540 case IrOpcode::kBranch: 543 case IrOpcode::kBranch:
541 case IrOpcode::kIfTrue: 544 case IrOpcode::kIfTrue:
542 case IrOpcode::kIfFalse: 545 case IrOpcode::kIfFalse:
543 case IrOpcode::kEffectPhi: 546 case IrOpcode::kEffectPhi:
547 case IrOpcode::kEffectSet:
544 case IrOpcode::kMerge: 548 case IrOpcode::kMerge:
545 case IrOpcode::kTerminate:
546 // No code needed for these graph artifacts. 549 // No code needed for these graph artifacts.
547 return kMachNone; 550 return kMachNone;
548 case IrOpcode::kFinish: 551 case IrOpcode::kFinish:
549 return kMachAnyTagged; 552 return kMachAnyTagged;
550 case IrOpcode::kParameter: 553 case IrOpcode::kParameter:
551 return linkage()->GetParameterType(OpParameter<int>(node)); 554 return linkage()->GetParameterType(OpParameter<int>(node));
552 case IrOpcode::kOsrValue: 555 case IrOpcode::kOsrValue:
553 return kMachAnyTagged; 556 return kMachAnyTagged;
554 case IrOpcode::kPhi: 557 case IrOpcode::kPhi:
555 return OpParameter<MachineType>(node); 558 return OpParameter<MachineType>(node);
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after
1170 MachineOperatorBuilder::Flags 1173 MachineOperatorBuilder::Flags
1171 InstructionSelector::SupportedMachineOperatorFlags() { 1174 InstructionSelector::SupportedMachineOperatorFlags() {
1172 return MachineOperatorBuilder::Flag::kNoFlags; 1175 return MachineOperatorBuilder::Flag::kNoFlags;
1173 } 1176 }
1174 1177
1175 #endif // !V8_TURBOFAN_BACKEND 1178 #endif // !V8_TURBOFAN_BACKEND
1176 1179
1177 } // namespace compiler 1180 } // namespace compiler
1178 } // namespace internal 1181 } // namespace internal
1179 } // namespace v8 1182 } // 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