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

Unified Diff: src/compiler/typer.cc

Issue 2285213002: [turbofan] Assign appropriate types to some Date builtins. (Closed)
Patch Set: Created 4 years, 4 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/type-cache.h ('k') | src/objects.h » ('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 3c5533c564298fb3e5b9b02f25e61fc55653ef63..543a40a47f604b89dd0e5ad6a710a5873c4b01cc 100644
--- a/src/compiler/typer.cc
+++ b/src/compiler/typer.cc
@@ -1335,6 +1335,27 @@ Type* Typer::Visitor::JSCallFunctionTyper(Type* fun, Typer* t) {
return Type::Signed32();
case kMathClz32:
return t->cache_.kZeroToThirtyTwo;
+ // Date functions.
+ case kDateGetFullYear:
+ return Type::Union(Type::Range(-271821.0, 275760.0, t->zone()),
+ Type::NaN(), t->zone());
+ case kDateGetDate:
+ return Type::Union(Type::Range(1.0, 31.0, t->zone()), Type::NaN(),
+ t->zone());
+ case kDateGetHours:
+ return Type::Union(Type::Range(0.0, 23.0, t->zone()), Type::NaN(),
+ t->zone());
+ case kDateGetMilliseconds:
+ return Type::Union(Type::Range(0.0, 59.0, t->zone()), Type::NaN(),
+ t->zone());
+ case kDateGetMonth:
+ return Type::Union(Type::Range(0.0, 11.0, t->zone()), Type::NaN(),
+ t->zone());
+ case kDateGetSeconds:
+ return Type::Union(Type::Range(0.0, 59.0, t->zone()), Type::NaN(),
+ t->zone());
+ case kDateGetTime:
+ return t->cache_.kJSDateValueType;
// Number functions.
case kNumberParseInt:
return t->cache_.kIntegerOrMinusZeroOrNaN;
« no previous file with comments | « src/compiler/type-cache.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698