| 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> |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "src/bit-vector.h" | 13 #include "src/bit-vector.h" |
| 14 #include "src/compiler/all-nodes.h" | 14 #include "src/compiler/all-nodes.h" |
| 15 #include "src/compiler/common-operator.h" | 15 #include "src/compiler/common-operator.h" |
| 16 #include "src/compiler/graph.h" | 16 #include "src/compiler/graph.h" |
| 17 #include "src/compiler/js-operator.h" | 17 #include "src/compiler/js-operator.h" |
| 18 #include "src/compiler/node-properties.h" | 18 #include "src/compiler/node-properties.h" |
| 19 #include "src/compiler/node.h" | 19 #include "src/compiler/node.h" |
| 20 #include "src/compiler/opcodes.h" | 20 #include "src/compiler/opcodes.h" |
| 21 #include "src/compiler/operator-properties.h" | 21 #include "src/compiler/operator-properties.h" |
| 22 #include "src/compiler/operator.h" | 22 #include "src/compiler/operator.h" |
| 23 #include "src/compiler/schedule.h" | 23 #include "src/compiler/schedule.h" |
| 24 #include "src/compiler/simplified-operator.h" | 24 #include "src/compiler/simplified-operator.h" |
| 25 #include "src/compiler/type-cache.h" |
| 25 #include "src/ostreams.h" | 26 #include "src/ostreams.h" |
| 26 | 27 |
| 27 namespace v8 { | 28 namespace v8 { |
| 28 namespace internal { | 29 namespace internal { |
| 29 namespace compiler { | 30 namespace compiler { |
| 30 | 31 |
| 31 | 32 |
| 32 class Verifier::Visitor { | 33 class Verifier::Visitor { |
| 33 public: | 34 public: |
| 34 Visitor(Zone* z, Typing typed, CheckInputs check_inputs) | 35 Visitor(Zone* z, Typing typed, CheckInputs check_inputs) |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 for (int i = 0; i < 3; ++i) { | 490 for (int i = 0; i < 3; ++i) { |
| 490 CHECK(NodeProperties::GetValueInput(node, i)->opcode() == | 491 CHECK(NodeProperties::GetValueInput(node, i)->opcode() == |
| 491 IrOpcode::kStateValues || | 492 IrOpcode::kStateValues || |
| 492 NodeProperties::GetValueInput(node, i)->opcode() == | 493 NodeProperties::GetValueInput(node, i)->opcode() == |
| 493 IrOpcode::kTypedStateValues); | 494 IrOpcode::kTypedStateValues); |
| 494 } | 495 } |
| 495 break; | 496 break; |
| 496 } | 497 } |
| 497 case IrOpcode::kStateValues: | 498 case IrOpcode::kStateValues: |
| 498 case IrOpcode::kTypedStateValues: | 499 case IrOpcode::kTypedStateValues: |
| 499 case IrOpcode::kArgumentsObjectState: | 500 case IrOpcode::kArgumentsElementsState: |
| 500 case IrOpcode::kObjectState: | 501 case IrOpcode::kObjectState: |
| 501 case IrOpcode::kTypedObjectState: | 502 case IrOpcode::kTypedObjectState: |
| 502 // TODO(jarin): what are the constraints on these? | 503 // TODO(jarin): what are the constraints on these? |
| 503 break; | 504 break; |
| 504 case IrOpcode::kCall: | 505 case IrOpcode::kCall: |
| 505 // TODO(rossberg): what are the constraints on these? | 506 // TODO(rossberg): what are the constraints on these? |
| 506 break; | 507 break; |
| 507 case IrOpcode::kTailCall: | 508 case IrOpcode::kTailCall: |
| 508 // TODO(bmeurer): what are the constraints on these? | 509 // TODO(bmeurer): what are the constraints on these? |
| 509 break; | 510 break; |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 951 case IrOpcode::kObjectIsNonCallable: | 952 case IrOpcode::kObjectIsNonCallable: |
| 952 case IrOpcode::kObjectIsNumber: | 953 case IrOpcode::kObjectIsNumber: |
| 953 case IrOpcode::kObjectIsReceiver: | 954 case IrOpcode::kObjectIsReceiver: |
| 954 case IrOpcode::kObjectIsSmi: | 955 case IrOpcode::kObjectIsSmi: |
| 955 case IrOpcode::kObjectIsString: | 956 case IrOpcode::kObjectIsString: |
| 956 case IrOpcode::kObjectIsUndetectable: | 957 case IrOpcode::kObjectIsUndetectable: |
| 957 case IrOpcode::kArrayBufferWasNeutered: | 958 case IrOpcode::kArrayBufferWasNeutered: |
| 958 CheckValueInputIs(node, 0, Type::Any()); | 959 CheckValueInputIs(node, 0, Type::Any()); |
| 959 CheckTypeIs(node, Type::Boolean()); | 960 CheckTypeIs(node, Type::Boolean()); |
| 960 break; | 961 break; |
| 961 case IrOpcode::kNewRestParameterElements: | 962 case IrOpcode::kArgumentsLength: |
| 963 CheckValueInputIs(node, 0, Type::ExternalPointer()); |
| 964 CheckTypeIs(node, TypeCache::Get().kArgumentsLengthType); |
| 965 break; |
| 966 case IrOpcode::kArgumentsFrame: |
| 967 CheckTypeIs(node, Type::ExternalPointer()); |
| 968 break; |
| 962 case IrOpcode::kNewUnmappedArgumentsElements: | 969 case IrOpcode::kNewUnmappedArgumentsElements: |
| 970 CheckValueInputIs(node, 0, Type::ExternalPointer()); |
| 971 CheckValueInputIs(node, 1, Type::Range(-Code::kMaxArguments, |
| 972 Code::kMaxArguments, zone)); |
| 963 CheckTypeIs(node, Type::OtherInternal()); | 973 CheckTypeIs(node, Type::OtherInternal()); |
| 964 break; | 974 break; |
| 965 case IrOpcode::kAllocate: | 975 case IrOpcode::kAllocate: |
| 966 CheckValueInputIs(node, 0, Type::PlainNumber()); | 976 CheckValueInputIs(node, 0, Type::PlainNumber()); |
| 967 break; | 977 break; |
| 968 case IrOpcode::kEnsureWritableFastElements: | 978 case IrOpcode::kEnsureWritableFastElements: |
| 969 CheckValueInputIs(node, 0, Type::Any()); | 979 CheckValueInputIs(node, 0, Type::Any()); |
| 970 CheckValueInputIs(node, 1, Type::Internal()); | 980 CheckValueInputIs(node, 1, Type::Internal()); |
| 971 CheckTypeIs(node, Type::Internal()); | 981 CheckTypeIs(node, Type::Internal()); |
| 972 break; | 982 break; |
| (...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1707 replacement->op()->EffectOutputCount() > 0); | 1717 replacement->op()->EffectOutputCount() > 0); |
| 1708 DCHECK(!NodeProperties::IsFrameStateEdge(edge) || | 1718 DCHECK(!NodeProperties::IsFrameStateEdge(edge) || |
| 1709 replacement->opcode() == IrOpcode::kFrameState); | 1719 replacement->opcode() == IrOpcode::kFrameState); |
| 1710 } | 1720 } |
| 1711 | 1721 |
| 1712 #endif // DEBUG | 1722 #endif // DEBUG |
| 1713 | 1723 |
| 1714 } // namespace compiler | 1724 } // namespace compiler |
| 1715 } // namespace internal | 1725 } // namespace internal |
| 1716 } // namespace v8 | 1726 } // namespace v8 |
| OLD | NEW |