Ignore:
Timestamp:
Feb 11, 2010, 1:28:52 PM (15 years ago)
Author:
[email protected]
Message:

JavaScriptCore: Added an SPI for asking about all the different live objects on the heap.
Useful for memory debugging.

Reviewed by Oliver Hunt.

  • runtime/Collector.cpp:

(JSC::typeName): Use a little capitalization. Don't crash in the case of
a non-object cell, since it might just be an uninitialized cell.

(JSC::Heap::objectTypeCounts): The new SPI.

  • runtime/Collector.h:
  • runtime/CollectorHeapIterator.h:

(JSC::CollectorHeapIterator::advance):
(JSC::LiveObjectIterator::operator++):
(JSC::DeadObjectIterator::operator++):
(JSC::ObjectIterator::operator++): Made 2 tweaks to these iterators:
(1) Skip the last cell in the block, since it's a dummy sentinel, and
we don't want it to confuse the object count; (2) Fixed a logic error
in LiveObjectIterator that could cause it to iterate dead objects if
m_block were equal to m_heap.nextBlock and m_cell were less than
m_heap.nextCell. No test for this since I can't think of a way that this
could make WebKit behave badly.

WebKit/mac: Exported some new JavaScript heap introspection.

Reviewed by Oliver Hunt.

  • Misc/WebCoreStatistics.h:
  • Misc/WebCoreStatistics.mm:

(+[WebCoreStatistics javaScriptObjectTypeCounts]): Just like
javaScriptProtectedObjectTypeCounts, except this function enumerates all
live objects, not just protected objects.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/JavaScriptCore.exp

    r54531 r54672  
    191191__ZN3JSC4Heap14primaryHeapEndEv
    192192__ZN3JSC4Heap15recordExtraCostEm
     193__ZN3JSC4Heap16objectTypeCountsEv
    193194__ZN3JSC4Heap16primaryHeapBeginEv
    194195__ZN3JSC4Heap17collectAllGarbageEv
     
    300301__ZN3WTF10fastCallocEmm
    301302__ZN3WTF10fastMallocEm
     303__ZN3WTF10fastStrDupEPKc
    302304__ZN3WTF11currentTimeEv
    303305__ZN3WTF11fastReallocEPvm
     
    348350__ZN3WTF8CollatorD1Ev
    349351__ZN3WTF8fastFreeEPv
    350 __ZN3WTF10fastStrDupEPKc
    351352__ZN3WTF8msToYearEd
     353__ZN3WTF9ByteArray6createEm
    352354__ZN3WTF9dayInYearEdi
    353 __ZN3WTF9ByteArray6createEm
    354355__ZNK3JSC10JSFunction23isHostFunctionNonInlineEv
    355356__ZNK3JSC11Interpreter14retrieveCallerEPNS_9ExecStateEPNS_16InternalFunctionE
Note: See TracChangeset for help on using the changeset viewer.