Index: src/date.h |
diff --git a/src/date.h b/src/date.h |
index 1a3b65638ce951909429613a1f4fd46345f46a80..5de2b84408634ef7b223ec7af3f3376cf7b73a74 100644 |
--- a/src/date.h |
+++ b/src/date.h |
@@ -93,7 +93,12 @@ class DateCache { |
if (time_ms < 0 || time_ms > kMaxEpochTimeInMs) { |
time_ms = EquivalentTime(time_ms); |
} |
- return tz_cache_->LocalTimezone(static_cast<double>(time_ms)); |
+ bool is_dst = DaylightSavingsOffsetInMs(time_ms) != 0; |
+ const char** name = is_dst ? &dst_tz_name_ : &tz_name_; |
+ if (*name == nullptr) { |
+ *name = tz_cache_->LocalTimezone(static_cast<double>(time_ms)); |
+ } |
+ return *name; |
} |
// ECMA 262 - 15.9.5.26 |
@@ -276,6 +281,10 @@ class DateCache { |
int ymd_month_; |
int ymd_day_; |
+ // Timezone name cache |
+ const char* tz_name_; |
+ const char* dst_tz_name_; |
+ |
base::TimezoneCache* tz_cache_; |
}; |