summaryrefslogtreecommitdiff
path: root/deps/v8/src/date.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/date.cc')
-rw-r--r--deps/v8/src/date.cc18
1 files changed, 8 insertions, 10 deletions
diff --git a/deps/v8/src/date.cc b/deps/v8/src/date.cc
index 88a056b367..8562eb279a 100644
--- a/deps/v8/src/date.cc
+++ b/deps/v8/src/date.cc
@@ -4,12 +4,11 @@
#include "src/date.h"
+#include "src/base/overflowing-math.h"
#include "src/conversions.h"
#include "src/objects-inl.h"
-#include "src/objects.h"
-
#ifdef V8_INTL_SUPPORT
-#include "src/intl.h"
+#include "src/objects/intl-objects.h"
#endif
namespace v8 {
@@ -27,11 +26,10 @@ static const char kDaysInMonths[] =
{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
DateCache::DateCache()
- : stamp_(nullptr),
+ : stamp_(kNullAddress),
tz_cache_(
#ifdef V8_INTL_SUPPORT
- FLAG_icu_timezone_data ? new ICUTimezoneCache()
- : base::OS::CreateTimezoneCache()
+ Intl::CreateTimeZoneCache()
#else
base::OS::CreateTimezoneCache()
#endif
@@ -40,9 +38,8 @@ DateCache::DateCache()
}
void DateCache::ResetDateCache() {
- static const int kMaxStamp = Smi::kMaxValue;
- if (stamp_->value() >= kMaxStamp) {
- stamp_ = Smi::kZero;
+ if (stamp_->value() >= Smi::kMaxValue) {
+ stamp_ = Smi::zero();
} else {
stamp_ = Smi::FromInt(stamp_->value() + 1);
}
@@ -287,7 +284,8 @@ int DateCache::GetLocalOffsetFromOS(int64_t time_ms, bool is_utc) {
void DateCache::ExtendTheAfterSegment(int time_sec, int offset_ms) {
if (after_->offset_ms == offset_ms &&
- after_->start_sec <= time_sec + kDefaultDSTDeltaInSec &&
+ after_->start_sec <=
+ base::AddWithWraparound(time_sec, kDefaultDSTDeltaInSec) &&
time_sec <= after_->end_sec) {
// Extend the after_ segment.
after_->start_sec = time_sec;