-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
simpler incremental better backedges #22340
Conversation
src/dump.c
Outdated
arraylist_push(to_restore, (void*)pcallee); | ||
arraylist_push(to_restore, (void*)callee); | ||
*pcallee = (jl_array_t*) HT_NOTFOUND; | ||
jl_array_ptr_1d_append(callees, callee); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
callee
sounds singular to me, so it's a bit confusing that it's an array. Could use a comment explaining what it's an array of, and/or a variable rename. Is it an array of things called by caller
?
(backport branch created at jn/release0.6-incremental-better-backedges) |
11a984b
to
64b7c46
Compare
src/dump.c
Outdated
@@ -2175,12 +2175,14 @@ static void jl_insert_methods(jl_array_t *list) | |||
static size_t lowerbound_dependent_world_set(size_t world, arraylist_t *dependent_worlds) | |||
{ | |||
size_t i, l = dependent_worlds->len; | |||
if (world <= (size_t)dependent_worlds->items[l - 1]) | |||
return world; | |||
for (i = 0; i < l; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this is sorted and can't be empty? Then only check the first element?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The value of the return value is also meaningful. (This is doing std::lower_bound on a sorted vector, not just a range test)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. I think I got the sorting order wrong. Though in that case this should probably be a bisect?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, but it wouldn't be faster, so no
the previous attempt to preserve the backedge map was being too cute it is more reliable to simply flatten the whole map into the new caller also corrects the validation that the backedge is not already invalid make sure internal backedges are only internal: this preserves the expected invariant for jl_insert_backedges/jl_method_instance_delete that any backedges encountered there are purely internal / new enable GC slightly sooner when loading precompiled modules (part of #20671) reverts 11a984b - but who needed that anyways
d55ec2c
to
0e19311
Compare
the previous attempt to preserve the backedge map was being too cute it is more reliable to simply flatten the whole map into the new caller also corrects the validation that the backedge is not already invalid make sure internal backedges are only internal: this preserves the expected invariant for jl_insert_backedges/jl_method_instance_delete that any backedges encountered there are purely internal / new enable GC slightly sooner when loading precompiled modules (part of #20671) reverts 11a984b - but who needed that anyways (cherry-picked from 6fdf36e, PR #22340)
the previous attempt to preserve the backedge map was being too cute it is more reliable to simply flatten the whole map into the new caller also corrects the validation that the backedge is not already invalid make sure internal backedges are only internal: this preserves the expected invariant for jl_insert_backedges/jl_method_instance_delete that any backedges encountered there are purely internal / new enable GC slightly sooner when loading precompiled modules (part of #20671) reverts 11a984b - but who needed that anyways (cherry-picked from 0e19311, PR #22340)
This uses a much simpler method of restoring backedges, so that we don't have the troublesome edges cases exposed by the old method.
fix #22158
fix #22125