Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

batch some binding changes #57765

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

batch some binding changes #57765

wants to merge 2 commits into from

Conversation

vtjnash
Copy link
Member

@vtjnash vtjnash commented Mar 13, 2025

For model simplicity (and eventually for better unspecialized compilation), try to backdate initial module operations back to world 0 if nobody could have observed them before, rather than putting each incremental operation in a separate, but unobserved (and unobservable) world. The actual change I was pursuing with this I will put up as a separate PR, and since it saves about 30 seconds on the bootstrapping but might need some extra work (it is more of a semantic change than the other changes here):

diff --git a/src/module.c b/src/module.c
index 214124f0835..814a4ac9cc2 100644
--- a/src/module.c
+++ b/src/module.c
@@ -1220,6 +1220,13 @@ int jl_module_public_(jl_module_t *from, jl_sym_t *s, int exported, size_t new_w
     }
     jl_atomic_fetch_or_relaxed(&b->flags, BINDING_FLAG_PUBLICP);
     if (was_exported != exported) {
+        if (from->usings_backedges == jl_nothing && !jl_object_in_image((jl_value_t*)from)) {
+            // until the first `using` of this module, simply backdate any export statements
+            // to apply to the current binding instead of making a new one
+            check_safe_newbinding(from, s);
+            bpart->kind |= PARTITION_FLAG_EXPORTED;
+            return 1;
+        }
         jl_replace_binding_locked2(b, bpart, bpart->restriction, bpart->kind | PARTITION_FLAG_EXPORTED, new_world);
         return 1;
     }

vtjnash added 2 commits March 13, 2025 19:29
For model simplicity (and eventually for better unspecialized
compilation), try to backdate initial module operations back to world 0
if nobody could have observed them before, rather than putting each
incremental operation in a separate, but unobserved world.
No real major effect, basically just making printing look tidier and
avoiding spamming the lock.
@vtjnash vtjnash requested a review from Keno March 13, 2025 19:51
@vtjnash vtjnash added the backport 1.12 Change should be backported to release-1.12 label Mar 13, 2025
@KristofferC KristofferC mentioned this pull request Mar 20, 2025
87 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 1.12 Change should be backported to release-1.12
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant