Skip to content
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

VM implementation for enhanced enums #47861

Closed
Tracked by #47849
devoncarew opened this issue Dec 6, 2021 · 1 comment
Closed
Tracked by #47849

VM implementation for enhanced enums #47861

devoncarew opened this issue Dec 6, 2021 · 1 comment
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.

Comments

@devoncarew
Copy link
Member

See #47849 for the main tracking issue.

@devoncarew devoncarew added the area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. label Dec 6, 2021
@alexmarkov alexmarkov self-assigned this Dec 6, 2021
copybara-service bot pushed a commit that referenced this issue Jan 4, 2022
This change prepares VM for enhanced enums language feature.
List of enum values is now queried using 'values' static field
and not inferred from the list of fields (as enhanced enums allow
arbitrary fields).

TEST=ci

Issue: #47861
Change-Id: Id6eabb6c4ac5a5f03b22ceb67d57431082e22576
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/225020
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
copybara-service bot pushed a commit that referenced this issue Jan 7, 2022
VM queries the list of enum elements during class finalization
in order to be prepared for the future hot reload. This is done by
reading 'values' field. However, 'values' field can be missing if
running from a dill file which was tree-shaken. This change avoids
crash in that case and handles missing 'values' field as if it was
declared with an empty list.

TEST=Manually tested in g3.

Issue: #47861
Bug: b/213584901
Change-Id: Ic7271476ee115aa93a73a824af3a867784b820eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/226981
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
copybara-service bot pushed a commit that referenced this issue Jan 18, 2022
With enhanced enums language feature enum classes can have a mixin, so
its superclass is an arbitrary class and not necessarily _Enum.
This change removes lookups of 'index' and '_name' fields in the
superclass of an enum class. They are now looked up once in _Enum
class and saved in the object store.

TEST=co19/LanguageFeatures/Enhanced-Enum/semantics_A01_t01

Issue: #47861
Change-Id: I2b93d389ab92e0274641e0f1bd65471e6407f3f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/228220
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
@alexmarkov
Copy link
Contributor

Currently there are only 2 failing tests for enhanced enums on the VM configurations:

The implementation in the VM is complete and there are no outstanding failures related to the VM.

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.
Projects
None yet
Development

No branches or pull requests

3 participants