Repository navigation
Commit d0f5aa9
committed
[JSC] Decouple Heap's world state from the Collector's thread lock
https://bugs.webkit.org/show_bug.cgi?id=329379
rdar://191261786
Reviewed by Mark Lam.
Heap used the Collector's thread lock and condition variable directly. Both
should be implementation details of the Collector, so that how the Collector
serves requests and how a mutator waits and is woken can change independently,
as both will for global collections.
- waitForCollector held the lock to check its wait and set the waiting bit
together. It now sets the bit first, then checks through Collector queries
that take the lock themselves. If what the mutator waits for completes after
the check, the Collector still clears the bit and wakes the mutator.
- finishRelinquishingConn held the lock while it notified the collector thread
and unparked the world state. Only the notify needs the lock, so it moves
into Collector::didRelinquishConn(), and the unpark stays in Heap.
So the world state and the Collector's lock no longer depend on each other: Heap
waits and wakes only through its world state, and only the Collector takes its
lock.
Also rewrite waitForCollector's comments, which described an older protocol.
Canonical link: https://commits.webkit.org/325143@main1 parent 39d8ce5 commit d0f5aa9
4 files changed
Lines changed: 49 additions & 47 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
254 | 263 | | |
255 | 264 | | |
256 | 265 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
132 | 135 | | |
133 | 136 | | |
134 | 137 | | |
135 | 138 | | |
136 | 139 | | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
137 | 150 | | |
138 | 151 | | |
139 | 152 | | |
140 | 153 | | |
141 | 154 | | |
142 | 155 | | |
143 | 156 | | |
144 | | - | |
145 | 157 | | |
146 | 158 | | |
147 | | - | |
148 | 159 | | |
149 | 160 | | |
150 | 161 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1486 | 1486 | | |
1487 | 1487 | | |
1488 | 1488 | | |
1489 | | - | |
1490 | | - | |
| 1489 | + | |
1491 | 1490 | | |
1492 | 1491 | | |
1493 | | - | |
1494 | | - | |
1495 | | - | |
1496 | | - | |
1497 | | - | |
1498 | | - | |
1499 | | - | |
1500 | | - | |
1501 | | - | |
1502 | | - | |
1503 | | - | |
1504 | | - | |
1505 | | - | |
1506 | | - | |
1507 | | - | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
1508 | 1500 | | |
1509 | 1501 | | |
1510 | 1502 | | |
1511 | 1503 | | |
1512 | | - | |
1513 | | - | |
| 1504 | + | |
| 1505 | + | |
1514 | 1506 | | |
1515 | 1507 | | |
1516 | | - | |
1517 | | - | |
| 1508 | + | |
1518 | 1509 | | |
1519 | | - | |
1520 | | - | |
1521 | | - | |
| 1510 | + | |
| 1511 | + | |
1522 | 1512 | | |
1523 | 1513 | | |
1524 | 1514 | | |
| |||
1598 | 1588 | | |
1599 | 1589 | | |
1600 | 1590 | | |
1601 | | - | |
| 1591 | + | |
1602 | 1592 | | |
1603 | | - | |
1604 | | - | |
1605 | | - | |
1606 | | - | |
1607 | | - | |
1608 | | - | |
| 1593 | + | |
| 1594 | + | |
1609 | 1595 | | |
1610 | 1596 | | |
1611 | 1597 | | |
| |||
1734 | 1720 | | |
1735 | 1721 | | |
1736 | 1722 | | |
1737 | | - | |
1738 | | - | |
1739 | | - | |
1740 | | - | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
1741 | 1726 | | |
1742 | 1727 | | |
1743 | 1728 | | |
1744 | 1729 | | |
1745 | | - | |
1746 | | - | |
1747 | | - | |
1748 | | - | |
| 1730 | + | |
| 1731 | + | |
| 1732 | + | |
1749 | 1733 | | |
1750 | 1734 | | |
1751 | 1735 | | |
1752 | 1736 | | |
1753 | | - | |
1754 | | - | |
1755 | | - | |
1756 | | - | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
1757 | 1740 | | |
1758 | 1741 | | |
1759 | 1742 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
680 | 680 | | |
681 | 681 | | |
682 | 682 | | |
683 | | - | |
684 | | - | |
| 683 | + | |
685 | 684 | | |
686 | 685 | | |
687 | 686 | | |
| |||
0 commit comments