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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: src/compiler/machine-graph-verifier.cc
diff --git a/src/compiler/machine-graph-verifier.cc b/src/compiler/machine-graph-verifier.cc
index d245779875c41b817c68553912428252167a34cd..9377affe55132e413a79c2833a786bf30c478bd6 100644
--- a/src/compiler/machine-graph-verifier.cc
+++ b/src/compiler/machine-graph-verifier.cc
@@ -151,6 +151,11 @@ class MachineRepresentationInferrer {
representation_vector_[node->id()] = PromoteRepresentation(
AtomicExchangeRepresentationOf(node->op()).representation());
break;
+ case IrOpcode::kAtomicCompareExchange:
+ representation_vector_[node->id()] = PromoteRepresentation(
+ AtomicCompareExchangeRepresentationOf(node->op())
+ .representation());
+ break;
case IrOpcode::kStore:
case IrOpcode::kProtectedStore:
representation_vector_[node->id()] = PromoteRepresentation(
@@ -460,6 +465,24 @@ class MachineRepresentationChecker {
node, 2, inferrer_->GetRepresentation(node));
}
break;
+ case IrOpcode::kAtomicCompareExchange:
+ CheckValueInputIsTaggedOrPointer(node, 0);
+ CheckValueInputRepresentationIs(
+ node, 1, MachineType::PointerRepresentation());
+ switch (inferrer_->GetRepresentation(node)) {
+ case MachineRepresentation::kTagged:
+ case MachineRepresentation::kTaggedPointer:
+ case MachineRepresentation::kTaggedSigned:
+ CheckValueInputIsTagged(node, 2);
+ CheckValueInputIsTagged(node, 3);
+ break;
+ default:
+ CheckValueInputRepresentationIs(
+ node, 2, inferrer_->GetRepresentation(node));
+ CheckValueInputRepresentationIs(
+ node, 3, inferrer_->GetRepresentation(node));
+ }
+ break;
case IrOpcode::kPhi:
switch (inferrer_->GetRepresentation(node)) {
case MachineRepresentation::kTagged:

Powered by Google App Engine
This is Rietveld 408576698