| 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 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 732 CheckTypeIs(node, Type::Any()); | 732 CheckTypeIs(node, Type::Any()); |
| 733 break; | 733 break; |
| 734 case IrOpcode::kJSStoreModule: | 734 case IrOpcode::kJSStoreModule: |
| 735 CheckNotTyped(node); | 735 CheckNotTyped(node); |
| 736 break; | 736 break; |
| 737 | 737 |
| 738 case IrOpcode::kJSGeneratorStore: | 738 case IrOpcode::kJSGeneratorStore: |
| 739 CheckNotTyped(node); | 739 CheckNotTyped(node); |
| 740 break; | 740 break; |
| 741 | 741 |
| 742 case IrOpcode::kJSCreateGeneratorObject: |
| 743 CheckTypeIs(node, Type::OtherObject()); |
| 744 break; |
| 745 |
| 742 case IrOpcode::kJSGeneratorRestoreContinuation: | 746 case IrOpcode::kJSGeneratorRestoreContinuation: |
| 743 CheckTypeIs(node, Type::SignedSmall()); | 747 CheckTypeIs(node, Type::SignedSmall()); |
| 744 break; | 748 break; |
| 745 | 749 |
| 746 case IrOpcode::kJSGeneratorRestoreRegister: | 750 case IrOpcode::kJSGeneratorRestoreRegister: |
| 747 CheckTypeIs(node, Type::Any()); | 751 CheckTypeIs(node, Type::Any()); |
| 748 break; | 752 break; |
| 749 | 753 |
| 750 case IrOpcode::kJSStackCheck: | 754 case IrOpcode::kJSStackCheck: |
| 751 case IrOpcode::kJSDebugger: | 755 case IrOpcode::kJSDebugger: |
| (...skipping 947 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1699 } | 1703 } |
| 1700 | 1704 |
| 1701 | 1705 |
| 1702 #ifdef DEBUG | 1706 #ifdef DEBUG |
| 1703 | 1707 |
| 1704 // static | 1708 // static |
| 1705 void Verifier::VerifyNode(Node* node) { | 1709 void Verifier::VerifyNode(Node* node) { |
| 1706 CHECK_EQ(OperatorProperties::GetTotalInputCount(node->op()), | 1710 CHECK_EQ(OperatorProperties::GetTotalInputCount(node->op()), |
| 1707 node->InputCount()); | 1711 node->InputCount()); |
| 1708 // If this node has no effect or no control outputs, | 1712 // If this node has no effect or no control outputs, |
| 1709 // we check that no its uses are effect or control inputs. | 1713 // we check that none of its uses are effect or control inputs. |
| 1710 bool check_no_control = node->op()->ControlOutputCount() == 0; | 1714 bool check_no_control = node->op()->ControlOutputCount() == 0; |
| 1711 bool check_no_effect = node->op()->EffectOutputCount() == 0; | 1715 bool check_no_effect = node->op()->EffectOutputCount() == 0; |
| 1712 bool check_no_frame_state = node->opcode() != IrOpcode::kFrameState; | 1716 bool check_no_frame_state = node->opcode() != IrOpcode::kFrameState; |
| 1713 if (check_no_effect || check_no_control) { | 1717 if (check_no_effect || check_no_control) { |
| 1714 for (Edge edge : node->use_edges()) { | 1718 for (Edge edge : node->use_edges()) { |
| 1715 Node* const user = edge.from(); | 1719 Node* const user = edge.from(); |
| 1716 CHECK(!user->IsDead()); | 1720 CHECK(!user->IsDead()); |
| 1717 if (NodeProperties::IsControlEdge(edge)) { | 1721 if (NodeProperties::IsControlEdge(edge)) { |
| 1718 CHECK(!check_no_control); | 1722 CHECK(!check_no_control); |
| 1719 } else if (NodeProperties::IsEffectEdge(edge)) { | 1723 } else if (NodeProperties::IsEffectEdge(edge)) { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1754 replacement->op()->EffectOutputCount() > 0); | 1758 replacement->op()->EffectOutputCount() > 0); |
| 1755 DCHECK(!NodeProperties::IsFrameStateEdge(edge) || | 1759 DCHECK(!NodeProperties::IsFrameStateEdge(edge) || |
| 1756 replacement->opcode() == IrOpcode::kFrameState); | 1760 replacement->opcode() == IrOpcode::kFrameState); |
| 1757 } | 1761 } |
| 1758 | 1762 |
| 1759 #endif // DEBUG | 1763 #endif // DEBUG |
| 1760 | 1764 |
| 1761 } // namespace compiler | 1765 } // namespace compiler |
| 1762 } // namespace internal | 1766 } // namespace internal |
| 1763 } // namespace v8 | 1767 } // namespace v8 |
| OLD | NEW |