Ignore:
Timestamp:
Oct 27, 2009, 3:01:41 PM (16 years ago)
Author:
[email protected]
Message:

JavaScriptCore: https://bugs.webkit.org/show_bug.cgi?id=30800
Cache recently computed date data.

Patch by Geoffrey Garen <[email protected]> on 2009-10-27
Reviewed by Darin Adler and Oliver Hunt.

SunSpider reports a ~0.5% speedup, mostly from date-format-tofte.js.

  • runtime/DateInstance.cpp:

(JSC::DateInstance::DateInstance):
(JSC::DateInstance::getGregorianDateTime): Use the shared cache.

  • runtime/DateInstance.h: Renamed m_cache to m_data, to avoid the confusion

of a "cache cache".

  • runtime/DatePrototype.cpp:

(JSC::formatLocaleDate):
(JSC::dateProtoFuncToString):
(JSC::dateProtoFuncToUTCString):
(JSC::dateProtoFuncToISOString):
(JSC::dateProtoFuncToDateString):
(JSC::dateProtoFuncToTimeString):
(JSC::dateProtoFuncGetFullYear):
(JSC::dateProtoFuncGetUTCFullYear):
(JSC::dateProtoFuncToGMTString):
(JSC::dateProtoFuncGetMonth):
(JSC::dateProtoFuncGetUTCMonth):
(JSC::dateProtoFuncGetDate):
(JSC::dateProtoFuncGetUTCDate):
(JSC::dateProtoFuncGetDay):
(JSC::dateProtoFuncGetUTCDay):
(JSC::dateProtoFuncGetHours):
(JSC::dateProtoFuncGetUTCHours):
(JSC::dateProtoFuncGetMinutes):
(JSC::dateProtoFuncGetUTCMinutes):
(JSC::dateProtoFuncGetSeconds):
(JSC::dateProtoFuncGetUTCSeconds):
(JSC::dateProtoFuncGetTimezoneOffset):
(JSC::setNewValueFromTimeArgs):
(JSC::setNewValueFromDateArgs):
(JSC::dateProtoFuncSetYear):
(JSC::dateProtoFuncGetYear): Pass an ExecState to these functions, so they
can access the DateInstanceCache.

  • runtime/JSGlobalData.h: Keep a DateInstanceCache.

JavaScriptGlue: Updated for JavaScriptCore export changes.

Patch by Geoffrey Garen <[email protected]> on 2009-10-27
Reviewed by Oliver Hunt.

  • ForwardingHeaders/wtf/DateMath.h: Added.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r49802 r50174  
    158158                148F21BC107EC54D0042EC2C /* Parser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93F0B3A909BB4DC00068FCE3 /* Parser.cpp */; };
    159159                149559EE0DDCDDF700648087 /* DebuggerCallFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 149559ED0DDCDDF700648087 /* DebuggerCallFrame.cpp */; };
     160                14A1563210966365006FA260 /* DateInstanceCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 14A1563010966365006FA260 /* DateInstanceCache.h */; };
    160161                14A23D750F4E1ABB0023CDAD /* JITStubs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14A23D6C0F4E19CE0023CDAD /* JITStubs.cpp */; };
    161162                14A42E3F0F4F60EE00599099 /* TimeoutChecker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14A42E3D0F4F60EE00599099 /* TimeoutChecker.cpp */; };
     
    616617                149559ED0DDCDDF700648087 /* DebuggerCallFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DebuggerCallFrame.cpp; sourceTree = "<group>"; };
    617618                149B24FF0D8AF6D1009CB8C7 /* Register.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Register.h; sourceTree = "<group>"; };
     619                14A1563010966365006FA260 /* DateInstanceCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DateInstanceCache.h; sourceTree = "<group>"; };
    618620                14A23D6C0F4E19CE0023CDAD /* JITStubs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JITStubs.cpp; sourceTree = "<group>"; };
    619621                14A396A60CD2933100B5B4FF /* SymbolTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SymbolTable.h; sourceTree = "<group>"; };
     
    14171419                        isa = PBXGroup;
    14181420                        children = (
    1419                                 A7FB604B103F5EAB0017A286 /* PropertyDescriptor.h */,
    14201421                                BCF605110E203EF800B9A64D /* ArgList.cpp */,
    14211422                                BCF605120E203EF800B9A64D /* ArgList.h */,
     
    14511452                                BC1166000E1997B1008066DD /* DateInstance.cpp */,
    14521453                                BC1166010E1997B1008066DD /* DateInstance.h */,
     1454                                14A1563010966365006FA260 /* DateInstanceCache.h */,
    14531455                                BCD203470E17135E002C7E82 /* DatePrototype.cpp */,
    14541456                                BCD203480E17135E002C7E82 /* DatePrototype.h */,
     
    15141516                                F692A8620255597D01FF60F7 /* JSString.h */,
    15151517                                14ABB454099C2A0F00E2A24F /* JSType.h */,
     1518                                6507D2970E871E4A00D7D896 /* JSTypeInfo.h */,
    15161519                                F692A8870255597D01FF60F7 /* JSValue.cpp */,
    15171520                                14ABB36E099C076400E2A24F /* JSValue.h */,
     
    15241527                                F692A8680255597D01FF60F7 /* Lookup.cpp */,
    15251528                                F692A8690255597D01FF60F7 /* Lookup.h */,
     1529                                A74B3498102A5F8E0032AB98 /* MarkStack.cpp */,
     1530                                A779558F101A74D500114E55 /* MarkStack.h */,
     1531                                A7C530E3102A3813005BC741 /* MarkStackPosix.cpp */,
    15261532                                F692A86A0255597D01FF60F7 /* MathObject.cpp */,
    15271533                                F692A86B0255597D01FF60F7 /* MathObject.h */,
     
    15441550                                F692A8770255597D01FF60F7 /* Operations.cpp */,
    15451551                                F692A8780255597D01FF60F7 /* Operations.h */,
     1552                                A7FB60A3103F7DC20017A286 /* PropertyDescriptor.cpp */,
     1553                                A7FB604B103F5EAB0017A286 /* PropertyDescriptor.h */,
    15461554                                BC95437C0EBA70FD0072B6D3 /* PropertyMapHashTable.h */,
    15471555                                65400C0F0A69BAF200509887 /* PropertyNameArray.cpp */,
     
    15841592                                5D53726D0E1C546B0021E549 /* Tracing.d */,
    15851593                                5D53726E0E1C54880021E549 /* Tracing.h */,
    1586                                 6507D2970E871E4A00D7D896 /* JSTypeInfo.h */,
    15871594                                F692A8850255597D01FF60F7 /* UString.cpp */,
    15881595                                F692A8860255597D01FF60F7 /* UString.h */,
    1589                                 A779558F101A74D500114E55 /* MarkStack.h */,
    1590                                 A7C530E3102A3813005BC741 /* MarkStackPosix.cpp */,
    1591                                 A74B3498102A5F8E0032AB98 /* MarkStack.cpp */,
    1592                                 A7FB60A3103F7DC20017A286 /* PropertyDescriptor.cpp */,
    15931596                        );
    15941597                        path = runtime;
     
    19992002                                BC87CDB910712AD4000614CF /* JSONObject.lut.h in Headers */,
    20002003                                148CD1D8108CF902008163C6 /* JSContextRefPrivate.h in Headers */,
     2004                                14A1563210966365006FA260 /* DateInstanceCache.h in Headers */,
    20012005                        );
    20022006                        runOnlyForDeploymentPostprocessing = 0;
Note: See TracChangeset for help on using the changeset viewer.