Ignore:
Timestamp:
Apr 11, 2019, 5:53:12 PM (6 years ago)
Author:
[email protected]
Message:

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):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jit/ICStats.cpp

    r215265 r244204  
    4141    if (m_propertyName != other.m_propertyName)
    4242        return codePointCompare(m_propertyName.string(), other.m_propertyName.string()) < 0;
    43    
    44     return m_kind < other.m_kind;
     43
     44    if (m_kind != other.m_kind)
     45        return m_kind < other.m_kind;
     46
     47    return m_propertyLocation < other.m_propertyLocation;
    4548}
    4649
     
    4851{
    4952    out.print(m_kind, "(", m_classInfo ? m_classInfo->className : "<null>", ", ", m_propertyName, ")");
     53    if (m_propertyLocation != Unknown)
     54        out.print(m_propertyLocation == BaseObject ? " self" : " proto lookup");
    5055}
    5156
Note: See TracChangeset for help on using the changeset viewer.