Ignore:
Timestamp:
Aug 26, 2011, 3:23:43 PM (14 years ago)
Author:
[email protected]
Message:

The GC does not have a facility for profiling the kinds of objects
that occupy the heap
https://bugs.webkit.org/show_bug.cgi?id=66849

Reviewed by Geoffrey Garen.

Destructor calls and object scans are now optionally counted, per
vtable. When the heap is destroyed and profiling is enabled, the
counts are dumped, with care taken to print the names of classes
(modulo C++ mangling) sorted in descending commonality.

(JSC::Heap::destroy):

  • heap/Heap.h:
  • heap/MarkStack.cpp:

(JSC::SlotVisitor::visitChildren):
(JSC::SlotVisitor::drain):

  • heap/MarkStack.h:
  • heap/MarkedBlock.cpp:

(JSC::MarkedBlock::callDestructor):

  • heap/MarkedBlock.h:
  • heap/VTableSpectrum.cpp: Added.

(JSC::VTableSpectrum::VTableSpectrum):
(JSC::VTableSpectrum::~VTableSpectrum):
(JSC::VTableSpectrum::countVPtr):
(JSC::VTableSpectrum::count):
(JSC::VTableAndCount::VTableAndCount):
(JSC::VTableAndCount::operator<):
(JSC::VTableSpectrum::dump):

  • heap/VTableSpectrum.h: Added.
  • wtf/Platform.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/heap/MarkStack.cpp

    r89069 r93918  
    5454inline void SlotVisitor::visitChildren(JSCell* cell)
    5555{
     56#if ENABLE(SIMPLE_HEAP_PROFILING)
     57    m_visitedTypeCounts.count(cell);
     58#endif
     59
    5660    ASSERT(Heap::isMarked(cell));
    5761    if (cell->structure()->typeInfo().type() < CompoundType) {
     
    109113
    110114            if (cell->structure()->typeInfo().type() < CompoundType) {
     115#if ENABLE(SIMPLE_HEAP_PROFILING)
     116                m_visitedTypeCounts.count(cell);
     117#endif
    111118                cell->JSCell::visitChildren(*this);
    112119                if (current.m_values == end) {
Note: See TracChangeset for help on using the changeset viewer.