(newState)
| 1276 | } |
| 1277 | |
| 1278 | render(newState) { |
| 1279 | let oldState = this.currentState; |
| 1280 | |
| 1281 | if (!newState.file || newState.mode !== "summary") { |
| 1282 | this.element.style.display = "none"; |
| 1283 | this.currentState = null; |
| 1284 | return; |
| 1285 | } |
| 1286 | |
| 1287 | this.currentState = newState; |
| 1288 | if (oldState) { |
| 1289 | if (newState.file === oldState.file && |
| 1290 | newState.start === oldState.start && |
| 1291 | newState.end === oldState.end) { |
| 1292 | // No change, nothing to do. |
| 1293 | return; |
| 1294 | } |
| 1295 | } |
| 1296 | |
| 1297 | this.element.style.display = "inherit"; |
| 1298 | removeAllChildren(this.element); |
| 1299 | |
| 1300 | let stats = computeOptimizationStats( |
| 1301 | this.currentState.file, newState.start, newState.end); |
| 1302 | |
| 1303 | let table = document.createElement("table"); |
| 1304 | let rows = document.createElement("tbody"); |
| 1305 | |
| 1306 | function addRow(text, number, indent) { |
| 1307 | let row = rows.insertRow(-1); |
| 1308 | let textCell = row.insertCell(-1); |
| 1309 | textCell.textContent = text; |
| 1310 | let numberCell = row.insertCell(-1); |
| 1311 | numberCell.textContent = number; |
| 1312 | if (indent) { |
| 1313 | textCell.style.textIndent = indent + "em"; |
| 1314 | numberCell.style.textIndent = indent + "em"; |
| 1315 | } |
| 1316 | return row; |
| 1317 | } |
| 1318 | |
| 1319 | function makeCollapsible(row, arrow) { |
| 1320 | arrow.textContent = EXPANDED_ARROW; |
| 1321 | let expandHandler = row.onclick; |
| 1322 | row.onclick = () => { |
| 1323 | let id = row.id; |
| 1324 | let index = row.rowIndex + 1; |
| 1325 | while (index < rows.rows.length && |
| 1326 | rows.rows[index].id.startsWith(id)) { |
| 1327 | rows.deleteRow(index); |
| 1328 | } |
| 1329 | arrow.textContent = COLLAPSED_ARROW; |
| 1330 | row.onclick = expandHandler; |
| 1331 | } |
| 1332 | } |
| 1333 | |
| 1334 | function expandDeoptInstances(row, arrow, instances, indent, kind) { |
| 1335 | let index = row.rowIndex; |
nothing calls this directly
no test coverage detected