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/Heap.h

    r93698 r93918  
    125125
    126126    private:
     127        friend class MarkedBlock;
     128       
    127129        typedef HashSet<MarkedBlock*>::iterator BlockIterator;
    128130
     
    184186        ThreadCondition m_freeBlockCondition;
    185187        bool m_blockFreeingThreadShouldQuit;
     188#endif
     189
     190#if ENABLE(SIMPLE_HEAP_PROFILING)
     191        VTableSpectrum m_destroyedTypeCounts;
    186192#endif
    187193
Note: See TracChangeset for help on using the changeset viewer.