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/runtime/JSGlobalData.h

    r49328 r50174  
    3131
    3232#include "Collector.h"
     33#include "DateInstanceCache.h"
    3334#include "ExecutableAllocator.h"
    3435#include "JITStubs.h"
     
    117118        SmallStrings smallStrings;
    118119        NumericStrings numericStrings;
    119 
     120        DateInstanceCache dateInstanceCache;
     121       
    120122#if ENABLE(ASSEMBLER)
    121123        ExecutableAllocator executableAllocator;
Note: See TracChangeset for help on using the changeset viewer.