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

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

Issue 896783002: Turn throws into basic block terminators. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_trycatch-1
Patch Set: Created 5 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 | « src/compiler/ast-graph-builder.cc ('k') | src/compiler/scheduler.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.h" 9 #include "src/compiler/node-properties.h"
10 #include "src/compiler/pipeline.h" 10 #include "src/compiler/pipeline.h"
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 return VisitBranch(input, tbranch, fbranch); 514 return VisitBranch(input, tbranch, fbranch);
515 } 515 }
516 case BasicBlock::kReturn: { 516 case BasicBlock::kReturn: {
517 // If the result itself is a return, return its input. 517 // If the result itself is a return, return its input.
518 Node* value = (input != NULL && input->opcode() == IrOpcode::kReturn) 518 Node* value = (input != NULL && input->opcode() == IrOpcode::kReturn)
519 ? input->InputAt(0) 519 ? input->InputAt(0)
520 : input; 520 : input;
521 return VisitReturn(value); 521 return VisitReturn(value);
522 } 522 }
523 case BasicBlock::kThrow: 523 case BasicBlock::kThrow:
524 return VisitThrow(input); 524 DCHECK_EQ(IrOpcode::kThrow, input->opcode());
525 return VisitThrow(input->InputAt(0));
525 case BasicBlock::kNone: { 526 case BasicBlock::kNone: {
526 // TODO(titzer): exit block doesn't have control. 527 // TODO(titzer): exit block doesn't have control.
527 DCHECK(input == NULL); 528 DCHECK(input == NULL);
528 break; 529 break;
529 } 530 }
530 default: 531 default:
531 UNREACHABLE(); 532 UNREACHABLE();
532 break; 533 break;
533 } 534 }
534 } 535 }
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
1042 if (value != NULL) { 1043 if (value != NULL) {
1043 Emit(kArchRet, NULL, g.UseLocation(value, linkage()->GetReturnLocation(), 1044 Emit(kArchRet, NULL, g.UseLocation(value, linkage()->GetReturnLocation(),
1044 linkage()->GetReturnType())); 1045 linkage()->GetReturnType()));
1045 } else { 1046 } else {
1046 Emit(kArchRet, NULL); 1047 Emit(kArchRet, NULL);
1047 } 1048 }
1048 } 1049 }
1049 1050
1050 1051
1051 void InstructionSelector::VisitThrow(Node* value) { 1052 void InstructionSelector::VisitThrow(Node* value) {
1052 UNIMPLEMENTED(); // TODO(titzer) 1053 Emit(kArchNop, NULL); // TODO(titzer)
1053 } 1054 }
1054 1055
1055 1056
1056 void InstructionSelector::FillTypeVectorFromStateValues( 1057 void InstructionSelector::FillTypeVectorFromStateValues(
1057 ZoneVector<MachineType>* types, Node* state_values) { 1058 ZoneVector<MachineType>* types, Node* state_values) {
1058 DCHECK(state_values->opcode() == IrOpcode::kStateValues); 1059 DCHECK(state_values->opcode() == IrOpcode::kStateValues);
1059 int count = state_values->InputCount(); 1060 int count = state_values->InputCount();
1060 types->reserve(static_cast<size_t>(count)); 1061 types->reserve(static_cast<size_t>(count));
1061 for (int i = 0; i < count; i++) { 1062 for (int i = 0; i < count; i++) {
1062 types->push_back(GetMachineType(state_values->InputAt(i))); 1063 types->push_back(GetMachineType(state_values->InputAt(i)));
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
1173 MachineOperatorBuilder::Flags 1174 MachineOperatorBuilder::Flags
1174 InstructionSelector::SupportedMachineOperatorFlags() { 1175 InstructionSelector::SupportedMachineOperatorFlags() {
1175 return MachineOperatorBuilder::Flag::kNoFlags; 1176 return MachineOperatorBuilder::Flag::kNoFlags;
1176 } 1177 }
1177 1178
1178 #endif // !V8_TURBOFAN_BACKEND 1179 #endif // !V8_TURBOFAN_BACKEND
1179 1180
1180 } // namespace compiler 1181 } // namespace compiler
1181 } // namespace internal 1182 } // namespace internal
1182 } // namespace v8 1183 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/ast-graph-builder.cc ('k') | src/compiler/scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698