(parent, file, stackIndex, stackPos, ascending)
| 158 | } |
| 159 | |
| 160 | function addOrUpdateChildNode(parent, file, stackIndex, stackPos, ascending) { |
| 161 | if (stackPos === -1) { |
| 162 | // We reached the end without finding the next step. |
| 163 | // If we are doing top-down call tree, update own ticks. |
| 164 | if (!ascending) { |
| 165 | parent.ownTicks++; |
| 166 | } |
| 167 | return; |
| 168 | } |
| 169 | |
| 170 | let stack = file.ticks[stackIndex].s; |
| 171 | console.assert(stackPos >= 0 && stackPos < stack.length); |
| 172 | let codeId = stack[stackPos]; |
| 173 | let code = codeId >= 0 ? file.code[codeId] : undefined; |
| 174 | // We found a child node. |
| 175 | let childId = childIdFromCode(codeId, code); |
| 176 | let child = parent.children[childId]; |
| 177 | if (!child) { |
| 178 | let vmState = file.ticks[stackIndex].vm; |
| 179 | child = createNodeFromStackEntry(code, codeId, vmState); |
| 180 | child.delayedExpansion = { frameList : [], ascending }; |
| 181 | parent.children[childId] = child; |
| 182 | } |
| 183 | child.ticks++; |
| 184 | addFrameToFrameList(child.delayedExpansion.frameList, stackIndex, stackPos); |
| 185 | } |
| 186 | |
| 187 | // This expands a tree node (direct children only). |
| 188 | function expandTreeNode(file, node, filter) { |
no test coverage detected
searching dependent graphs…