| Index: src/date.cc
|
| diff --git a/src/date.cc b/src/date.cc
|
| index 4a3d4b359141f1e3fbaff9ba391bb4fd866de15e..6b95cb721291bc94f6eba556855c3e8936ff05e7 100644
|
| --- a/src/date.cc
|
| +++ b/src/date.cc
|
| @@ -31,7 +31,7 @@ void DateCache::ResetDateCache() {
|
| } else {
|
| stamp_ = Smi::FromInt(stamp_->value() + 1);
|
| }
|
| - ASSERT(stamp_ != Smi::FromInt(kInvalidStamp));
|
| + DCHECK(stamp_ != Smi::FromInt(kInvalidStamp));
|
| for (int i = 0; i < kDSTSize; ++i) {
|
| ClearSegment(&dst_[i]);
|
| }
|
| @@ -73,7 +73,7 @@ void DateCache::YearMonthDayFromDays(
|
| *year = 400 * (days / kDaysIn400Years) - kYearsOffset;
|
| days %= kDaysIn400Years;
|
|
|
| - ASSERT(DaysFromYearMonth(*year, 0) + days == save_days);
|
| + DCHECK(DaysFromYearMonth(*year, 0) + days == save_days);
|
|
|
| days--;
|
| int yd1 = days / kDaysIn100Years;
|
| @@ -93,12 +93,12 @@ void DateCache::YearMonthDayFromDays(
|
|
|
| bool is_leap = (!yd1 || yd2) && !yd3;
|
|
|
| - ASSERT(days >= -1);
|
| - ASSERT(is_leap || (days >= 0));
|
| - ASSERT((days < 365) || (is_leap && (days < 366)));
|
| - ASSERT(is_leap == ((*year % 4 == 0) && (*year % 100 || (*year % 400 == 0))));
|
| - ASSERT(is_leap || ((DaysFromYearMonth(*year, 0) + days) == save_days));
|
| - ASSERT(!is_leap || ((DaysFromYearMonth(*year, 0) + days + 1) == save_days));
|
| + DCHECK(days >= -1);
|
| + DCHECK(is_leap || (days >= 0));
|
| + DCHECK((days < 365) || (is_leap && (days < 366)));
|
| + DCHECK(is_leap == ((*year % 4 == 0) && (*year % 100 || (*year % 400 == 0))));
|
| + DCHECK(is_leap || ((DaysFromYearMonth(*year, 0) + days) == save_days));
|
| + DCHECK(!is_leap || ((DaysFromYearMonth(*year, 0) + days + 1) == save_days));
|
|
|
| days += is_leap;
|
|
|
| @@ -124,7 +124,7 @@ void DateCache::YearMonthDayFromDays(
|
| *day = days - 31 + 1;
|
| }
|
| }
|
| - ASSERT(DaysFromYearMonth(*year, *month) + *day - 1 == save_days);
|
| + DCHECK(DaysFromYearMonth(*year, *month) + *day - 1 == save_days);
|
| ymd_valid_ = true;
|
| ymd_year_ = *year;
|
| ymd_month_ = *month;
|
| @@ -146,8 +146,8 @@ int DateCache::DaysFromYearMonth(int year, int month) {
|
| month += 12;
|
| }
|
|
|
| - ASSERT(month >= 0);
|
| - ASSERT(month < 12);
|
| + DCHECK(month >= 0);
|
| + DCHECK(month < 12);
|
|
|
| // year_delta is an arbitrary number such that:
|
| // a) year_delta = -1 (mod 400)
|
| @@ -222,8 +222,8 @@ int DateCache::DaylightSavingsOffsetInMs(int64_t time_ms) {
|
|
|
| ProbeDST(time_sec);
|
|
|
| - ASSERT(InvalidSegment(before_) || before_->start_sec <= time_sec);
|
| - ASSERT(InvalidSegment(after_) || time_sec < after_->start_sec);
|
| + DCHECK(InvalidSegment(before_) || before_->start_sec <= time_sec);
|
| + DCHECK(InvalidSegment(after_) || time_sec < after_->start_sec);
|
|
|
| if (InvalidSegment(before_)) {
|
| // Cache miss.
|
| @@ -264,7 +264,7 @@ int DateCache::DaylightSavingsOffsetInMs(int64_t time_ms) {
|
| int new_offset_ms = GetDaylightSavingsOffsetFromOS(new_after_start_sec);
|
| ExtendTheAfterSegment(new_after_start_sec, new_offset_ms);
|
| } else {
|
| - ASSERT(!InvalidSegment(after_));
|
| + DCHECK(!InvalidSegment(after_));
|
| // Update the usage counter of after_ since it is going to be used.
|
| after_->last_used = ++dst_usage_counter_;
|
| }
|
| @@ -291,7 +291,7 @@ int DateCache::DaylightSavingsOffsetInMs(int64_t time_ms) {
|
| return offset_ms;
|
| }
|
| } else {
|
| - ASSERT(after_->offset_ms == offset_ms);
|
| + DCHECK(after_->offset_ms == offset_ms);
|
| after_->start_sec = middle_sec;
|
| if (time_sec >= after_->start_sec) {
|
| // This swap helps the optimistic fast check in subsequent invocations.
|
| @@ -310,7 +310,7 @@ int DateCache::DaylightSavingsOffsetInMs(int64_t time_ms) {
|
| void DateCache::ProbeDST(int time_sec) {
|
| DST* before = NULL;
|
| DST* after = NULL;
|
| - ASSERT(before_ != after_);
|
| + DCHECK(before_ != after_);
|
|
|
| for (int i = 0; i < kDSTSize; ++i) {
|
| if (dst_[i].start_sec <= time_sec) {
|
| @@ -334,12 +334,12 @@ void DateCache::ProbeDST(int time_sec) {
|
| ? after_ : LeastRecentlyUsedDST(before);
|
| }
|
|
|
| - ASSERT(before != NULL);
|
| - ASSERT(after != NULL);
|
| - ASSERT(before != after);
|
| - ASSERT(InvalidSegment(before) || before->start_sec <= time_sec);
|
| - ASSERT(InvalidSegment(after) || time_sec < after->start_sec);
|
| - ASSERT(InvalidSegment(before) || InvalidSegment(after) ||
|
| + DCHECK(before != NULL);
|
| + DCHECK(after != NULL);
|
| + DCHECK(before != after);
|
| + DCHECK(InvalidSegment(before) || before->start_sec <= time_sec);
|
| + DCHECK(InvalidSegment(after) || time_sec < after->start_sec);
|
| + DCHECK(InvalidSegment(before) || InvalidSegment(after) ||
|
| before->end_sec < after->start_sec);
|
|
|
| before_ = before;
|
|
|