示例#1
0
void HeapGraphSerializer::reportNode(const WTF::MemoryObjectInfo& info)
{
    reportNodeImpl(info, m_nodeEdgesCount);
    m_nodeEdgesCount = 0;
    if (info.isRoot())
        m_roots.append(info.reportedPointer());
    pushUpdateIfNeeded();
}
示例#2
0
int HeapGraphSerializer::reportNodeImpl(const WTF::MemoryObjectInfo& info, int edgesCount)
{
    int nodeId = toNodeId(info.reportedPointer());
    int classNameId = info.classNameId();
    m_nodes->addItem(classNameId ? classNameId : m_unknownClassNameId);
    m_nodes->addItem(info.nameId());
    m_nodes->addItem(nodeId);
    m_nodes->addItem(info.objectSize());
    m_nodes->addItem(edgesCount);

    return nodeId;
}
示例#3
0
void HeapGraphSerializer::reportNode(const WTF::MemoryObjectInfo& info)
{
    HeapGraphNode node;
    node.m_type = addString(info.objectType());
    node.m_size = info.objectSize();
    node.m_className = addString(info.className());
    node.m_name = addString(info.name());
    // Node is always reported after its outgoing edges and leaves.
    node.m_edgeCount = m_edges.size() - m_lastReportedEdgeIndex;
    m_lastReportedEdgeIndex = m_edges.size();

    m_objectToNodeIndex.set(info.reportedPointer(), m_nodes.size());
    m_nodes.append(node);
}
示例#4
0
void HeapGraphSerializer::reportLeaf(const void*, const WTF::MemoryObjectInfo& info, const char* edgeName)
{
    HeapGraphNode node;
    node.m_type = addString(info.objectType());
    node.m_size = info.objectSize();
    node.m_className = addString(info.className());
    node.m_name = addString(info.name());

    int nodeIndex = m_nodes.size();
    m_nodes.append(node);

    HeapGraphEdge edge;
    edge.m_toIndex = nodeIndex;
    edge.m_targetIndexIsKnown = true;
    edge.m_name = addString(edgeName);
    m_edges.append(edge);
}