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

Unified Diff: src/compiler/representation-change.cc

Issue 2611523002: [Turbofan] Simplified lowering to be done concurrently. (Closed)
Patch Set: Constant fold on canonical handles. Created 3 years, 12 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/pipeline.cc ('k') | src/compiler/simplified-lowering.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/representation-change.cc
diff --git a/src/compiler/representation-change.cc b/src/compiler/representation-change.cc
index 6e1341321cf2dc81ce51879b7be943810ae5000f..7002b2d9b27b6c47e43632f03afd633cc928c5b7 100644
--- a/src/compiler/representation-change.cc
+++ b/src/compiler/representation-change.cc
@@ -9,6 +9,7 @@
#include "src/base/bits.h"
#include "src/code-factory.h"
#include "src/compiler/machine-operator.h"
+#include "src/compiler/node-matchers.h"
namespace v8 {
namespace internal {
@@ -694,8 +695,12 @@ Node* RepresentationChanger::GetBitRepresentationFor(
// Eagerly fold representation changes for constants.
switch (node->opcode()) {
case IrOpcode::kHeapConstant: {
- Handle<HeapObject> value = OpParameter<Handle<HeapObject>>(node);
- return jsgraph()->Int32Constant(value->BooleanValue() ? 1 : 0);
+ HeapObjectMatcher m(node);
+ if (m.Is(factory()->false_value())) {
+ return jsgraph()->Int32Constant(0);
+ } else if (m.Is(factory()->true_value())) {
+ return jsgraph()->Int32Constant(1);
+ }
}
default:
break;
« no previous file with comments | « src/compiler/pipeline.cc ('k') | src/compiler/simplified-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698