Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1155)

Side by Side Diff: src/compiler/machine-graph-verifier.cc

Issue 2649703002: [Atomics] Make Atomics.compareExchange a builtin using TF (Closed)
Patch Set: use TF_BUILTIN macro Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
800 MachineRepresentationInferrer representation_inferrer(schedule, graph, 823 MachineRepresentationInferrer representation_inferrer(schedule, graph,
801 linkage, temp_zone); 824 linkage, temp_zone);
802 MachineRepresentationChecker checker(schedule, &representation_inferrer, 825 MachineRepresentationChecker checker(schedule, &representation_inferrer,
803 is_stub, name); 826 is_stub, name);
804 checker.Run(); 827 checker.Run();
805 } 828 }
806 829
807 } // namespace compiler 830 } // namespace compiler
808 } // namespace internal 831 } // namespace internal
809 } // namespace v8 832 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698