| 371 | } |
| 372 | |
| 373 | void JavaScriptHeapDumpParser::parseEdges(JSONReader& reader, int32_t edgeCount) { |
| 374 | if (!reader.parseBeginArray()) { |
| 375 | return; |
| 376 | } |
| 377 | |
| 378 | auto fieldsCountPerEdge = _fieldsIndexes.fieldsCountPerEdge; |
| 379 | std::vector<uint32_t> components; |
| 380 | if (!parseComponents(reader, components, fieldsCountPerEdge * edgeCount)) { |
| 381 | return; |
| 382 | } |
| 383 | auto* componentsPtr = components.data(); |
| 384 | auto edgeTypeMaxSize = static_cast<uint32_t>(_fieldsIndexes.edgeTypeByIndex.size()); |
| 385 | |
| 386 | for (int32_t i = 0; i < edgeCount; i++) { |
| 387 | auto edgeTypeIndex = componentsPtr[_fieldsIndexes.edges.type]; |
| 388 | auto edgeNameOrIndex = componentsPtr[_fieldsIndexes.edges.nameOrIndex]; |
| 389 | auto edgeToNode = componentsPtr[_fieldsIndexes.edges.toNode]; |
| 390 | |
| 391 | if (edgeTypeIndex >= edgeTypeMaxSize) { |
| 392 | reader.setErrorAtCurrentPosition("Out of bounds edgeType"); |
| 393 | return; |
| 394 | } |
| 395 | |
| 396 | _edges.emplace_back(this, |
| 397 | _fieldsIndexes.edgeTypeByIndex[edgeTypeIndex], |
| 398 | edgeNameOrIndex, |
| 399 | edgeToNode / _fieldsIndexes.fieldsCountPerNode); |
| 400 | |
| 401 | componentsPtr += fieldsCountPerEdge; |
| 402 | } |
| 403 | |
| 404 | reader.parseEndArray(); |
| 405 | } |
| 406 | |
| 407 | void JavaScriptHeapDumpParser::parseStrings(JSONReader& reader) { |
| 408 | if (!reader.parseBeginArray()) { |
nothing calls this directly
no test coverage detected