Commit 24256fb
committed
Merge pull request #4290 from dlibby-:build/dlibby/dummyvtable_fix_1.8
(courtesy of Bo Cupp)
Fixing two issues in marking.
1. If there are only precisely traced objects allocated, the markStack used for non-precisely traced objects will be empty and crash when Pop is called. An IsEmpty check was added to prevent popping from an empty stack.
2. A race between allocating and background marking can lead to calling a virtual Trace method on an object that has a null v-table pointer. It isn't possible to call trace until after a flag has been set by the allocator, so prior to that happening a dummy v-table pointer is now installed until control returns to the caller of the recycler's alloc method where a final v-table pointer will overwrite the dummy one. This must be done with a MemoryBarrier on ARM to guarantee the writing of the v-table happens before the attribute updates.
We also need to fixup the address in FillCheckPad
We were tripping an assert that the v-table doesn't match the padding pattern. Because we install
the v-table earlier, there's a new mode for FillCheckPad where the first void* bytes should be skipped.
The object is not initialized, but already has a valid v-table that doesn't need to be verified and shouldn't
be 0-filled.
File tree
6 files changed
+92
-38
lines changed- lib/Common
- Core
- Memory
6 files changed
+92
-38
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
553 | 553 | | |
554 | 554 | | |
555 | 555 | | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
556 | 566 | | |
557 | 567 | | |
558 | 568 | | |
| |||
618 | 628 | | |
619 | 629 | | |
620 | 630 | | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
621 | 640 | | |
622 | 641 | | |
623 | 642 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
237 | 241 | | |
238 | | - | |
| 242 | + | |
239 | 243 | | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
| 244 | + | |
244 | 245 | | |
245 | | - | |
246 | | - | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
247 | 251 | | |
248 | | - | |
249 | | - | |
| 252 | + | |
| 253 | + | |
250 | 254 | | |
251 | | - | |
| 255 | + | |
252 | 256 | | |
253 | | - | |
254 | | - | |
| 257 | + | |
| 258 | + | |
255 | 259 | | |
256 | | - | |
257 | | - | |
| 260 | + | |
| 261 | + | |
258 | 262 | | |
259 | | - | |
260 | | - | |
| 263 | + | |
| 264 | + | |
261 | 265 | | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
266 | 270 | | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
271 | 275 | | |
| 276 | + | |
272 | 277 | | |
273 | 278 | | |
274 | 279 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7314 | 7314 | | |
7315 | 7315 | | |
7316 | 7316 | | |
| 7317 | + | |
| 7318 | + | |
| 7319 | + | |
| 7320 | + | |
| 7321 | + | |
| 7322 | + | |
| 7323 | + | |
| 7324 | + | |
| 7325 | + | |
| 7326 | + | |
| 7327 | + | |
| 7328 | + | |
| 7329 | + | |
| 7330 | + | |
| 7331 | + | |
7317 | 7332 | | |
7318 | 7333 | | |
7319 | 7334 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
41 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
171 | 172 | | |
172 | 173 | | |
173 | 174 | | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | 175 | | |
182 | 176 | | |
183 | 177 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
132 | 141 | | |
133 | 142 | | |
134 | 143 | | |
| |||
138 | 147 | | |
139 | 148 | | |
140 | 149 | | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
141 | 155 | | |
142 | 156 | | |
143 | 157 | | |
| |||
149 | 163 | | |
150 | 164 | | |
151 | 165 | | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
152 | 176 | | |
153 | 177 | | |
154 | | - | |
155 | 178 | | |
156 | 179 | | |
157 | | - | |
158 | | - | |
159 | 180 | | |
160 | 181 | | |
161 | 182 | | |
| |||
0 commit comments