Skip to content

[Class modifiers] VM implementation #50733

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

Closed
itsjustkevin opened this issue Dec 15, 2022 · 7 comments
Closed

[Class modifiers] VM implementation #50733

itsjustkevin opened this issue Dec 15, 2022 · 7 comments
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. P2 A bug or feature request we're likely to work on triaged Issue has been triaged by sub team type-enhancement A request for a change that isn't a bug
Milestone

Comments

@itsjustkevin
Copy link
Contributor

No description provided.

@munificent munificent changed the title [NCM] VM implementation [Class modifiers] VM implementation Dec 17, 2022
@lrhn lrhn added the area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. label Dec 20, 2022
@alexmarkov alexmarkov self-assigned this Dec 20, 2022
@a-siva a-siva added P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug triaged Issue has been triaged by sub team labels Dec 20, 2022
@a-siva a-siva added this to the Dart 3 beta 1 milestone Dec 20, 2022
@itsjustkevin
Copy link
Contributor Author

@aam is there work that needs to be done on this?

@alexmarkov
Copy link
Contributor

@itsjustkevin It looks like your question should be addressed to me and not @aam .

I don't expect any work in the VM related to the correctness of the class modifiers feature. However, we may consider using new class modifiers to do some minor optimizations (for example, we can try to reduce number of guarded classes in JIT mode when classes are declared final).

@itsjustkevin
Copy link
Contributor Author

This is the second time I've done this @alexmarkov, won't make the mistake again.

With your comment above, maybe this is more appropriate in the beta 3 milestone than beta 2, or something we call for now and consider post launch.

@alexmarkov
Copy link
Contributor

Sounds reasonable. Changed milestone to Dart 3 stable.

@kallentu
Copy link
Member

I prematurely closed #51287 for sealed classes.
May want to sync it to the same status as class modifiers VM implementation if needed.

@alexmarkov
Copy link
Contributor

As specified in the current versions of the feature specification proposals (https://github.com/dart-lang/language/blob/master/accepted/future-releases/class-modifiers/feature-specification.md and https://github.com/dart-lang/language/blob/master/accepted/future-releases/sealed-types/feature-specification.md), sealed and final modifiers are not very useful as they allow subtyping within library and even "re-opening" of the subtype hierarchy. In order to make them useful for open-world implementations (such as VM/JIT and maybe DDC), we should probably calculate effectively final flag on classes (meaning they cannot have subtypes), both from sealed and final, and perform optimizations based on that flag. Note that closed-world implementations (such as AOT, dart2js and dart2wasm) would not benefit from those modifiers at all as they have full knowledge of the class hierarchy already.

So I think it's okay to keep just one issue open.

@alexmarkov
Copy link
Contributor

Filed a separate issue about "effectively final" flag: #51765. It's a minor optimization and can be done after Dart 3.0 release.

We don't have anything else planned for class modifiers and sealed, so closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. P2 A bug or feature request we're likely to work on triaged Issue has been triaged by sub team type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

5 participants