MCPcopy Create free account
hub / github.com/Snapchat/Valdi / appendDump

Method appendDump

valdi/src/valdi/runtime/JavaScript/JavaScriptHeapDumpBuilder.cpp:664–682  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

662}
663
664void JavaScriptHeapDumpBuilder::appendDump(const Byte* data, size_t length, ExceptionTracker& exceptionTracker) {
665 JavaScriptHeapDumpParser parser(data, length, exceptionTracker);
666 if (!exceptionTracker) {
667 return;
668 }
669
670 // Use the first 16 bits of our id as a sequence for the heap we are about to append
671 // This ensures that all the ids we are processing within this dump will remain
672 // unique.
673 auto nodeIdMask = static_cast<uint64_t>(_appendDumpIndex++) << 48;
674
675 for (const auto& node : parser.getNodes()) {
676 beginNode(node.getType(), node.getName(), node.getId() | nodeIdMask, node.getSelfSizeBytes());
677
678 for (const auto& edge : node.getEdges()) {
679 appendEdge(edge.getType(), edge.getIdentifier(), edge.getNode().getId() | nodeIdMask);
680 }
681 }
682}
683
684void JavaScriptHeapDumpBuilder::beginNode(JavaScriptHeapDumpNodeType type,
685 const StringBox& name,

Callers 3

MergeHeapDumpFunction · 0.80
TESTFunction · 0.80
dumpHeapMethod · 0.80

Calls 8

getNodesMethod · 0.80
getSelfSizeBytesMethod · 0.80
getEdgesMethod · 0.80
getNodeMethod · 0.80
getIdentifierMethod · 0.65
getTypeMethod · 0.45
getNameMethod · 0.45
getIdMethod · 0.45

Tested by 2

MergeHeapDumpFunction · 0.64
TESTFunction · 0.64