Commit Graph

6 Commits

Author SHA1 Message Date
Johnni Winther f343c3ceb7 [cfe] Split cached expressions by receiver type
This splits cached expression by receiver type such that the initializing
expression for a cached variable isn't stored in the late variable
initializer, if it can be obtained in different ways. For instance having
both a list pattern and a map pattern in the same switch will trigger
caching of the .length property but obtaining expression differ base on
the receiver type, in the first case List.length and in second case
Map.length.

Closes #51138
Closes #51140

Change-Id: Ic4d8ca394a872113114514f72274413b836fdfb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280081
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-01-30 16:31:50 +00:00
Johnni Winther 68c326f455 [cfe] Refactor pattern matching generation
This enables caching during matching.

Closes https://github.com/dart-lang/sdk/issues/50934
Closes https://github.com/dart-lang/sdk/issues/50987

Change-Id: Iae1d8e0989029a193ba77f58338890d9bfa0c09f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279384
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-01-25 08:33:38 +00:00
Johnni Winther c1bb19d002 [cfe] Fix lowering encodings
Cleans up some missing promoted variable gets and temporary
variables that were incorrectly marked as final.

Change-Id: I26412efe2dbb45b807ad6aba7f67c27981b1619c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279011
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-01-16 10:13:44 +00:00
Chloe Stefantsova 4b1eba51eb [cfe] Handle rest patterns in map patterns
Part of https://github.com/dart-lang/sdk/issues/49749

Closes https://github.com/dart-lang/sdk/issues/50886

Change-Id: Ie44c35030aa3e74ab0b65f2e0abd0c5fb207976e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278501
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2023-01-07 00:09:45 +00:00
Chloe Stefantsova f1ce203361 [cfe] Add desugaring of simple cases of pattern variable declaration
The late variables aren't supported in this CL.

Part of https://github.com/dart-lang/sdk/issues/49749

Change-Id: Iebc50f716e3575c6dd7bce915e5e294d4c8c8363
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/276525
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-12-23 09:30:39 +00:00
Johnni Winther e6d59342ff [cfe] Build PatternVariableDeclaration in BodyBuilder
Change-Id: Ic55dbc03bf2cf4865275b186266c0f420263d406
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/273744
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2022-12-13 17:03:13 +00:00