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

Unified Diff: src/compiler/simplified-operator-reducer.cc

Issue 552653003: [turbofan] Fix the node matchers. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address nit. Created 6 years, 3 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/representation-change.h ('k') | src/compiler/typer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/simplified-operator-reducer.cc
diff --git a/src/compiler/simplified-operator-reducer.cc b/src/compiler/simplified-operator-reducer.cc
index 1f7369cbcc93c8855b8b60e803725f1490f8030d..2b75956edd72f1f29025bbc401901c17b3b99135 100644
--- a/src/compiler/simplified-operator-reducer.cc
+++ b/src/compiler/simplified-operator-reducer.cc
@@ -18,11 +18,11 @@ SimplifiedOperatorReducer::~SimplifiedOperatorReducer() {}
Reduction SimplifiedOperatorReducer::Reduce(Node* node) {
switch (node->opcode()) {
case IrOpcode::kBooleanNot: {
- HeapObjectMatcher m(node->InputAt(0));
- if (m.IsKnownGlobal(factory()->false_value())) {
+ HeapObjectMatcher<HeapObject> m(node->InputAt(0));
+ if (m.Is(Unique<HeapObject>::CreateImmovable(factory()->false_value()))) {
return Replace(jsgraph()->TrueConstant());
}
- if (m.IsKnownGlobal(factory()->true_value())) {
+ if (m.Is(Unique<HeapObject>::CreateImmovable(factory()->true_value()))) {
return Replace(jsgraph()->FalseConstant());
}
if (m.IsBooleanNot()) return Replace(m.node()->InputAt(0));
@@ -36,9 +36,13 @@ Reduction SimplifiedOperatorReducer::Reduce(Node* node) {
break;
}
case IrOpcode::kChangeBoolToBit: {
- HeapObjectMatcher m(node->InputAt(0));
- if (m.IsKnownGlobal(factory()->false_value())) return ReplaceInt32(0);
- if (m.IsKnownGlobal(factory()->true_value())) return ReplaceInt32(1);
+ HeapObjectMatcher<HeapObject> m(node->InputAt(0));
+ if (m.Is(Unique<HeapObject>::CreateImmovable(factory()->false_value()))) {
+ return ReplaceInt32(0);
+ }
+ if (m.Is(Unique<HeapObject>::CreateImmovable(factory()->true_value()))) {
+ return ReplaceInt32(1);
+ }
if (m.IsChangeBitToBool()) return Replace(m.node()->InputAt(0));
break;
}
@@ -53,7 +57,7 @@ Reduction SimplifiedOperatorReducer::Reduce(Node* node) {
break;
}
case IrOpcode::kChangeTaggedToFloat64: {
- Float64Matcher m(node->InputAt(0));
+ NumberMatcher m(node->InputAt(0));
if (m.HasValue()) return ReplaceFloat64(m.Value());
if (m.IsChangeFloat64ToTagged()) return Replace(m.node()->InputAt(0));
if (m.IsChangeInt32ToTagged()) {
@@ -67,7 +71,7 @@ Reduction SimplifiedOperatorReducer::Reduce(Node* node) {
break;
}
case IrOpcode::kChangeTaggedToInt32: {
- Float64Matcher m(node->InputAt(0));
+ NumberMatcher m(node->InputAt(0));
if (m.HasValue()) return ReplaceInt32(DoubleToInt32(m.Value()));
if (m.IsChangeFloat64ToTagged()) {
return Change(node, machine()->ChangeFloat64ToInt32(),
@@ -77,7 +81,7 @@ Reduction SimplifiedOperatorReducer::Reduce(Node* node) {
break;
}
case IrOpcode::kChangeTaggedToUint32: {
- Float64Matcher m(node->InputAt(0));
+ NumberMatcher m(node->InputAt(0));
if (m.HasValue()) return ReplaceUint32(DoubleToUint32(m.Value()));
if (m.IsChangeFloat64ToTagged()) {
return Change(node, machine()->ChangeFloat64ToUint32(),
« no previous file with comments | « src/compiler/representation-change.h ('k') | src/compiler/typer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698