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/verifier.h" | 5 #include "src/compiler/verifier.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <deque> | 8 #include <deque> |
9 #include <queue> | 9 #include <queue> |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 CHECK_EQ(2, input_count); | 311 CHECK_EQ(2, input_count); |
312 // Type is empty. | 312 // Type is empty. |
313 CheckNotTyped(node); | 313 CheckNotTyped(node); |
314 break; | 314 break; |
315 | 315 |
316 // Common operators | 316 // Common operators |
317 // ---------------- | 317 // ---------------- |
318 case IrOpcode::kParameter: { | 318 case IrOpcode::kParameter: { |
319 // Parameters have the start node as inputs. | 319 // Parameters have the start node as inputs. |
320 CHECK_EQ(1, input_count); | 320 CHECK_EQ(1, input_count); |
321 CHECK_EQ(IrOpcode::kStart, | |
322 NodeProperties::GetValueInput(node, 0)->opcode()); | |
323 // Parameter has an input that produces enough values. | 321 // Parameter has an input that produces enough values. |
324 int index = OpParameter<int>(node); | 322 int const index = ParameterIndexOf(node->op()); |
325 Node* input = NodeProperties::GetValueInput(node, 0); | 323 Node* const start = NodeProperties::GetValueInput(node, 0); |
| 324 CHECK_EQ(IrOpcode::kStart, start->opcode()); |
326 // Currently, parameter indices start at -1 instead of 0. | 325 // Currently, parameter indices start at -1 instead of 0. |
327 CHECK_GT(input->op()->ValueOutputCount(), index + 1); | 326 CHECK_LE(-1, index); |
| 327 CHECK_LT(index + 1, start->op()->ValueOutputCount()); |
328 // Type can be anything. | 328 // Type can be anything. |
329 CheckUpperIs(node, Type::Any()); | 329 CheckUpperIs(node, Type::Any()); |
330 break; | 330 break; |
331 } | 331 } |
332 case IrOpcode::kInt32Constant: // TODO(rossberg): rename Word32Constant? | 332 case IrOpcode::kInt32Constant: // TODO(rossberg): rename Word32Constant? |
333 // Constants have no inputs. | 333 // Constants have no inputs. |
334 CHECK_EQ(0, input_count); | 334 CHECK_EQ(0, input_count); |
335 // Type is a 32 bit integer, signed or unsigned. | 335 // Type is a 32 bit integer, signed or unsigned. |
336 CheckUpperIs(node, Type::Integral32()); | 336 CheckUpperIs(node, Type::Integral32()); |
337 break; | 337 break; |
(...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1148 // Check inputs for all nodes in the block. | 1148 // Check inputs for all nodes in the block. |
1149 for (size_t i = 0; i < block->NodeCount(); i++) { | 1149 for (size_t i = 0; i < block->NodeCount(); i++) { |
1150 Node* node = block->NodeAt(i); | 1150 Node* node = block->NodeAt(i); |
1151 CheckInputsDominate(schedule, block, node, static_cast<int>(i) - 1); | 1151 CheckInputsDominate(schedule, block, node, static_cast<int>(i) - 1); |
1152 } | 1152 } |
1153 } | 1153 } |
1154 } | 1154 } |
1155 } // namespace compiler | 1155 } // namespace compiler |
1156 } // namespace internal | 1156 } // namespace internal |
1157 } // namespace v8 | 1157 } // namespace v8 |
OLD | NEW |