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

Unified Diff: src/compiler/js-typed-lowering.cc

Issue 2309953002: [turbofan] Introduce dedicated NumberToBoolean operator. (Closed)
Patch Set: Fix unittest. 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 | « no previous file | src/compiler/opcodes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-typed-lowering.cc
diff --git a/src/compiler/js-typed-lowering.cc b/src/compiler/js-typed-lowering.cc
index 8da053e3573d8a85f7f86d275e33e9bb54e0e43c..f1b82fa767d916e954c953bb18ca7cb8e883da51 100644
--- a/src/compiler/js-typed-lowering.cc
+++ b/src/compiler/js-typed-lowering.cc
@@ -777,12 +777,10 @@ Reduction JSTypedLowering::ReduceJSToBoolean(Node* node) {
NodeProperties::ChangeOp(node, simplified()->BooleanNot());
return Changed(node);
} else if (input_type->Is(Type::Number())) {
- // JSToBoolean(x:number) => NumberLessThan(#0,NumberAbs(x))
+ // JSToBoolean(x:number) => NumberToBoolean(x)
RelaxEffectsAndControls(node);
- node->ReplaceInput(0, jsgraph()->ZeroConstant());
- node->ReplaceInput(1, graph()->NewNode(simplified()->NumberAbs(), input));
- node->TrimInputCount(2);
- NodeProperties::ChangeOp(node, simplified()->NumberLessThan());
+ node->TrimInputCount(1);
+ NodeProperties::ChangeOp(node, simplified()->NumberToBoolean());
return Changed(node);
} else if (input_type->Is(Type::String())) {
// JSToBoolean(x:string) => NumberLessThan(#0,x.length)
« no previous file with comments | « no previous file | src/compiler/opcodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698