Ignore:
Timestamp:
Mar 7, 2016, 3:45:38 PM (9 years ago)
Author:
[email protected]
Message:

Heap Snapshot should include different Edge types and data (Property, Index, Variable)
https://bugs.webkit.org/show_bug.cgi?id=154937

Patch by Joseph Pecoraro <Joseph Pecoraro> on 2016-03-07
Reviewed by Geoffrey Garen.

  • heap/SlotVisitor.cpp:

(JSC::SlotVisitor::appendHidden):

  • heap/SlotVisitor.h:
  • heap/SlotVisitorInlines.h:

(JSC::SlotVisitor::appendHidden):
(JSC::SlotVisitor::appendValuesHidden):
Add new visit methods to visit a reference without snapshotting the edge.

  • heap/Heap.cpp:

(JSC::AddExtraHeapSnapshotEdges::AddExtraHeapSnapshotEdges):
(JSC::AddExtraHeapSnapshotEdges::operator()):
(JSC::Heap::addHeapSnapshotEdges):
(JSC::Heap::removeDeadHeapSnapshotNodes):
(JSC::Heap::collectImpl):

  • heap/Heap.h:

After marking, visit the live cells for a chance to record extra
heap snapshotting information about the cell.

  • heap/HeapSnapshotBuilder.cpp:

(JSC::HeapSnapshotBuilder::appendNode):
(JSC::HeapSnapshotBuilder::appendEdge):
(JSC::HeapSnapshotBuilder::appendPropertyNameEdge):
(JSC::HeapSnapshotBuilder::appendVariableNameEdge):
(JSC::HeapSnapshotBuilder::appendIndexEdge):
(JSC::HeapSnapshotBuilder::json):

  • heap/HeapSnapshotBuilder.h:

(JSC::HeapSnapshotEdge::HeapSnapshotEdge):
Construct edges with extra data.

  • runtime/ClassInfo.h:
  • runtime/JSCell.cpp:

(JSC::JSCell::heapSnapshot):

  • runtime/JSCell.h:

Add a new method to provide cells with an opportunity to provide
extra heap snapshotting information.

  • runtime/JSObject.cpp:

(JSC::JSObject::visitButterfly):
(JSC::JSObject::visitChildren):
(JSC::JSObject::heapSnapshot):
(JSC::JSFinalObject::visitChildren):

  • runtime/JSObject.h:

Capture object property names and index names when heap snapshotting.
Do not include them as internal edges in normal visitChildren.

  • runtime/JSEnvironmentRecord.cpp:

(JSC::JSEnvironmentRecord::visitChildren):
(JSC::JSEnvironmentRecord::heapSnapshot):

  • runtime/JSEnvironmentRecord.h:
  • runtime/JSSegmentedVariableObject.cpp:

(JSC::JSSegmentedVariableObject::visitChildren):
(JSC::JSSegmentedVariableObject::heapSnapshot):

  • runtime/JSSegmentedVariableObject.h:

Capture scope variable names when heap snapshotting.

  • runtime/Structure.cpp:

(JSC::Structure::visitChildren):

  • runtime/Structure.h:
  • runtime/StructureInlines.h:

(JSC::Structure::propertyTable):
When performing a heap snapshotting collection, don't clear the
property table so that accessing the table during this GC is okay.

  • tests/heapProfiler/driver/driver.js:
  • tests/heapProfiler/property-edge-types.js: Added.
  • tests/heapProfiler/variable-edge-types.js: Added.

Tests covering the different edge types and data we capture.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jsc.cpp

    r197648 r197712  
    486486    }
    487487
    488     void finishCreation(VM& vm)
    489     {
    490         Base::finishCreation(vm);
    491     }
    492 
    493488    static void visitChildren(JSCell* cell, SlotVisitor& visitor)
    494489    {
Note: See TracChangeset for help on using the changeset viewer.