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

Unified Diff: src/compiler/type-cache.h

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/js-builtin-reducer.cc ('k') | 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 240e8bd006bbc70fc760e994f4588b5c821e7384..1f2dda816df3fd295ee83a54d9146abde1aeac56 100644
--- a/src/compiler/type-cache.h
+++ b/src/compiler/type-cache.h
@@ -5,6 +5,7 @@
#ifndef V8_COMPILER_TYPE_CACHE_H_
#define V8_COMPILER_TYPE_CACHE_H_
+#include "src/date.h"
#include "src/types.h"
namespace v8 {
@@ -103,6 +104,12 @@ class TypeCache final {
Type* const kStringLengthType =
CreateNative(CreateRange(0.0, String::kMaxLength), Type::TaggedSigned());
+ // The JSDate::value properties 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());
+
#define TYPED_ARRAY(TypeName, type_name, TYPE_NAME, ctype, size) \
Type* const k##TypeName##Array = CreateArray(k##TypeName);
TYPED_ARRAYS(TYPED_ARRAY)
« no previous file with comments | « src/compiler/js-builtin-reducer.cc ('k') | src/compiler/typer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698