Commit 1c3878c
authored
Merge adjacent implicit binding partitions (JuliaLang#57995)
After:
```
julia> convert(Core.Binding, GlobalRef(Base, :Intrinsics))
Binding Base.Intrinsics
617:∞ - implicit `using` resolved to constant Core.Intrinsics
0:616 - undefined binding - guard entry
julia> convert(Core.Binding, GlobalRef(Base, :Math))
Binding Base.Math
22128:∞ - constant binding to Base.Math
0:22127 - backdated constant binding to Base.Math
```
There is a bit of trickiness here. In particular, the question is, "when
do we check" whether the partition next to the one we currently looked
at happens to have the same implicit resolution as our current one. The
most obvious answer is that we should do it on access, but in practice
that would require essentially scanning back and considering every
possible world age state at every lookup. This is undesirable - the
lookup is not crazy expensive, but it can add up and most world ages we
never touch, so it is also wasteful.
This instead implements a different approach where we only perform the
resolution for world ages that somebody actually asked about, but can
then subsequently merge partitions if we do find that they are
identical. The logic for that is a bit involved, since we need to be
careful to keep the datastructure valid at every point, but does address
the issue.
Fixes JuliaLang#579231 parent 91505bb commit 1c3878c
File tree
7 files changed
+186
-47
lines changed- src
- test
7 files changed
+186
-47
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3266 | 3266 | | |
3267 | 3267 | | |
3268 | 3268 | | |
3269 | | - | |
| 3269 | + | |
3270 | 3270 | | |
| 3271 | + | |
| 3272 | + | |
3271 | 3273 | | |
3272 | 3274 | | |
3273 | 3275 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
760 | 760 | | |
761 | 761 | | |
762 | 762 | | |
763 | | - | |
| 763 | + | |
764 | 764 | | |
765 | 765 | | |
766 | 766 | | |
| |||
1942 | 1942 | | |
1943 | 1943 | | |
1944 | 1944 | | |
1945 | | - | |
1946 | | - | |
| 1945 | + | |
| 1946 | + | |
1947 | 1947 | | |
1948 | 1948 | | |
1949 | 1949 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
579 | 579 | | |
580 | 580 | | |
581 | 581 | | |
582 | | - | |
| 582 | + | |
583 | 583 | | |
584 | 584 | | |
585 | 585 | | |
| |||
674 | 674 | | |
675 | 675 | | |
676 | 676 | | |
677 | | - | |
| 677 | + | |
678 | 678 | | |
679 | 679 | | |
680 | 680 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1749 | 1749 | | |
1750 | 1750 | | |
1751 | 1751 | | |
1752 | | - | |
| 1752 | + | |
1753 | 1753 | | |
1754 | 1754 | | |
1755 | 1755 | | |
| |||
3618 | 3618 | | |
3619 | 3619 | | |
3620 | 3620 | | |
3621 | | - | |
| 3621 | + | |
3622 | 3622 | | |
3623 | 3623 | | |
3624 | 3624 | | |
| |||
3629 | 3629 | | |
3630 | 3630 | | |
3631 | 3631 | | |
3632 | | - | |
| 3632 | + | |
| 3633 | + | |
3633 | 3634 | | |
3634 | 3635 | | |
3635 | 3636 | | |
| |||
3640 | 3641 | | |
3641 | 3642 | | |
3642 | 3643 | | |
3643 | | - | |
3644 | | - | |
| 3644 | + | |
| 3645 | + | |
| 3646 | + | |
3645 | 3647 | | |
3646 | 3648 | | |
3647 | 3649 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
309 | 309 | | |
310 | 310 | | |
311 | 311 | | |
312 | | - | |
| 312 | + | |
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
| |||
730 | 730 | | |
731 | 731 | | |
732 | 732 | | |
733 | | - | |
| 733 | + | |
734 | 734 | | |
735 | 735 | | |
736 | 736 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
0 commit comments