Repository navigation
Commit cf89f15
committed
[JSC] Assert the invariants of Heap::m_worldState where the protocol relies on them
https://bugs.webkit.org/show_bug.cgi?id=329038
rdar://191078586
Reviewed by Keith Miller.
The mutator-collector protocol relies on rules about each heap's world state,
only some of which are asserted. Assert the rest where the code depends on them:
- A mutator holds the conn, or waits for the collector, only while it has heap
access, and a stopped mutator has neither: in acquireAccessSlow,
releaseAccessSlow, resumeTheMutator, setMutatorWaiting, clearMutatorWaiting
and requestCollection.
- End sets the epilogue bit once per collection, while the mutator is stopped
or conducting, and the heap's next collection begins only after the epilogue
has run: in setNeedCollectionEpilogue, beginCollectionInEachHeap and
finishChangingPhase.
- While the world is stopped, each member heap's mutator is stopped or
conducting: in Collector::stopThePeriphery.
finishChangingPhase no longer calls handleNeedCollectionEpilogue() when a
mutator conducts into a stopped phase, since the bit is never set there; it
asserts that instead.
Also add Heap::needCollectionEpilogue(), turn the log-then-crash checks in
releaseAccessSlow, stopThePeriphery and resumeThePeriphery into release asserts
that report the world state, and say why the epilogue must run when it does.
Canonical link: https://commits.webkit.org/324850@main1 parent cd20093 commit cf89f15
3 files changed
Lines changed: 41 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
| 238 | + | |
| 239 | + | |
238 | 240 | | |
239 | 241 | | |
240 | 242 | | |
| |||
482 | 484 | | |
483 | 485 | | |
484 | 486 | | |
| 487 | + | |
| 488 | + | |
485 | 489 | | |
486 | 490 | | |
487 | 491 | | |
| |||
733 | 737 | | |
734 | 738 | | |
735 | 739 | | |
| 740 | + | |
| 741 | + | |
736 | 742 | | |
737 | 743 | | |
738 | 744 | | |
| |||
753 | 759 | | |
754 | 760 | | |
755 | 761 | | |
756 | | - | |
| 762 | + | |
| 763 | + | |
757 | 764 | | |
758 | 765 | | |
759 | 766 | | |
| |||
766 | 773 | | |
767 | 774 | | |
768 | 775 | | |
769 | | - | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
770 | 782 | | |
771 | 783 | | |
772 | 784 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1363 | 1363 | | |
1364 | 1364 | | |
1365 | 1365 | | |
1366 | | - | |
1367 | | - | |
1368 | | - | |
1369 | | - | |
| 1366 | + | |
1370 | 1367 | | |
1371 | 1368 | | |
1372 | 1369 | | |
| |||
1392 | 1389 | | |
1393 | 1390 | | |
1394 | 1391 | | |
1395 | | - | |
1396 | | - | |
1397 | | - | |
1398 | | - | |
| 1392 | + | |
1399 | 1393 | | |
1400 | 1394 | | |
1401 | 1395 | | |
| |||
1442 | 1436 | | |
1443 | 1437 | | |
1444 | 1438 | | |
| 1439 | + | |
1445 | 1440 | | |
1446 | 1441 | | |
1447 | 1442 | | |
| |||
1537 | 1532 | | |
1538 | 1533 | | |
1539 | 1534 | | |
1540 | | - | |
1541 | | - | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
1542 | 1539 | | |
1543 | 1540 | | |
1544 | 1541 | | |
| |||
1564 | 1561 | | |
1565 | 1562 | | |
1566 | 1563 | | |
1567 | | - | |
1568 | | - | |
1569 | | - | |
1570 | | - | |
1571 | | - | |
1572 | | - | |
1573 | | - | |
1574 | | - | |
1575 | | - | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
1576 | 1568 | | |
1577 | 1569 | | |
1578 | 1570 | | |
| |||
1629 | 1621 | | |
1630 | 1622 | | |
1631 | 1623 | | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
1632 | 1627 | | |
1633 | 1628 | | |
1634 | 1629 | | |
| |||
1653 | 1648 | | |
1654 | 1649 | | |
1655 | 1650 | | |
1656 | | - | |
| 1651 | + | |
| 1652 | + | |
| 1653 | + | |
| 1654 | + | |
1657 | 1655 | | |
1658 | 1656 | | |
1659 | 1657 | | |
| |||
1674 | 1672 | | |
1675 | 1673 | | |
1676 | 1674 | | |
1677 | | - | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
1678 | 1678 | | |
1679 | 1679 | | |
1680 | 1680 | | |
1681 | 1681 | | |
1682 | | - | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
1683 | 1687 | | |
1684 | 1688 | | |
1685 | 1689 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
371 | 371 | | |
372 | 372 | | |
373 | 373 | | |
| 374 | + | |
374 | 375 | | |
375 | 376 | | |
376 | 377 | | |
| |||
0 commit comments