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

simpler incremental better backedges #22340

Merged
merged 2 commits into from
Jun 16, 2017
Merged

Conversation

vtjnash
Copy link
Member

@vtjnash vtjnash commented Jun 12, 2017

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

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);
Copy link
Member

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?

vtjnash added a commit that referenced this pull request Jun 13, 2017
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

(cherry-picked from 43cd219, PR #22340)
vtjnash added a commit that referenced this pull request Jun 13, 2017
@vtjnash
Copy link
Member Author

vtjnash commented Jun 13, 2017

(backport branch created at jn/release0.6-incremental-better-backedges)

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++) {
Copy link
Contributor

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?

Copy link
Member Author

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)

Copy link
Contributor

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?

Copy link
Member Author

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

@JuliaLang JuliaLang deleted a comment from vtjnash Jun 14, 2017
@JuliaLang JuliaLang deleted a comment from vtjnash Jun 14, 2017
vtjnash added 2 commits June 15, 2017 12:12
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
@vtjnash vtjnash force-pushed the jn/incremental-better-backedges branch from d55ec2c to 0e19311 Compare June 15, 2017 16:19
@StefanKarpinski
Copy link
Member

Notes: @tkelman will run PkgEval on this against the release-0.6 branch as soon as it passes CI here. If that looks good, this addresses #22158, which is the last remaining issue blocking 0.6.0 (as of RC3).

vtjnash added a commit that referenced this pull request Jun 15, 2017
vtjnash added a commit that referenced this pull request Jun 15, 2017
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)
vtjnash added a commit that referenced this pull request Jun 15, 2017
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)
@vtjnash vtjnash merged commit 9e563ba into master Jun 16, 2017
@vtjnash vtjnash deleted the jn/incremental-better-backedges branch June 16, 2017 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This change fixes an existing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Precompilation error on 0.6 "invalid age range update" assertion error, present in 0.6RC2 but not 0.6RC1
5 participants