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

Unified Diff: src/compiler/code-generator.cc

Issue 2503763003: Reland of [turbofan] Fix deoptimization of boolean bit constants. (patchset #1 id:1 of https://code… (Closed)
Patch Set: Created 4 years, 1 month 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 | « no previous file | 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/code-generator.cc
diff --git a/src/compiler/code-generator.cc b/src/compiler/code-generator.cc
index 059e62914c4e463bd7c3c8513d80838897dd75a2..a7c2c65c0856a72fd33f832528c42eca167bd5c9 100644
--- a/src/compiler/code-generator.cc
+++ b/src/compiler/code-generator.cc
@@ -872,12 +872,18 @@ void CodeGenerator::AddTranslationForOperand(Translation* translation,
constant_object =
handle(reinterpret_cast<Smi*>(constant.ToInt32()), isolate());
DCHECK(constant_object->IsSmi());
+ } else if (type.representation() == MachineRepresentation::kBit) {
+ if (constant.ToInt32() == 0) {
+ constant_object = isolate()->factory()->false_value();
+ } else {
+ DCHECK_EQ(1, constant.ToInt32());
+ constant_object = isolate()->factory()->true_value();
+ }
} else {
// TODO(jarin,bmeurer): We currently pass in raw pointers to the
// JSFunction::entry here. We should really consider fixing this.
DCHECK(type == MachineType::Int32() ||
type == MachineType::Uint32() ||
- type.representation() == MachineRepresentation::kBit ||
type.representation() == MachineRepresentation::kWord32 ||
type.representation() == MachineRepresentation::kNone);
DCHECK(type.representation() != MachineRepresentation::kNone ||
« no previous file with comments | « no previous file | src/compiler/simplified-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698