Skip to content

Archive serialization updates and DCE fix #1354

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

Merged
merged 3 commits into from
Dec 17, 2024

Conversation

grantnelson-wf
Copy link
Collaborator

@grantnelson-wf grantnelson-wf commented Dec 5, 2024

I made some serialization updates for archives to fix an issue I accidentally introduced with my DCE update (sorry 😥) . The DCE data wasn't being serialized because of how I encapsulated it and kept the fields un-exported. This meant an archive that was reloaded from memory would have no DCE info and think every Decl in it are always alive. This was discovered as I was exploring what kind of information we'd need to add to an archive for cross package generic resolution.

  • I fixed the serialization of DCE whilst keeping the encapsulation.
  • I fixed the "TODO"s in archives around getting access to that actual types.Package and token.FileSet instead of having byte arrays.
  • I added some tests to the compiler that checks the JS after reloading from memory results in the same JS as without reloading, including DCE.
  • I changed how build time and source mod time is passed into cache. This is partially done because reloading the types.Package from the byte array is now done earlier and we needed to still skip that if the archive is out-of-date.

This is related to #1013 and #1270

@grantnelson-wf grantnelson-wf changed the title WIP: Archive serialization updates WIP: Archive serialization updates and DCE fix Dec 5, 2024
@grantnelson-wf grantnelson-wf changed the title WIP: Archive serialization updates and DCE fix Archive serialization updates and DCE fix Dec 5, 2024
@grantnelson-wf grantnelson-wf marked this pull request as ready for review December 5, 2024 21:17
@grantnelson-wf grantnelson-wf merged commit 428efba into gopherjs:master Dec 17, 2024
10 checks passed
@grantnelson-wf grantnelson-wf deleted the archiveSerial branch December 17, 2024 16:54
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.

3 participants