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

make the .line and inlined_at fields in LineInfoNode Int32 #44548

Merged
merged 4 commits into from
May 9, 2022

Conversation

KristofferC
Copy link
Member

@KristofferC KristofferC commented Mar 10, 2022

This reduces the size of LineInfoNode from 40 bytes to 32. Using Int32 for line numbers is also already done in various other places (as can be seen by the diff in the PR) so this makes things more consistent as well.

@@ -1112,7 +1112,8 @@ function deserialize(s::AbstractSerializer, ::Type{Core.LineInfoNode})
method = mod
mod = Main
end
return Core.LineInfoNode(mod, method, deserialize(s)::Symbol, deserialize(s)::Int, deserialize(s)::Int)
T = format_version(s) >= 19 ? Int32 : Int
return Core.LineInfoNode(mod, method, deserialize(s)::Symbol, Int32(deserialize(s)::T), Int32(deserialize(s)::T))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would just allow either type here, so deserializing works even without a header specifying the version.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is bd6615e what you meant?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can add a ::Union{Int32, Int} typeassert; the compiler will split that very nicely.

@KristofferC KristofferC merged commit 6ce2800 into master May 9, 2022
@KristofferC KristofferC deleted the kc/lineinfo_size branch May 9, 2022 12:41
vtjnash added a commit that referenced this pull request Aug 9, 2022
Fix regression introduced by #44548. Fix #45310.
ffucci pushed a commit to ffucci/julia that referenced this pull request Aug 11, 2022
pcjentsch pushed a commit to pcjentsch/julia that referenced this pull request Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants