| 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 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 // Type is considered internal. | 368 // Type is considered internal. |
| 369 CheckTypeIs(node, Type::Internal()); | 369 CheckTypeIs(node, Type::Internal()); |
| 370 break; | 370 break; |
| 371 case IrOpcode::kOsrValue: | 371 case IrOpcode::kOsrValue: |
| 372 // OSR values have a value and a control input. | 372 // OSR values have a value and a control input. |
| 373 CHECK_EQ(1, control_count); | 373 CHECK_EQ(1, control_count); |
| 374 CHECK_EQ(1, input_count); | 374 CHECK_EQ(1, input_count); |
| 375 // Type is merged from other values in the graph and could be any. | 375 // Type is merged from other values in the graph and could be any. |
| 376 CheckTypeIs(node, Type::Any()); | 376 CheckTypeIs(node, Type::Any()); |
| 377 break; | 377 break; |
| 378 case IrOpcode::kOsrGuard: | |
| 379 // OSR values have a value and a control input. | |
| 380 CHECK_EQ(1, value_count); | |
| 381 CHECK_EQ(1, effect_count); | |
| 382 CHECK_EQ(1, control_count); | |
| 383 switch (OsrGuardTypeOf(node->op())) { | |
| 384 case OsrGuardType::kUninitialized: | |
| 385 CheckTypeIs(node, Type::None()); | |
| 386 break; | |
| 387 case OsrGuardType::kSignedSmall: | |
| 388 CheckTypeIs(node, Type::SignedSmall()); | |
| 389 break; | |
| 390 case OsrGuardType::kAny: | |
| 391 CheckTypeIs(node, Type::Any()); | |
| 392 break; | |
| 393 } | |
| 394 break; | |
| 395 case IrOpcode::kProjection: { | 378 case IrOpcode::kProjection: { |
| 396 // Projection has an input that produces enough values. | 379 // Projection has an input that produces enough values. |
| 397 int index = static_cast<int>(ProjectionIndexOf(node->op())); | 380 int index = static_cast<int>(ProjectionIndexOf(node->op())); |
| 398 Node* input = NodeProperties::GetValueInput(node, 0); | 381 Node* input = NodeProperties::GetValueInput(node, 0); |
| 399 CHECK_GT(input->op()->ValueOutputCount(), index); | 382 CHECK_GT(input->op()->ValueOutputCount(), index); |
| 400 // Type can be anything. | 383 // Type can be anything. |
| 401 // TODO(rossberg): Introduce tuple types for this. | 384 // TODO(rossberg): Introduce tuple types for this. |
| 402 // TODO(titzer): Convince rossberg not to. | 385 // TODO(titzer): Convince rossberg not to. |
| 403 CheckTypeIs(node, Type::Any()); | 386 CheckTypeIs(node, Type::Any()); |
| 404 break; | 387 break; |
| (...skipping 1207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1612 replacement->op()->EffectOutputCount() > 0); | 1595 replacement->op()->EffectOutputCount() > 0); |
| 1613 DCHECK(!NodeProperties::IsFrameStateEdge(edge) || | 1596 DCHECK(!NodeProperties::IsFrameStateEdge(edge) || |
| 1614 replacement->opcode() == IrOpcode::kFrameState); | 1597 replacement->opcode() == IrOpcode::kFrameState); |
| 1615 } | 1598 } |
| 1616 | 1599 |
| 1617 #endif // DEBUG | 1600 #endif // DEBUG |
| 1618 | 1601 |
| 1619 } // namespace compiler | 1602 } // namespace compiler |
| 1620 } // namespace internal | 1603 } // namespace internal |
| 1621 } // namespace v8 | 1604 } // namespace v8 |
| OLD | NEW |