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

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

Issue 989123003: [turbofan] Project exception value out of calls. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix IrOpcodeTest. Created 5 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
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/compiler/instruction-selector-impl.h" 9 #include "src/compiler/instruction-selector-impl.h"
10 #include "src/compiler/node-matchers.h" 10 #include "src/compiler/node-matchers.h"
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 } 723 }
724 } 724 }
725 switch (node->opcode()) { 725 switch (node->opcode()) {
726 case IrOpcode::kStart: 726 case IrOpcode::kStart:
727 case IrOpcode::kLoop: 727 case IrOpcode::kLoop:
728 case IrOpcode::kEnd: 728 case IrOpcode::kEnd:
729 case IrOpcode::kBranch: 729 case IrOpcode::kBranch:
730 case IrOpcode::kIfTrue: 730 case IrOpcode::kIfTrue:
731 case IrOpcode::kIfFalse: 731 case IrOpcode::kIfFalse:
732 case IrOpcode::kIfSuccess: 732 case IrOpcode::kIfSuccess:
733 case IrOpcode::kIfException:
734 case IrOpcode::kSwitch: 733 case IrOpcode::kSwitch:
735 case IrOpcode::kIfValue: 734 case IrOpcode::kIfValue:
736 case IrOpcode::kIfDefault: 735 case IrOpcode::kIfDefault:
737 case IrOpcode::kEffectPhi: 736 case IrOpcode::kEffectPhi:
738 case IrOpcode::kMerge: 737 case IrOpcode::kMerge:
739 // No code needed for these graph artifacts. 738 // No code needed for these graph artifacts.
740 return; 739 return;
740 case IrOpcode::kIfException:
741 return VisitIfException(node);
Benedikt Meurer 2015/03/10 09:42:08 MarkAsReference is missing.
Michael Starzinger 2015/03/31 11:58:44 Done.
741 case IrOpcode::kFinish: 742 case IrOpcode::kFinish:
742 return MarkAsReference(node), VisitFinish(node); 743 return MarkAsReference(node), VisitFinish(node);
743 case IrOpcode::kParameter: { 744 case IrOpcode::kParameter: {
744 MachineType type = linkage()->GetParameterType(OpParameter<int>(node)); 745 MachineType type = linkage()->GetParameterType(OpParameter<int>(node));
745 MarkAsRepresentation(type, node); 746 MarkAsRepresentation(type, node);
746 return VisitParameter(node); 747 return VisitParameter(node);
747 } 748 }
748 case IrOpcode::kOsrValue: 749 case IrOpcode::kOsrValue:
749 return MarkAsReference(node), VisitOsrValue(node); 750 return MarkAsReference(node), VisitOsrValue(node);
750 case IrOpcode::kPhi: { 751 case IrOpcode::kPhi: {
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
1035 1036
1036 void InstructionSelector::VisitParameter(Node* node) { 1037 void InstructionSelector::VisitParameter(Node* node) {
1037 OperandGenerator g(this); 1038 OperandGenerator g(this);
1038 int index = OpParameter<int>(node); 1039 int index = OpParameter<int>(node);
1039 Emit(kArchNop, 1040 Emit(kArchNop,
1040 g.DefineAsLocation(node, linkage()->GetParameterLocation(index), 1041 g.DefineAsLocation(node, linkage()->GetParameterLocation(index),
1041 linkage()->GetParameterType(index))); 1042 linkage()->GetParameterType(index)));
1042 } 1043 }
1043 1044
1044 1045
1046 void InstructionSelector::VisitIfException(Node* node) {
1047 OperandGenerator g(this);
1048 Node* call = node->InputAt(0);
1049 DCHECK_EQ(IrOpcode::kCall, call->opcode());
1050 const CallDescriptor* descriptor = OpParameter<const CallDescriptor*>(call);
1051 Emit(kArchNop, g.DefineAsLocation(node, descriptor->GetReturnLocation(0),
1052 descriptor->GetReturnType(0)));
1053 }
1054
1055
1045 void InstructionSelector::VisitOsrValue(Node* node) { 1056 void InstructionSelector::VisitOsrValue(Node* node) {
1046 OperandGenerator g(this); 1057 OperandGenerator g(this);
1047 int index = OpParameter<int>(node); 1058 int index = OpParameter<int>(node);
1048 Emit(kArchNop, g.DefineAsLocation(node, linkage()->GetOsrValueLocation(index), 1059 Emit(kArchNop, g.DefineAsLocation(node, linkage()->GetOsrValueLocation(index),
1049 kMachAnyTagged)); 1060 kMachAnyTagged));
1050 } 1061 }
1051 1062
1052 1063
1053 void InstructionSelector::VisitPhi(Node* node) { 1064 void InstructionSelector::VisitPhi(Node* node) {
1054 const int input_count = node->op()->ValueInputCount(); 1065 const int input_count = node->op()->ValueInputCount();
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
1271 MachineOperatorBuilder::Flags 1282 MachineOperatorBuilder::Flags
1272 InstructionSelector::SupportedMachineOperatorFlags() { 1283 InstructionSelector::SupportedMachineOperatorFlags() {
1273 return MachineOperatorBuilder::Flag::kNoFlags; 1284 return MachineOperatorBuilder::Flag::kNoFlags;
1274 } 1285 }
1275 1286
1276 #endif // !V8_TURBOFAN_BACKEND 1287 #endif // !V8_TURBOFAN_BACKEND
1277 1288
1278 } // namespace compiler 1289 } // namespace compiler
1279 } // namespace internal 1290 } // namespace internal
1280 } // namespace v8 1291 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698