v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
v8::internal::DateCache Class Reference

#include <date.h>

Collaboration diagram for v8::internal::DateCache:

Classes

struct  CacheItem
 

Public Member Functions

 DateCache ()
 
virtual ~DateCache ()
 
void ResetDateCache (base::TimezoneCache::TimeZoneDetection time_zone_detection)
 
int Weekday (int days)
 
bool IsLeap (int year)
 
int LocalOffsetInMs (int64_t time, bool is_utc)
 
const char * LocalTimezone (int64_t time_ms)
 
int TimezoneOffset (int64_t time_ms)
 
int64_t ToLocal (int64_t time_ms)
 
int64_t ToUTC (int64_t time_ms)
 
int64_t EquivalentTime (int64_t time_ms)
 
int EquivalentYear (int year)
 
void YearMonthDayFromDays (int days, int *year, int *month, int *day)
 
int DaysFromYearMonth (int year, int month)
 
void BreakDownTime (int64_t time_ms, int *year, int *month, int *day, int *weekday, int *hour, int *min, int *sec, int *ms)
 
Tagged< Smistamp ()
 
void * stamp_address ()
 
virtual int GetDaylightSavingsOffsetFromOS (int64_t time_sec)
 
virtual int GetLocalOffsetFromOS (int64_t time_ms, bool is_utc)
 

Static Public Member Functions

static int DaysFromTime (int64_t time_ms)
 
static int TimeInDay (int64_t time_ms, int days)
 
static bool TryTimeClip (double *time)
 

Static Public Attributes

static const int kMsPerMin = 60 * 1000
 
static const int kSecPerDay = 24 * 60 * 60
 
static const int64_t kMsPerDay = kSecPerDay * 1000
 
static const int64_t kMsPerMonth = kMsPerDay * 30
 
static const int kMaxEpochTimeInSec = kMaxInt
 
static const int64_t kMaxEpochTimeInMs = static_cast<int64_t>(kMaxInt) * 1000
 
static const int64_t kMaxTimeInMs
 
static const int64_t kMaxTimeBeforeUTCInMs = kMaxTimeInMs + kMsPerMonth
 
static const int kInvalidLocalOffsetInMs = kMaxInt
 
static const int kInvalidStamp = -1
 

Private Member Functions

int DaylightSavingsOffsetInMs (int64_t time_ms)
 
void ProbeCache (int64_t time_ms)
 
CacheItemLeastRecentlyUsedCacheItem (CacheItem *skip)
 
void ExtendTheAfterSegment (int64_t time_sec, int offset_ms)
 
void ClearSegment (CacheItem *segment)
 
bool InvalidSegment (CacheItem *segment)
 

Private Attributes

Tagged< Smistamp_
 
CacheItem cache_ [kCacheSize]
 
int cache_usage_counter_
 
CacheItembefore_
 
CacheItemafter_
 
int local_offset_ms_
 
bool ymd_valid_
 
int ymd_days_
 
int ymd_year_
 
int ymd_month_
 
int ymd_day_
 
const char * tz_name_
 
const char * dst_tz_name_
 
base::TimezoneCachetz_cache_
 

Static Private Attributes

static const int kDefaultTimeZoneOffsetDeltaInMs = 19 * kSecPerDay * 1000
 
static const int kCacheSize = 32
 

Detailed Description

Definition at line 18 of file date.h.

Constructor & Destructor Documentation

◆ DateCache()

v8::internal::DateCache::DateCache ( )

Definition at line 31 of file date.cc.

Here is the call graph for this function:

◆ ~DateCache()

virtual v8::internal::DateCache::~DateCache ( )
inlinevirtual

Definition at line 45 of file date.h.

Member Function Documentation

◆ BreakDownTime()

void v8::internal::DateCache::BreakDownTime ( int64_t time_ms,
int * year,
int * month,
int * day,
int * weekday,
int * hour,
int * min,
int * sec,
int * ms )

Definition at line 195 of file date.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ClearSegment()

void v8::internal::DateCache::ClearSegment ( CacheItem * segment)
inlineprivate

Definition at line 70 of file date.cc.

Here is the caller graph for this function:

◆ DaylightSavingsOffsetInMs()

int v8::internal::DateCache::DaylightSavingsOffsetInMs ( int64_t time_ms)
inlineprivate

Definition at line 200 of file date.h.

Here is the caller graph for this function:

◆ DaysFromTime()

static int v8::internal::DateCache::DaysFromTime ( int64_t time_ms)
inlinestatic

Definition at line 55 of file date.h.

Here is the caller graph for this function:

◆ DaysFromYearMonth()

int v8::internal::DateCache::DaysFromYearMonth ( int year,
int month )

Definition at line 156 of file date.cc.

Here is the caller graph for this function:

◆ EquivalentTime()

int64_t v8::internal::DateCache::EquivalentTime ( int64_t time_ms)
inline

Definition at line 133 of file date.h.

◆ EquivalentYear()

int v8::internal::DateCache::EquivalentYear ( int year)
inline

Definition at line 146 of file date.h.

◆ ExtendTheAfterSegment()

void v8::internal::DateCache::ExtendTheAfterSegment ( int64_t time_sec,
int offset_ms )
inlineprivate

Definition at line 273 of file date.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetDaylightSavingsOffsetFromOS()

virtual int v8::internal::DateCache::GetDaylightSavingsOffsetFromOS ( int64_t time_sec)
inlinevirtual

Definition at line 174 of file date.h.

◆ GetLocalOffsetFromOS()

int v8::internal::DateCache::GetLocalOffsetFromOS ( int64_t time_ms,
bool is_utc )
virtual

Definition at line 210 of file date.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InvalidSegment()

bool v8::internal::DateCache::InvalidSegment ( CacheItem * segment)
inlineprivate

Definition at line 224 of file date.h.

Here is the caller graph for this function:

◆ IsLeap()

bool v8::internal::DateCache::IsLeap ( int year)
inline

Definition at line 87 of file date.h.

◆ LeastRecentlyUsedCacheItem()

DateCache::CacheItem * v8::internal::DateCache::LeastRecentlyUsedCacheItem ( CacheItem * skip)
private

Definition at line 463 of file date.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LocalOffsetInMs()

int v8::internal::DateCache::LocalOffsetInMs ( int64_t time,
bool is_utc )

Definition at line 292 of file date.cc.

Here is the call graph for this function:

◆ LocalTimezone()

const char * v8::internal::DateCache::LocalTimezone ( int64_t time_ms)
inline

Definition at line 94 of file date.h.

Here is the caller graph for this function:

◆ ProbeCache()

void v8::internal::DateCache::ProbeCache ( int64_t time_ms)
private

Definition at line 419 of file date.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ResetDateCache()

void v8::internal::DateCache::ResetDateCache ( base::TimezoneCache::TimeZoneDetection time_zone_detection)

Definition at line 43 of file date.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stamp()

Tagged< Smi > v8::internal::DateCache::stamp ( )
inline

Definition at line 170 of file date.h.

Here is the caller graph for this function:

◆ stamp_address()

void * v8::internal::DateCache::stamp_address ( )
inline

Definition at line 171 of file date.h.

◆ TimeInDay()

static int v8::internal::DateCache::TimeInDay ( int64_t time_ms,
int days )
inlinestatic

Definition at line 62 of file date.h.

Here is the caller graph for this function:

◆ TimezoneOffset()

int v8::internal::DateCache::TimezoneOffset ( int64_t time_ms)
inline

Definition at line 107 of file date.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ToLocal()

int64_t v8::internal::DateCache::ToLocal ( int64_t time_ms)
inline

Definition at line 114 of file date.h.

Here is the caller graph for this function:

◆ ToUTC()

int64_t v8::internal::DateCache::ToUTC ( int64_t time_ms)
inline

Definition at line 120 of file date.h.

◆ TryTimeClip()

static bool v8::internal::DateCache::TryTimeClip ( double * time)
inlinestatic

Definition at line 70 of file date.h.

Here is the caller graph for this function:

◆ Weekday()

int v8::internal::DateCache::Weekday ( int days)
inline

Definition at line 82 of file date.h.

Here is the caller graph for this function:

◆ YearMonthDayFromDays()

void v8::internal::DateCache::YearMonthDayFromDays ( int days,
int * year,
int * month,
int * day )

Definition at line 77 of file date.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ after_

CacheItem* v8::internal::DateCache::after_
private

Definition at line 234 of file date.h.

◆ before_

CacheItem* v8::internal::DateCache::before_
private

Definition at line 233 of file date.h.

◆ cache_

CacheItem v8::internal::DateCache::cache_[kCacheSize]
private

Definition at line 231 of file date.h.

◆ cache_usage_counter_

int v8::internal::DateCache::cache_usage_counter_
private

Definition at line 232 of file date.h.

◆ dst_tz_name_

const char* v8::internal::DateCache::dst_tz_name_
private

Definition at line 247 of file date.h.

◆ kCacheSize

const int v8::internal::DateCache::kCacheSize = 32
staticprivate

Definition at line 188 of file date.h.

◆ kDefaultTimeZoneOffsetDeltaInMs

const int v8::internal::DateCache::kDefaultTimeZoneOffsetDeltaInMs = 19 * kSecPerDay * 1000
staticprivate

Definition at line 186 of file date.h.

◆ kInvalidLocalOffsetInMs

const int v8::internal::DateCache::kInvalidLocalOffsetInMs = kMaxInt
static

Definition at line 38 of file date.h.

◆ kInvalidStamp

const int v8::internal::DateCache::kInvalidStamp = -1
static

Definition at line 41 of file date.h.

◆ kMaxEpochTimeInMs

const int64_t v8::internal::DateCache::kMaxEpochTimeInMs = static_cast<int64_t>(kMaxInt) * 1000
static

Definition at line 27 of file date.h.

◆ kMaxEpochTimeInSec

const int v8::internal::DateCache::kMaxEpochTimeInSec = kMaxInt
static

Definition at line 26 of file date.h.

◆ kMaxTimeBeforeUTCInMs

const int64_t v8::internal::DateCache::kMaxTimeBeforeUTCInMs = kMaxTimeInMs + kMsPerMonth
static

Definition at line 35 of file date.h.

◆ kMaxTimeInMs

const int64_t v8::internal::DateCache::kMaxTimeInMs
static
Initial value:
=
static_cast<int64_t>(864000000) * 10000000

Definition at line 30 of file date.h.

◆ kMsPerDay

const int64_t v8::internal::DateCache::kMsPerDay = kSecPerDay * 1000
static

Definition at line 22 of file date.h.

◆ kMsPerMin

const int v8::internal::DateCache::kMsPerMin = 60 * 1000
static

Definition at line 20 of file date.h.

◆ kMsPerMonth

const int64_t v8::internal::DateCache::kMsPerMonth = kMsPerDay * 30
static

Definition at line 23 of file date.h.

◆ kSecPerDay

const int v8::internal::DateCache::kSecPerDay = 24 * 60 * 60
static

Definition at line 21 of file date.h.

◆ local_offset_ms_

int v8::internal::DateCache::local_offset_ms_
private

Definition at line 236 of file date.h.

◆ stamp_

Tagged<Smi> v8::internal::DateCache::stamp_
private

Definition at line 228 of file date.h.

◆ tz_cache_

base::TimezoneCache* v8::internal::DateCache::tz_cache_
private

Definition at line 249 of file date.h.

◆ tz_name_

const char* v8::internal::DateCache::tz_name_
private

Definition at line 246 of file date.h.

◆ ymd_day_

int v8::internal::DateCache::ymd_day_
private

Definition at line 243 of file date.h.

◆ ymd_days_

int v8::internal::DateCache::ymd_days_
private

Definition at line 240 of file date.h.

◆ ymd_month_

int v8::internal::DateCache::ymd_month_
private

Definition at line 242 of file date.h.

◆ ymd_valid_

bool v8::internal::DateCache::ymd_valid_
private

Definition at line 239 of file date.h.

◆ ymd_year_

int v8::internal::DateCache::ymd_year_
private

Definition at line 241 of file date.h.


The documentation for this class was generated from the following files: