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

Unified Diff: src/compiler/node-properties.cc

Issue 2635243002: [turbofan] Refactor IsSame into NodeProperties. (Closed)
Patch Set: Update. Created 3 years, 11 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
« no previous file with comments | « src/compiler/node-properties.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/node-properties.cc
diff --git a/src/compiler/node-properties.cc b/src/compiler/node-properties.cc
index cc3a07d7e3616867d44729ad9d97aa96e48c0484..2e1e1bde8e83ef491ea1a7320b2b7e2429b237b7 100644
--- a/src/compiler/node-properties.cc
+++ b/src/compiler/node-properties.cc
@@ -312,6 +312,20 @@ void NodeProperties::CollectControlProjections(Node* node, Node** projections,
#endif
}
+// static
+bool NodeProperties::IsSame(Node* a, Node* b) {
+ for (;;) {
+ if (a->opcode() == IrOpcode::kCheckHeapObject) {
+ a = GetValueInput(a, 0);
+ continue;
+ }
+ if (b->opcode() == IrOpcode::kCheckHeapObject) {
+ b = GetValueInput(b, 0);
+ continue;
+ }
+ return a == b;
+ }
+}
// static
MaybeHandle<Context> NodeProperties::GetSpecializationContext(
« no previous file with comments | « src/compiler/node-properties.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698