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

Unified Diff: src/compiler/simplified-lowering.cc

Issue 2167593002: [turbofan] Introduce TruncateTaggedToBit operator for ToBoolean truncation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix remaining bugs. Created 4 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.cc ('k') | src/compiler/simplified-operator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/simplified-lowering.cc
diff --git a/src/compiler/simplified-lowering.cc b/src/compiler/simplified-lowering.cc
index f50ba3ccfc64d3186edae9ea6455db36adbca59d..c7700068026500611b6ac30a74c7675b6500b461 100644
--- a/src/compiler/simplified-lowering.cc
+++ b/src/compiler/simplified-lowering.cc
@@ -1343,6 +1343,18 @@ class RepresentationSelector {
//------------------------------------------------------------------
// JavaScript operators.
//------------------------------------------------------------------
+ case IrOpcode::kJSToBoolean: {
+ if (truncation.IsUsedAsBool()) {
+ ProcessInput(node, 0, UseInfo::Bool());
+ ProcessInput(node, 1, UseInfo::None());
+ SetOutput(node, MachineRepresentation::kBit);
+ if (lower()) DeferReplacement(node, node->InputAt(0));
+ } else {
+ VisitInputs(node);
+ SetOutput(node, MachineRepresentation::kTagged);
+ }
+ return;
+ }
case IrOpcode::kJSToNumber: {
VisitInputs(node);
// TODO(bmeurer): Optimize somewhat based on input type?
@@ -2465,7 +2477,6 @@ class RepresentationSelector {
JS_CONTEXT_OP_LIST(OPCODE_CASE)
JS_OTHER_OP_LIST(OPCODE_CASE)
#undef OPCODE_CASE
- case IrOpcode::kJSToBoolean:
case IrOpcode::kJSToInteger:
case IrOpcode::kJSToLength:
case IrOpcode::kJSToName:
« no previous file with comments | « src/compiler/representation-change.cc ('k') | src/compiler/simplified-operator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698