Lines Matching refs:cache

121 // In this way, only one check, for a DST cache miss, is needed.
126 // we keep a cache of the last computed DST offset along with a time interval
127 // where we know the cache is valid.
128 // When the cache is valid, local_time_offset is also valid.
149 // Load the cache object from the builtins object.
150 var cache = DST_offset_cache;
153 var start = cache.start;
154 var end = cache.end;
158 if (t <= end) return cache.offset;
160 // If the cache misses, the local_time_offset may not be initialized.
166 var new_end = end + cache.increment;
170 if (cache.offset == end_offset) {
172 // the offset in the cache, we grow the cached time interval
174 cache.end = new_end;
175 cache.increment = cache.initial_increment;
184 cache.start = t;
185 cache.end = new_end;
186 cache.increment = cache.initial_increment;
191 cache.increment /= 3;
192 cache.end = t;
194 // Update the offset in the cache and return it.
195 cache.offset = offset;
201 // If the cache misses, the local_time_offset may not be initialized.
205 // Compute the DST offset for the time and shrink the cache interval
209 cache.offset = offset;
210 cache.start = cache.end = t;
211 cache.increment = cache.initial_increment;
252 // Inline the DST offset cache checks for speed.
253 // The cache is hit, or DaylightSavingsOffset is called,
255 var cache = DST_offset_cache;
256 if (cache.start <= time && time <= cache.end) {
257 var dst_offset = cache.offset;
385 // The Date cache is used to limit the cost of parsing the same Date
415 // Probe the Date cache. If we already have a time value for the
417 var cache = Date_cache;
418 if (cache.string === year) {
419 value = cache.time;
423 cache.time = value;
424 cache.year = YearFromTime(LocalTimeNoCheck(value));
425 cache.string = year;
506 // We also need to invalidate the DST cache as the new timezone may have
640 var cache = Date_cache;
641 if (cache.time === t) return cache.year;
1010 // Reset the DST offset cache:
1011 var cache = DST_offset_cache;
1012 cache.offset = 0;
1013 cache.start = 0;
1014 cache.end = -1;
1015 cache.increment = 0;
1016 cache.initial_increment = 19 * msPerDay;
1018 // Reset the timezone cache:
1030 // Reset the date cache:
1031 cache = Date_cache;
1032 cache.time = $NaN;
1033 cache.year = $NaN;
1034 cache.string = null;