Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add LinkedClass.hasDirectInstances. #4960

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 2 commits into from
Mar 16, 2024

Conversation

sjrd
Copy link
Member

@sjrd sjrd commented Mar 15, 2024

Should be rebased on top of #4931 once it's merged, because of the second commit. Otherwise good to review.


It exposes whether the given class is directly instantiated. This is required for the WebAssembly backend, which needs to build vtables for concrete classes only.

The second commit only has a marginal impact, because the condition && linkedClass.hasRuntimeTypeInfo almost entirely compensated for the former imprecision, but it is free lunch after the first one.

@sjrd sjrd requested a review from gzm0 March 15, 2024 21:54
Copy link
Contributor

@gzm0 gzm0 left a comment

Choose a reason for hiding this comment

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

One clarification about the presence of runtime type info.

@sjrd sjrd force-pushed the linkedclass-hasdirectinstances branch from aafcbb7 to bacbecf Compare March 16, 2024 13:22
@sjrd sjrd marked this pull request as ready for review March 16, 2024 13:22
sjrd added 2 commits March 16, 2024 15:43
It exposes whether the given class is directly instantiated. This
is required for the WebAssembly backend, which needs to build
vtables for concrete classes only.
It is not useful for classes that only have strict sub instances,
i.e., classes that are effectively abstract.
@sjrd sjrd force-pushed the linkedclass-hasdirectinstances branch from bacbecf to f05baed Compare March 16, 2024 14:43
@sjrd sjrd merged commit 27bd1b8 into scala-js:main Mar 16, 2024
@sjrd sjrd deleted the linkedclass-hasdirectinstances branch March 16, 2024 23:19
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