| 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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 break; | 302 break; |
| 303 | 303 |
| 304 // Common operators | 304 // Common operators |
| 305 // ---------------- | 305 // ---------------- |
| 306 case IrOpcode::kParameter: { | 306 case IrOpcode::kParameter: { |
| 307 // Parameters have the start node as inputs. | 307 // Parameters have the start node as inputs. |
| 308 CHECK_EQ(1, input_count); | 308 CHECK_EQ(1, input_count); |
| 309 CHECK_EQ(IrOpcode::kStart, | 309 CHECK_EQ(IrOpcode::kStart, |
| 310 NodeProperties::GetValueInput(node, 0)->opcode()); | 310 NodeProperties::GetValueInput(node, 0)->opcode()); |
| 311 // Parameter has an input that produces enough values. | 311 // Parameter has an input that produces enough values. |
| 312 int index = OpParameter<int>(node); | 312 int index = ParameterIndexOf(node->op()); |
| 313 Node* input = NodeProperties::GetValueInput(node, 0); | 313 Node* input = NodeProperties::GetValueInput(node, 0); |
| 314 // Currently, parameter indices start at -1 instead of 0. | 314 // Currently, parameter indices start at -1 instead of 0. |
| 315 CHECK_GT(input->op()->ValueOutputCount(), index + 1); | 315 CHECK_GT(input->op()->ValueOutputCount(), index + 1); |
| 316 // Type can be anything. | 316 // Type can be anything. |
| 317 CheckUpperIs(node, Type::Any()); | 317 CheckUpperIs(node, Type::Any()); |
| 318 break; | 318 break; |
| 319 } | 319 } |
| 320 case IrOpcode::kInt32Constant: // TODO(rossberg): rename Word32Constant? | 320 case IrOpcode::kInt32Constant: // TODO(rossberg): rename Word32Constant? |
| 321 // Constants have no inputs. | 321 // Constants have no inputs. |
| 322 CHECK_EQ(0, input_count); | 322 CHECK_EQ(0, input_count); |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 711 } | 711 } |
| 712 case IrOpcode::kChangeBitToBool: { | 712 case IrOpcode::kChangeBitToBool: { |
| 713 // Boolean /\ UntaggedInt1 -> Boolean /\ TaggedPtr | 713 // Boolean /\ UntaggedInt1 -> Boolean /\ TaggedPtr |
| 714 // TODO(neis): Activate once ChangeRepresentation works in typer. | 714 // TODO(neis): Activate once ChangeRepresentation works in typer. |
| 715 // Type* from = Type::Intersect(Type::Boolean(), Type::UntaggedInt1()); | 715 // Type* from = Type::Intersect(Type::Boolean(), Type::UntaggedInt1()); |
| 716 // Type* to = Type::Intersect(Type::Boolean(), Type::TaggedPtr()); | 716 // Type* to = Type::Intersect(Type::Boolean(), Type::TaggedPtr()); |
| 717 // CheckValueInputIs(node, 0, from)); | 717 // CheckValueInputIs(node, 0, from)); |
| 718 // CheckUpperIs(node, to)); | 718 // CheckUpperIs(node, to)); |
| 719 break; | 719 break; |
| 720 } | 720 } |
| 721 case IrOpcode::kCheckMaps: { |
| 722 // CheckMaps only produces control. |
| 723 CheckNotTyped(node); |
| 724 int32_t map_count = OpParameter<int32_t>(node); |
| 725 // expect [obj, map*, framestate, effect, control] |
| 726 CHECK_EQ(map_count + 4, node->InputCount()); |
| 727 CHECK_EQ(IrOpcode::kFrameState, node->InputAt(1 + map_count)->opcode()); |
| 728 break; |
| 729 } |
| 721 | 730 |
| 722 case IrOpcode::kLoadField: | 731 case IrOpcode::kLoadField: |
| 723 // Object -> fieldtype | 732 // Object -> fieldtype |
| 724 // TODO(rossberg): activate once machine ops are typed. | 733 // TODO(rossberg): activate once machine ops are typed. |
| 725 // CheckValueInputIs(node, 0, Type::Object()); | 734 // CheckValueInputIs(node, 0, Type::Object()); |
| 726 // CheckUpperIs(node, FieldAccessOf(node->op()).type)); | 735 // CheckUpperIs(node, FieldAccessOf(node->op()).type)); |
| 727 break; | 736 break; |
| 728 case IrOpcode::kLoadBuffer: | 737 case IrOpcode::kLoadBuffer: |
| 729 break; | 738 break; |
| 730 case IrOpcode::kLoadElement: | 739 case IrOpcode::kLoadElement: |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1100 // Check inputs for all nodes in the block. | 1109 // Check inputs for all nodes in the block. |
| 1101 for (size_t i = 0; i < block->NodeCount(); i++) { | 1110 for (size_t i = 0; i < block->NodeCount(); i++) { |
| 1102 Node* node = block->NodeAt(i); | 1111 Node* node = block->NodeAt(i); |
| 1103 CheckInputsDominate(schedule, block, node, static_cast<int>(i) - 1); | 1112 CheckInputsDominate(schedule, block, node, static_cast<int>(i) - 1); |
| 1104 } | 1113 } |
| 1105 } | 1114 } |
| 1106 } | 1115 } |
| 1107 } | 1116 } |
| 1108 } | 1117 } |
| 1109 } // namespace v8::internal::compiler | 1118 } // namespace v8::internal::compiler |
| OLD | NEW |