Ignore:
Timestamp:
Nov 9, 2009, 8:14:34 PM (16 years ago)
Author:
[email protected]
Message:

Imported the v8 DST cache.

Reviewed by Oliver Hunt.

SunSpider says 1.5% faster.

  • runtime/JSGlobalData.cpp:

(JSC::JSGlobalData::resetDateCache): Reset the DST cache when resetting
other date data.

  • runtime/JSGlobalData.h:

(JSC::DSTOffsetCache::DSTOffsetCache):
(JSC::DSTOffsetCache::reset): Added a struct for the DST cache.

  • wtf/DateMath.cpp:

(WTF::calculateDSTOffsetSimple):
(WTF::calculateDSTOffset):
(WTF::parseDateFromNullTerminatedCharacters):
(JSC::getDSTOffset):
(JSC::gregorianDateTimeToMS):
(JSC::msToGregorianDateTime):
(JSC::parseDateFromNullTerminatedCharacters):

  • wtf/DateMath.h: The imported code for probing and updating the cache.
File:
1 edited

Legend:

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

    r50705 r50711  
    6363    struct Instruction;   
    6464    struct VPtrSet;
     65
     66    struct DSTOffsetCache {
     67        DSTOffsetCache()
     68        {
     69            reset();
     70        }
     71       
     72        void reset()
     73        {
     74            offset = 0.0;
     75            start = 0.0;
     76            end = -1.0;
     77            increment = 0.0;
     78        }
     79
     80        double offset;
     81        double start;
     82        double end;
     83        double increment;
     84    };
    6585
    6686    class JSGlobalData : public RefCounted<JSGlobalData> {
     
    155175
    156176        double cachedUTCOffset;
    157 
     177        DSTOffsetCache dstOffsetCache;
     178       
    158179        UString cachedDateString;
    159180        double cachedDateStringValue;
     
    173194        void createNativeThunk();
    174195    };
    175 
     196   
    176197} // namespace JSC
    177198
Note: See TracChangeset for help on using the changeset viewer.