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

Unified Diff: src/compiler/typer.cc

Issue 1057813002: Fixed the range information for string lengths. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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/js-typed-lowering.cc ('k') | test/unittests/compiler/js-intrinsic-lowering-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/typer.cc
diff --git a/src/compiler/typer.cc b/src/compiler/typer.cc
index 9da27443d9330506e705de607070b5a02f799242..1507f20dc8fd77d0dc3db9ae3afc8c4bfff2f8ce 100644
--- a/src/compiler/typer.cc
+++ b/src/compiler/typer.cc
@@ -1580,9 +1580,7 @@ Bounds Typer::Visitor::TypeJSCallRuntime(Node* node) {
case Runtime::kInlineMathClz32:
return Bounds(Type::None(), Type::Range(0, 32, zone()));
case Runtime::kInlineStringGetLength:
- // The string::length property is always an unsigned smi.
- return Bounds(Type::None(), Type::Intersect(Type::UnsignedSmall(),
- Type::TaggedSigned()));
+ return Bounds(Type::None(), Type::Range(0, String::kMaxLength, zone()));
default:
break;
}
« no previous file with comments | « src/compiler/js-typed-lowering.cc ('k') | test/unittests/compiler/js-intrinsic-lowering-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698