Ignore:
Timestamp:
Nov 9, 2009, 7:58:29 PM (16 years ago)
Author:
[email protected]
Message:

Fixed an edge case that could cause the engine not to notice a timezone
change.

Reviewed by Oliver Hunt.

No test because this case would require manual intervention to change
the timezone during the test.

SunSpider reports no change.

  • runtime/DateInstanceCache.h:

(JSC::DateInstanceCache::DateInstanceCache):
(JSC::DateInstanceCache::reset): Added a helper function for resetting
this cache. Also, shrank the cache, since we'll be resetting it often.

  • runtime/JSGlobalData.cpp:

(JSC::JSGlobalData::resetDateCache): Include resetting the DateInstanceCache
in resetting Date data. (Otherwise, a cache hit could bypass a necessary
timezone update check.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/DateInstanceCache.h

    r50608 r50709  
    5757        DateInstanceCache()
    5858        {
     59            reset();
     60        }
     61       
     62        void reset()
     63        {
    5964            for (size_t i = 0; i < cacheSize; ++i)
    6065                m_cache[i].key = NaN;
     
    7378
    7479    private:
    75         static const size_t cacheSize = 64;
     80        static const size_t cacheSize = 16;
    7681
    7782        struct CacheEntry {
Note: See TracChangeset for help on using the changeset viewer.