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

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

Issue 2649703002: [Atomics] Make Atomics.compareExchange a builtin using TF (Closed)
Patch Set: rebase and move cmpxchg to builtins-sharedarraybuffer-gen.cc 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 break; 144 break;
145 } 145 }
146 case IrOpcode::kAtomicStore: 146 case IrOpcode::kAtomicStore:
147 representation_vector_[node->id()] = 147 representation_vector_[node->id()] =
148 PromoteRepresentation(AtomicStoreRepresentationOf(node->op())); 148 PromoteRepresentation(AtomicStoreRepresentationOf(node->op()));
149 break; 149 break;
150 case IrOpcode::kAtomicExchange: 150 case IrOpcode::kAtomicExchange:
151 representation_vector_[node->id()] = PromoteRepresentation( 151 representation_vector_[node->id()] = PromoteRepresentation(
152 AtomicExchangeRepresentationOf(node->op()).representation()); 152 AtomicExchangeRepresentationOf(node->op()).representation());
153 break; 153 break;
154 case IrOpcode::kAtomicCompareExchange:
155 representation_vector_[node->id()] = PromoteRepresentation(
156 AtomicCompareExchangeRepresentationOf(node->op())
157 .representation());
158 break;
154 case IrOpcode::kStore: 159 case IrOpcode::kStore:
155 case IrOpcode::kProtectedStore: 160 case IrOpcode::kProtectedStore:
156 representation_vector_[node->id()] = PromoteRepresentation( 161 representation_vector_[node->id()] = PromoteRepresentation(
157 StoreRepresentationOf(node->op()).representation()); 162 StoreRepresentationOf(node->op()).representation());
158 break; 163 break;
159 case IrOpcode::kCheckedStore: 164 case IrOpcode::kCheckedStore:
160 representation_vector_[node->id()] = 165 representation_vector_[node->id()] =
161 PromoteRepresentation(CheckedStoreRepresentationOf(node->op())); 166 PromoteRepresentation(CheckedStoreRepresentationOf(node->op()));
162 break; 167 break;
163 case IrOpcode::kUnalignedStore: 168 case IrOpcode::kUnalignedStore:
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 case MachineRepresentation::kTagged: 458 case MachineRepresentation::kTagged:
454 case MachineRepresentation::kTaggedPointer: 459 case MachineRepresentation::kTaggedPointer:
455 case MachineRepresentation::kTaggedSigned: 460 case MachineRepresentation::kTaggedSigned:
456 CheckValueInputIsTagged(node, 2); 461 CheckValueInputIsTagged(node, 2);
457 break; 462 break;
458 default: 463 default:
459 CheckValueInputRepresentationIs( 464 CheckValueInputRepresentationIs(
460 node, 2, inferrer_->GetRepresentation(node)); 465 node, 2, inferrer_->GetRepresentation(node));
461 } 466 }
462 break; 467 break;
468 case IrOpcode::kAtomicCompareExchange:
469 CheckValueInputIsTaggedOrPointer(node, 0);
470 CheckValueInputRepresentationIs(
471 node, 1, MachineType::PointerRepresentation());
472 switch (inferrer_->GetRepresentation(node)) {
473 case MachineRepresentation::kTagged:
474 case MachineRepresentation::kTaggedPointer:
475 case MachineRepresentation::kTaggedSigned:
476 CheckValueInputIsTagged(node, 2);
477 CheckValueInputIsTagged(node, 3);
478 break;
479 default:
480 CheckValueInputRepresentationIs(
481 node, 2, inferrer_->GetRepresentation(node));
482 CheckValueInputRepresentationIs(
483 node, 3, inferrer_->GetRepresentation(node));
484 }
485 break;
463 case IrOpcode::kPhi: 486 case IrOpcode::kPhi:
464 switch (inferrer_->GetRepresentation(node)) { 487 switch (inferrer_->GetRepresentation(node)) {
465 case MachineRepresentation::kTagged: 488 case MachineRepresentation::kTagged:
466 case MachineRepresentation::kTaggedPointer: 489 case MachineRepresentation::kTaggedPointer:
467 case MachineRepresentation::kTaggedSigned: 490 case MachineRepresentation::kTaggedSigned:
468 for (int i = 0; i < node->op()->ValueInputCount(); ++i) { 491 for (int i = 0; i < node->op()->ValueInputCount(); ++i) {
469 CheckValueInputIsTagged(node, i); 492 CheckValueInputIsTagged(node, i);
470 } 493 }
471 break; 494 break;
472 case MachineRepresentation::kWord32: 495 case MachineRepresentation::kWord32:
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698