Commit 6e8180a
[dart2js] Fix timing issue in protobuf conditional impact enqueueing.
Prior to this fix, the "processedMembers" field on the ResolutionWorldBuilder was getting used as the signal that a member was active and therefore any conditional uses dependent on it should be active.
In some cases the following would occur:
1) The listener gets a signal a member is active. It checks if there are any conditional uses for that member and sees none.
2) A conditional use is registered and the member is not indicated as active yet so the use is stored as pending in ResolutionEnqueuerListener.
3) "processedMembers" in ResolutionWorldBuilder is updated for a member that would mark the conditional use active. This doesn't trigger a check of the pending conditional uses.
If the enqueues happen in this order (which is not always the case), the conditional impact will not be marked active and the field will be erroneously tree shaken.
The solution here is to remove step 3 and add an analogous "usedMembers" update in step 1. Step 1 will always occur before step 2 so the conditional impact ledger and the usedMembers ledger will always stay in sync.
Change-Id: Ib732a4fe5dcc8fc7cbe9a6d37e1c239e287595ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395740
Reviewed-by: Mayank Patke <[email protected]>
Commit-Queue: Nate Biggs <[email protected]>1 parent 6f4cf56 commit 6e8180a
File tree
4 files changed
+23
-20
lines changed- pkg/compiler/lib/src
- js_backend
- resolution
4 files changed
+23
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
357 | 357 | | |
358 | 358 | | |
359 | 359 | | |
360 | | - | |
| 360 | + | |
361 | 361 | | |
362 | 362 | | |
363 | 363 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
| 261 | + | |
| 262 | + | |
261 | 263 | | |
262 | 264 | | |
263 | 265 | | |
264 | 266 | | |
| 267 | + | |
265 | 268 | | |
266 | 269 | | |
267 | 270 | | |
| |||
501 | 504 | | |
502 | 505 | | |
503 | 506 | | |
504 | | - | |
505 | | - | |
506 | | - | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
507 | 516 | | |
| 517 | + | |
508 | 518 | | |
509 | 519 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | 11 | | |
13 | 12 | | |
| 13 | + | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
35 | | - | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
337 | 338 | | |
338 | 339 | | |
339 | 340 | | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
| 341 | + | |
349 | 342 | | |
350 | 343 | | |
0 commit comments