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

Side by Side Diff: src/date.cc

Issue 2726253002: [date] Add a cache for timezone names to DateCache (Closed)
Patch Set: Rebase Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « src/date.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/date.h" 5 #include "src/date.h"
6 6
7 #include "src/objects.h" 7 #include "src/objects.h"
8 #include "src/objects-inl.h" 8 #include "src/objects-inl.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 21 matching lines...) Expand all
32 DCHECK(stamp_ != Smi::FromInt(kInvalidStamp)); 32 DCHECK(stamp_ != Smi::FromInt(kInvalidStamp));
33 for (int i = 0; i < kDSTSize; ++i) { 33 for (int i = 0; i < kDSTSize; ++i) {
34 ClearSegment(&dst_[i]); 34 ClearSegment(&dst_[i]);
35 } 35 }
36 dst_usage_counter_ = 0; 36 dst_usage_counter_ = 0;
37 before_ = &dst_[0]; 37 before_ = &dst_[0];
38 after_ = &dst_[1]; 38 after_ = &dst_[1];
39 local_offset_ms_ = kInvalidLocalOffsetInMs; 39 local_offset_ms_ = kInvalidLocalOffsetInMs;
40 ymd_valid_ = false; 40 ymd_valid_ = false;
41 tz_cache_->Clear(); 41 tz_cache_->Clear();
42 tz_name_ = nullptr;
43 dst_tz_name_ = nullptr;
42 } 44 }
43 45
44 46
45 void DateCache::ClearSegment(DST* segment) { 47 void DateCache::ClearSegment(DST* segment) {
46 segment->start_sec = kMaxEpochTimeInSec; 48 segment->start_sec = kMaxEpochTimeInSec;
47 segment->end_sec = -kMaxEpochTimeInSec; 49 segment->end_sec = -kMaxEpochTimeInSec;
48 segment->offset_ms = 0; 50 segment->offset_ms = 0;
49 segment->last_used = 0; 51 segment->last_used = 0;
50 } 52 }
51 53
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 if (result == NULL || result->last_used > dst_[i].last_used) { 368 if (result == NULL || result->last_used > dst_[i].last_used) {
367 result = &dst_[i]; 369 result = &dst_[i];
368 } 370 }
369 } 371 }
370 ClearSegment(result); 372 ClearSegment(result);
371 return result; 373 return result;
372 } 374 }
373 375
374 } // namespace internal 376 } // namespace internal
375 } // namespace v8 377 } // namespace v8
OLDNEW
« no previous file with comments | « src/date.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698