Commit 949eb44
[vm, gc] Add write-write fence after initializing object headers, or defer marking new-space objects in an active TLAB.
On architectures with a weak memory model, there is the possibility that the concurrent marker can see the publishing store of a new object before it sees the initializing store of that object's header. On an M1, the barrier to prevent reordering these stores is fairly cheap, so we emit this barrier on Mac/iOS ARM64. Otherwise, this barrier is very expensive (or at least expensive for some hardware within the ABI), so instead we avoid the race by deferring marking of objects inside an active TLAB.
Disable TSAN instrumentation on the marker setting the mark bit, as TSAN does not understand fences.
TEST=ooo arm64 machines
Bug: #56845
Change-Id: I0676661a7cf941fdc6b451e516d890c26826bb3b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/389265
Commit-Queue: Ryan Macnak <[email protected]>
Reviewed-by: Siva Annamalai <[email protected]>1 parent 1e69ae8 commit 949eb44
File tree
31 files changed
+171
-65
lines changed- runtime/vm
- compiler
- assembler
- heap
31 files changed
+171
-65
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
116 | 123 | | |
117 | 124 | | |
118 | 125 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1558 | 1558 | | |
1559 | 1559 | | |
1560 | 1560 | | |
1561 | | - | |
| 1561 | + | |
1562 | 1562 | | |
1563 | 1563 | | |
1564 | 1564 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1778 | 1778 | | |
1779 | 1779 | | |
1780 | 1780 | | |
1781 | | - | |
| 1781 | + | |
1782 | 1782 | | |
1783 | 1783 | | |
1784 | 1784 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1602 | 1602 | | |
1603 | 1603 | | |
1604 | 1604 | | |
1605 | | - | |
| 1605 | + | |
1606 | 1606 | | |
1607 | 1607 | | |
1608 | 1608 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1816 | 1816 | | |
1817 | 1817 | | |
1818 | 1818 | | |
1819 | | - | |
| 1819 | + | |
1820 | 1820 | | |
1821 | 1821 | | |
1822 | 1822 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1677 | 1677 | | |
1678 | 1678 | | |
1679 | 1679 | | |
1680 | | - | |
| 1680 | + | |
1681 | 1681 | | |
1682 | 1682 | | |
1683 | 1683 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3628 | 3628 | | |
3629 | 3629 | | |
3630 | 3630 | | |
3631 | | - | |
| 3631 | + | |
3632 | 3632 | | |
3633 | 3633 | | |
3634 | 3634 | | |
| |||
3671 | 3671 | | |
3672 | 3672 | | |
3673 | 3673 | | |
3674 | | - | |
3675 | | - | |
| 3674 | + | |
3676 | 3675 | | |
3677 | 3676 | | |
3678 | 3677 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1034 | 1034 | | |
1035 | 1035 | | |
1036 | 1036 | | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
1037 | 1050 | | |
1038 | 1051 | | |
1039 | 1052 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1969 | 1969 | | |
1970 | 1970 | | |
1971 | 1971 | | |
1972 | | - | |
| 1972 | + | |
1973 | 1973 | | |
1974 | 1974 | | |
1975 | 1975 | | |
| |||
2011 | 2011 | | |
2012 | 2012 | | |
2013 | 2013 | | |
2014 | | - | |
| 2014 | + | |
2015 | 2015 | | |
2016 | 2016 | | |
2017 | 2017 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1232 | 1232 | | |
1233 | 1233 | | |
1234 | 1234 | | |
| 1235 | + | |
| 1236 | + | |
1235 | 1237 | | |
1236 | 1238 | | |
1237 | 1239 | | |
| |||
1948 | 1950 | | |
1949 | 1951 | | |
1950 | 1952 | | |
| 1953 | + | |
| 1954 | + | |
| 1955 | + | |
| 1956 | + | |
| 1957 | + | |
| 1958 | + | |
| 1959 | + | |
| 1960 | + | |
| 1961 | + | |
| 1962 | + | |
| 1963 | + | |
| 1964 | + | |
| 1965 | + | |
1951 | 1966 | | |
1952 | 1967 | | |
1953 | 1968 | | |
| |||
0 commit comments