Improve the Inline Cache Stats code
authormsaboff@apple.com <msaboff@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Apr 2019 00:53:12 +0000 (00:53 +0000)
committermsaboff@apple.com <msaboff@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Apr 2019 00:53:12 +0000 (00:53 +0000)
commitcc780adad547befe0f6573cd50e4ef919a7b2c39
tree135326808334c7d238ba5878d59287a282b23e23
parent46484c916c385b08d70c42c21a0f9d6ec3a4d067
Improve the Inline Cache Stats code
https://bugs.webkit.org/show_bug.cgi?id=196836

Reviewed by Saam Barati.

Source/JavaScriptCore:

Needed to handle the case where the Identifier could be null, for example with InstanceOfAddAccessCase
and InstanceOfReplaceWithJump.

Added the ability to log the location of a GetBy and PutBy property as either on self or up the
protocol chain.

* jit/ICStats.cpp:
(JSC::ICEvent::operator< const):
(JSC::ICEvent::dump const):
* jit/ICStats.h:
(JSC::ICEvent::ICEvent):
(JSC::ICEvent::hash const):
* jit/JITOperations.cpp:
* jit/Repatch.cpp:
(JSC::tryCacheGetByID):
(JSC::tryCachePutByID):
(JSC::tryCacheInByID):

Tools:

Added a new script to consolidate and arrange the output of --useICStats option.

This script merges the output from every group into one large table and sorts it from most common to
least common.  It also counts the slow path GetById and PutById variants and then calculates the
percentage of gets or puts for each unique base,property pair compared to all the gets and puts.
Put together, this is useful to see what property accesses are not getting cached.

* Scripts/ic-stats.py: Added.
(ICStats):
(ICStats.__init__):
(ICStats.parse):
(ICStats.dumpStats):
(usage):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244204 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/jit/ICStats.cpp
Source/JavaScriptCore/jit/ICStats.h
Source/JavaScriptCore/jit/JITOperations.cpp
Source/JavaScriptCore/jit/Repatch.cpp
Tools/ChangeLog
Tools/Scripts/ic-stats.py [new file with mode: 0755]