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.