-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
P2A bug or feature request we're likely to work onA bug or feature request we're likely to work onarea-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.Issues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.web-dev-compiler
Description
Enums' representation was updated to better match the VM's hot reload semantics in 6edbfd9.
The new representation now diverges significantly from how they're represented in kernel nodes:
- Enum fields are canonicalized solely based on their
name - All non-
namefields are appended to the canonicalized enum fields later (after types have been linked but after canonicalization) - The
indexfield is represented as a static lookup on the enclosing Enum'svaluesfield.
Our changes introduce some low hanging fruit optimization opportunities:
indexiterates throughvalues, which is a list, usingindexOf. We could make this a map for faster lookups.- our
extendEnumfunction effectively immediately accesses and initializes const enum fields in the const table. We should just emit these once ahead of time - likely in a separate enum handler (separate from normal consts).
Metadata
Metadata
Assignees
Labels
P2A bug or feature request we're likely to work onA bug or feature request we're likely to work onarea-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.Issues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.web-dev-compiler