OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/machine-graph-verifier.h" | 5 #include "src/compiler/machine-graph-verifier.h" |
6 | 6 |
7 #include "src/compiler/common-operator.h" | 7 #include "src/compiler/common-operator.h" |
8 #include "src/compiler/graph.h" | 8 #include "src/compiler/graph.h" |
9 #include "src/compiler/linkage.h" | 9 #include "src/compiler/linkage.h" |
10 #include "src/compiler/machine-operator.h" | 10 #include "src/compiler/machine-operator.h" |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 break; | 145 break; |
146 } | 146 } |
147 case IrOpcode::kAtomicStore: | 147 case IrOpcode::kAtomicStore: |
148 representation_vector_[node->id()] = | 148 representation_vector_[node->id()] = |
149 PromoteRepresentation(AtomicStoreRepresentationOf(node->op())); | 149 PromoteRepresentation(AtomicStoreRepresentationOf(node->op())); |
150 break; | 150 break; |
151 case IrOpcode::kAtomicExchange: | 151 case IrOpcode::kAtomicExchange: |
152 representation_vector_[node->id()] = PromoteRepresentation( | 152 representation_vector_[node->id()] = PromoteRepresentation( |
153 AtomicExchangeRepresentationOf(node->op()).representation()); | 153 AtomicExchangeRepresentationOf(node->op()).representation()); |
154 break; | 154 break; |
| 155 case IrOpcode::kAtomicCompareExchange: |
| 156 representation_vector_[node->id()] = PromoteRepresentation( |
| 157 AtomicCompareExchangeRepresentationOf(node->op()) |
| 158 .representation()); |
| 159 break; |
155 case IrOpcode::kStore: | 160 case IrOpcode::kStore: |
156 case IrOpcode::kProtectedStore: | 161 case IrOpcode::kProtectedStore: |
157 representation_vector_[node->id()] = PromoteRepresentation( | 162 representation_vector_[node->id()] = PromoteRepresentation( |
158 StoreRepresentationOf(node->op()).representation()); | 163 StoreRepresentationOf(node->op()).representation()); |
159 break; | 164 break; |
160 case IrOpcode::kCheckedStore: | 165 case IrOpcode::kCheckedStore: |
161 representation_vector_[node->id()] = | 166 representation_vector_[node->id()] = |
162 PromoteRepresentation(CheckedStoreRepresentationOf(node->op())); | 167 PromoteRepresentation(CheckedStoreRepresentationOf(node->op())); |
163 break; | 168 break; |
164 case IrOpcode::kUnalignedStore: | 169 case IrOpcode::kUnalignedStore: |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 case MachineRepresentation::kTagged: | 456 case MachineRepresentation::kTagged: |
452 case MachineRepresentation::kTaggedPointer: | 457 case MachineRepresentation::kTaggedPointer: |
453 case MachineRepresentation::kTaggedSigned: | 458 case MachineRepresentation::kTaggedSigned: |
454 CheckValueInputIsTagged(node, 2); | 459 CheckValueInputIsTagged(node, 2); |
455 break; | 460 break; |
456 default: | 461 default: |
457 CheckValueInputRepresentationIs( | 462 CheckValueInputRepresentationIs( |
458 node, 2, inferrer_->GetRepresentation(node)); | 463 node, 2, inferrer_->GetRepresentation(node)); |
459 } | 464 } |
460 break; | 465 break; |
| 466 case IrOpcode::kAtomicCompareExchange: |
| 467 CheckValueInputIsTaggedOrPointer(node, 0); |
| 468 CheckValueInputRepresentationIs( |
| 469 node, 1, MachineType::PointerRepresentation()); |
| 470 switch (inferrer_->GetRepresentation(node)) { |
| 471 case MachineRepresentation::kTagged: |
| 472 case MachineRepresentation::kTaggedPointer: |
| 473 case MachineRepresentation::kTaggedSigned: |
| 474 CheckValueInputIsTagged(node, 2); |
| 475 CheckValueInputIsTagged(node, 3); |
| 476 break; |
| 477 default: |
| 478 CheckValueInputRepresentationIs( |
| 479 node, 2, inferrer_->GetRepresentation(node)); |
| 480 CheckValueInputRepresentationIs( |
| 481 node, 3, inferrer_->GetRepresentation(node)); |
| 482 } |
| 483 break; |
461 case IrOpcode::kPhi: | 484 case IrOpcode::kPhi: |
462 switch (inferrer_->GetRepresentation(node)) { | 485 switch (inferrer_->GetRepresentation(node)) { |
463 case MachineRepresentation::kTagged: | 486 case MachineRepresentation::kTagged: |
464 case MachineRepresentation::kTaggedPointer: | 487 case MachineRepresentation::kTaggedPointer: |
465 case MachineRepresentation::kTaggedSigned: | 488 case MachineRepresentation::kTaggedSigned: |
466 for (int i = 0; i < node->op()->ValueInputCount(); ++i) { | 489 for (int i = 0; i < node->op()->ValueInputCount(); ++i) { |
467 CheckValueInputIsTagged(node, i); | 490 CheckValueInputIsTagged(node, i); |
468 } | 491 } |
469 break; | 492 break; |
470 case MachineRepresentation::kWord32: | 493 case MachineRepresentation::kWord32: |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
802 MachineRepresentationInferrer representation_inferrer(schedule, graph, | 825 MachineRepresentationInferrer representation_inferrer(schedule, graph, |
803 linkage, temp_zone); | 826 linkage, temp_zone); |
804 MachineRepresentationChecker checker(schedule, &representation_inferrer, | 827 MachineRepresentationChecker checker(schedule, &representation_inferrer, |
805 is_stub, name); | 828 is_stub, name); |
806 checker.Run(); | 829 checker.Run(); |
807 } | 830 } |
808 | 831 |
809 } // namespace compiler | 832 } // namespace compiler |
810 } // namespace internal | 833 } // namespace internal |
811 } // namespace v8 | 834 } // namespace v8 |
OLD | NEW |