| 662 | } |
| 663 | |
| 664 | void 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 | |
| 684 | void JavaScriptHeapDumpBuilder::beginNode(JavaScriptHeapDumpNodeType type, |
| 685 | const StringBox& name, |