-
-
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
make the .line
and inlined_at
fields in LineInfoNode
Int32
#44548
Conversation
c526a23
to
5d9a2f1
Compare
5d9a2f1
to
43f3db4
Compare
@@ -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)) |
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.
I would just allow either type here, so deserializing works even without a header specifying the version.
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.
Makes sense.
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.
Is bd6615e what you meant?
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.
We can add a ::Union{Int32, Int}
typeassert; the compiler will split that very nicely.
This reduces the size of
LineInfoNode
from 40 bytes to 32. UsingInt32
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.