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/type-cache.h

Issue 2528853003: [turbofan] Infer proper type for calls to Date.now. (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/typer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/type-cache.h
diff --git a/src/compiler/type-cache.h b/src/compiler/type-cache.h
index 69eaf11616c7d64f8115f5e8f875ae137f979819..ead40251599ac5a0c6fb0245e31861a7491f6fed 100644
--- a/src/compiler/type-cache.h
+++ b/src/compiler/type-cache.h
@@ -97,6 +97,11 @@ class TypeCache final {
// [0, String::kMaxLength].
Type* const kStringLengthType = CreateRange(0.0, String::kMaxLength);
+ // A time value always contains a tagged number in the range
+ // [-kMaxTimeInMs, kMaxTimeInMs].
+ Type* const kTimeValueType =
+ CreateRange(-DateCache::kMaxTimeInMs, DateCache::kMaxTimeInMs);
+
// The JSDate::day property always contains a tagged number in the range
// [1, 31] or NaN.
Type* const kJSDateDayType =
@@ -123,9 +128,8 @@ class TypeCache final {
// The JSDate::value property always contains a tagged number in the range
// [-kMaxTimeInMs, kMaxTimeInMs] or NaN.
- Type* const kJSDateValueType = Type::Union(
- CreateRange(-DateCache::kMaxTimeInMs, DateCache::kMaxTimeInMs),
- Type::NaN(), zone());
+ Type* const kJSDateValueType =
+ Type::Union(kTimeValueType, Type::NaN(), zone());
// The JSDate::weekday property always contains a tagged number in the range
// [0, 6] or NaN.
« no previous file with comments | « no previous file | src/compiler/typer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698