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

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

Issue 2440333002: [turbofan] Fix typed lowering of JSToLength. (Closed)
Patch Set: Created 4 years, 2 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 | test/mjsunit/regress/regress-crbug-657478.js » ('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 efa748d49265b36cf44fb12c8474fe49b10c9b4f..9f6700bda614e51e88db0bfaa1521694cbcaeaaf 100644
--- a/src/compiler/js-typed-lowering.cc
+++ b/src/compiler/js-typed-lowering.cc
@@ -983,23 +983,12 @@ Reduction JSTypedLowering::ReduceJSToLength(Node* node) {
input = jsgraph()->Constant(kMaxSafeInteger);
} else {
if (input_type->Min() <= 0.0) {
- input = graph()->NewNode(
- common()->Select(MachineRepresentation::kTagged),
- graph()->NewNode(simplified()->NumberLessThanOrEqual(), input,
- jsgraph()->ZeroConstant()),
- jsgraph()->ZeroConstant(), input);
- input_type = Type::Range(0.0, input_type->Max(), graph()->zone());
- NodeProperties::SetType(input, input_type);
+ input = graph()->NewNode(simplified()->NumberMax(),
+ jsgraph()->ZeroConstant(), input);
}
if (input_type->Max() > kMaxSafeInteger) {
- input = graph()->NewNode(
- common()->Select(MachineRepresentation::kTagged),
- graph()->NewNode(simplified()->NumberLessThanOrEqual(),
- jsgraph()->Constant(kMaxSafeInteger), input),
- jsgraph()->Constant(kMaxSafeInteger), input);
- input_type =
- Type::Range(input_type->Min(), kMaxSafeInteger, graph()->zone());
- NodeProperties::SetType(input, input_type);
+ input = graph()->NewNode(simplified()->NumberMin(),
+ jsgraph()->Constant(kMaxSafeInteger), input);
}
}
ReplaceWithValue(node, input);
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-657478.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698