High number of cache miss on localTimeOffset
authorticaiolima@gmail.com <ticaiolima@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Aug 2019 12:41:01 +0000 (12:41 +0000)
committerticaiolima@gmail.com <ticaiolima@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Aug 2019 12:41:01 +0000 (12:41 +0000)
commitc0571ac9c29c2a2aa9ce5451baf6363530fbfe9a
tree9700c58be6c14e33f2dc546e7aa1391ae5ecb01c
parent895bab49b05ac663a8b8bd10ccee0797cfe15301
High number of cache miss on localTimeOffset
https://bugs.webkit.org/show_bug.cgi?id=200444

Reviewed by Darin Adler.

This patch is separating the `LocalTimeOffsetCache` for each
`WTF::TimeType` to avoid constant cache miss on pathological cases
where `gregorianDateTimeToMS` and `msToGregorianDateTime` are
intercaleted with `inputTimeType ==  WTF::LocalTime`. Such case
happens during execution of Facebook Messenger
(https://www.messenger.com).

* runtime/JSDateMath.cpp:
(JSC::localTimeOffset):
(JSC::gregorianDateTimeToMS):
* runtime/VM.cpp:
(JSC::VM::resetDateCache):
* runtime/VM.h:
(JSC::LocalTimeOffsetCache::LocalTimeOffsetCache):
(JSC::LocalTimeOffsetCache::reset):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248363 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/JSDateMath.cpp
Source/JavaScriptCore/runtime/VM.cpp
Source/JavaScriptCore/runtime/VM.h