OLD | NEW |
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 944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
955 | 955 |
956 | 956 |
957 void InstructionSelector::VisitThrow(Node* value) { | 957 void InstructionSelector::VisitThrow(Node* value) { |
958 UNIMPLEMENTED(); // TODO(titzer) | 958 UNIMPLEMENTED(); // TODO(titzer) |
959 } | 959 } |
960 | 960 |
961 | 961 |
962 void InstructionSelector::FillTypeVectorFromStateValues( | 962 void InstructionSelector::FillTypeVectorFromStateValues( |
963 ZoneVector<MachineType>* types, Node* state_values) { | 963 ZoneVector<MachineType>* types, Node* state_values) { |
964 DCHECK(state_values->opcode() == IrOpcode::kStateValues); | 964 DCHECK(state_values->opcode() == IrOpcode::kStateValues); |
965 int count = OpParameter<int>(state_values); | 965 int count = state_values->InputCount(); |
966 types->reserve(static_cast<size_t>(count)); | 966 types->reserve(static_cast<size_t>(count)); |
967 for (int i = 0; i < count; i++) { | 967 for (int i = 0; i < count; i++) { |
968 types->push_back(GetMachineType(state_values->InputAt(i))); | 968 types->push_back(GetMachineType(state_values->InputAt(i))); |
969 } | 969 } |
970 } | 970 } |
971 | 971 |
972 | 972 |
973 FrameStateDescriptor* InstructionSelector::GetFrameStateDescriptor( | 973 FrameStateDescriptor* InstructionSelector::GetFrameStateDescriptor( |
974 Node* state) { | 974 Node* state) { |
975 DCHECK(state->opcode() == IrOpcode::kFrameState); | 975 DCHECK(state->opcode() == IrOpcode::kFrameState); |
976 DCHECK_EQ(5, state->InputCount()); | 976 DCHECK_EQ(5, state->InputCount()); |
| 977 DCHECK_EQ(IrOpcode::kStateValues, state->InputAt(0)->opcode()); |
| 978 DCHECK_EQ(IrOpcode::kStateValues, state->InputAt(1)->opcode()); |
| 979 DCHECK_EQ(IrOpcode::kStateValues, state->InputAt(2)->opcode()); |
977 FrameStateCallInfo state_info = OpParameter<FrameStateCallInfo>(state); | 980 FrameStateCallInfo state_info = OpParameter<FrameStateCallInfo>(state); |
978 | 981 |
979 int parameters = OpParameter<int>(state->InputAt(0)); | 982 int parameters = state->InputAt(0)->InputCount(); |
980 int locals = OpParameter<int>(state->InputAt(1)); | 983 int locals = state->InputAt(1)->InputCount(); |
981 int stack = OpParameter<int>(state->InputAt(2)); | 984 int stack = state->InputAt(2)->InputCount(); |
982 | 985 |
983 FrameStateDescriptor* outer_state = NULL; | 986 FrameStateDescriptor* outer_state = NULL; |
984 Node* outer_node = state->InputAt(4); | 987 Node* outer_node = state->InputAt(4); |
985 if (outer_node->opcode() == IrOpcode::kFrameState) { | 988 if (outer_node->opcode() == IrOpcode::kFrameState) { |
986 outer_state = GetFrameStateDescriptor(outer_node); | 989 outer_state = GetFrameStateDescriptor(outer_node); |
987 } | 990 } |
988 | 991 |
989 return new (instruction_zone()) FrameStateDescriptor( | 992 return new (instruction_zone()) FrameStateDescriptor( |
990 instruction_zone(), state_info, parameters, locals, stack, outer_state); | 993 instruction_zone(), state_info, parameters, locals, stack, outer_state); |
991 } | 994 } |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1069 void InstructionSelector::VisitBranch(Node* branch, BasicBlock* tbranch, | 1072 void InstructionSelector::VisitBranch(Node* branch, BasicBlock* tbranch, |
1070 BasicBlock* fbranch) { | 1073 BasicBlock* fbranch) { |
1071 UNIMPLEMENTED(); | 1074 UNIMPLEMENTED(); |
1072 } | 1075 } |
1073 | 1076 |
1074 #endif // !V8_TURBOFAN_BACKEND | 1077 #endif // !V8_TURBOFAN_BACKEND |
1075 | 1078 |
1076 } // namespace compiler | 1079 } // namespace compiler |
1077 } // namespace internal | 1080 } // namespace internal |
1078 } // namespace v8 | 1081 } // namespace v8 |
OLD | NEW |