WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@nex3
Copy link
Member

@nex3 nex3 commented Nov 6, 2025

  • Thanks for your contribution! Please replace this text with a description of what this PR is changing or adding and why, list any relevant issues, and review the contribution guidelines below.

  • I’ve reviewed the contributor guide and applied the relevant portions to this PR.
Contribution guidelines:
  • See our contributor guide for general expectations for PRs.
  • Larger or significant changes should be discussed in an issue before creating a PR.
  • Contributions to our repos should follow the Dart style guide and use dart format.

Note that this repository uses Gerrit for code reviews. Your pull request will be automatically converted into a Gerrit CL and a link to the CL written into this PR. The review will happen on Gerrit but you can also push additional commits to this PR to update the code review.

@copybara-service
Copy link

Thank you for your contribution! This project uses Gerrit for code reviews. Your pull request has automatically been converted into a code review at:

https://dart-review.googlesource.com/c/sdk/+/460141

Please wait for a developer to review your code review at the above link; you can speed up the review if you sign into Gerrit and manually add a reviewer that has recently worked on the relevant code. See CONTRIBUTING.md to learn how to upload changes to Gerrit directly.

Additional commits pushed to this PR will update both the PR and the corresponding Gerrit CL. After the review is complete on the CL, your reviewer will merge the CL (automatically closing this PR).

@copybara-service
Copy link

https://dart-review.googlesource.com/c/sdk/+/460141 has been updated with the latest commits from this pull request.

9 similar comments
@copybara-service
Copy link

https://dart-review.googlesource.com/c/sdk/+/460141 has been updated with the latest commits from this pull request.

@copybara-service
Copy link

https://dart-review.googlesource.com/c/sdk/+/460141 has been updated with the latest commits from this pull request.

@copybara-service
Copy link

https://dart-review.googlesource.com/c/sdk/+/460141 has been updated with the latest commits from this pull request.

@copybara-service
Copy link

https://dart-review.googlesource.com/c/sdk/+/460141 has been updated with the latest commits from this pull request.

@copybara-service
Copy link

https://dart-review.googlesource.com/c/sdk/+/460141 has been updated with the latest commits from this pull request.

@copybara-service
Copy link

https://dart-review.googlesource.com/c/sdk/+/460141 has been updated with the latest commits from this pull request.

@copybara-service
Copy link

https://dart-review.googlesource.com/c/sdk/+/460141 has been updated with the latest commits from this pull request.

@copybara-service
Copy link

https://dart-review.googlesource.com/c/sdk/+/460141 has been updated with the latest commits from this pull request.

@copybara-service
Copy link

https://dart-review.googlesource.com/c/sdk/+/460141 has been updated with the latest commits from this pull request.

@copybara-service
Copy link

https://dart-review.googlesource.com/c/sdk/+/460141 has been updated with the latest commits from this pull request.

1 similar comment
@copybara-service
Copy link

https://dart-review.googlesource.com/c/sdk/+/460141 has been updated with the latest commits from this pull request.

@srujzs
Copy link
Contributor

srujzs commented Dec 16, 2025

You may need to resolve conflicts before gerrit picks up the latest commit as a patch that we can CQ+1 on.

@nex3
Copy link
Member Author

nex3 commented Dec 16, 2025

Working on it, but unfortunately that means I need to do a bunch of recompiling so I can regenerate accurate IR tests. (Do these things really get a bunch of opaque numbers updated every time someone touches the JS interop library?)

@nex3
Copy link
Member Author

nex3 commented Dec 17, 2025

Merge conflicts resolved.

@copybara-service
Copy link

https://dart-review.googlesource.com/c/sdk/+/460141 has been updated with the latest commits from this pull request.

1 similar comment
@copybara-service
Copy link

https://dart-review.googlesource.com/c/sdk/+/460141 has been updated with the latest commits from this pull request.

@srujzs
Copy link
Contributor

srujzs commented Dec 17, 2025

(Do these things really get a bunch of opaque numbers updated every time someone touches the JS interop library?)

dart2wasm emits JS methods that then makes the desired interop call for each unique interop method. To minimize code size, we just use a monotonically increasing number. I'm guessing they all increased by 18 because we added 18 interop methods (although I count only 17?).

What is surprising though is that we include all the SDK interop members even if they don't get used.


We add generated interop procedures into the Library that declares the interop member here:

library.addProcedure(procedure);
.

When we're emitting the JS module, we iterate over all the Librarys in the program that have import or export pragmas:

library.procedures.forEach(_importOrExport);
.

Importantly, in this later step, interop procedures that were not called in user libraries are no longer contained in the Library node. I have to assume TFA removed these procedures, but it isn't clear why it doesn't remove unused members in the SDK. @mkustermann, is this WAI? Does TFA not tree-shake SDK members?

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