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

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

Issue 2115513002: [turbofan] Introduce CheckIf simplified operator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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/simplified-operator-reducer.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 e9ce0d5a660776cd29af6c2d8f29dc9f787c5f7d..46d8e2f72d5d4024c0f9a3473d0c7db9e85f80b6 100644
--- a/src/compiler/simplified-operator-reducer.cc
+++ b/src/compiler/simplified-operator-reducer.cc
@@ -43,9 +43,8 @@ Reduction SimplifiedOperatorReducer::Reduce(Node* node) {
switch (node->opcode()) {
case IrOpcode::kBooleanNot: {
HeapObjectMatcher m(node->InputAt(0));
- if (m.HasValue()) {
- return Replace(jsgraph()->BooleanConstant(!m.Value()->BooleanValue()));
- }
+ if (m.Is(factory()->true_value())) return ReplaceBoolean(false);
+ if (m.Is(factory()->false_value())) return ReplaceBoolean(true);
if (m.IsBooleanNot()) return Replace(m.InputAt(0));
break;
}
@@ -127,6 +126,14 @@ Reduction SimplifiedOperatorReducer::Reduce(Node* node) {
}
break;
}
+ case IrOpcode::kCheckIf: {
+ HeapObjectMatcher m(node->InputAt(0));
+ if (m.Is(factory()->true_value())) {
+ Node* const effect = NodeProperties::GetEffectInput(node);
+ return Replace(effect);
+ }
+ break;
+ }
case IrOpcode::kCheckTaggedPointer: {
Node* const input = node->InputAt(0);
if (DecideObjectIsSmi(input) == Decision::kFalse) {
@@ -203,9 +210,15 @@ Reduction SimplifiedOperatorReducer::ReplaceNumber(int32_t value) {
return Replace(jsgraph()->Constant(value));
}
+Factory* SimplifiedOperatorReducer::factory() const {
+ return isolate()->factory();
+}
Graph* SimplifiedOperatorReducer::graph() const { return jsgraph()->graph(); }
+Isolate* SimplifiedOperatorReducer::isolate() const {
+ return jsgraph()->isolate();
+}
MachineOperatorBuilder* SimplifiedOperatorReducer::machine() const {
return jsgraph()->machine();
« no previous file with comments | « src/compiler/simplified-operator-reducer.h ('k') | src/compiler/typer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698