Commit Graph

98 Commits

Author SHA1 Message Date
Chloe Stefantsova f749040450 [model] Keep Let expressions intact in the verifier
Prior to this CL the CFE verifier would update the type of the
variable in Let expressions from `dynamic` to the computed static type
of the initializer. This CL removes the type update, making the
.expect files reflect the CFE output more accurately. Additionally, a
verification check is added to make sure the static type of the
initializer is assignable to the type of the Let variable.

Change-Id: I0b7b8f175bcb319678c323eb6440d93f1f384a85
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425500
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2025-04-30 03:25:50 -07:00
Johnni Winther 199bc8f50e [cfe] Fix some CFE tests
Change-Id: I569e385a98514c66a6761fcf7825ae884ad71fc0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/413740
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2025-03-05 07:10:51 -08:00
Jens Johansen e8ebee8845 [CFE] Expression evaluation will use static type when given 'dynamic'
Fixes https://github.com/dart-lang/sdk/issues/57040

Change-Id: I0f954390c364a91816f66af821e12bee93d4746a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/400302
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
2024-12-16 00:28:58 -08:00
Jens Johansen 91ba6976db [CFE/VM] Fix expression evaluation to not introduce new parameters because of extension types
To support expression evaluation on extension types - which are a static
thing and thus doesn't exist in the VM - on the CFE side we try to find
the available variables so that, for any variables that are found to be
extension types, we can treat them as such. This was introduced in
https://dart-review.googlesource.com/c/sdk/+/339900.

The problem is that this could accidentally _introduce_ new variables,
which would introduce new arguments to the created procedure causing
weird behavior in the VM as for instance seen in
https://github.com/dart-lang/sdk/issues/56911.

This CL makes sure to only set the type for already known variables (as
passed by the VM), thus not introducing new variables and fixing the
issues seen.

Fixes https://github.com/dart-lang/sdk/issues/56911

Change-Id: Ie8b8ae12438338e9c3d248d00cc5da81df5b8ece
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/400120
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2024-12-12 23:03:32 -08:00
Jens Johansen 9f23661055 [CFE] Know about '#this' if finding scopes *on* an extension type
member.

See
https://github.com/dart-lang/sdk/issues/56911#issuecomment-2443799783
for context.

Bug: https://github.com/dart-lang/sdk/issues/56911
Change-Id: If990f41c58268b592d575e1280831b1ed120d54d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/392341
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2024-10-29 14:24:37 +00:00
Jens Johansen c7bce42b19 [CFE] Fix expression compilation with extension methods imported via prefix
Fixes https://github.com/dart-lang/sdk/issues/56554

Change-Id: I060a76cc3d3bb946283eff17c8feb93f136a8d8f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/389100
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2024-10-09 11:40:50 +00:00
Jens Johansen 54f1ee4067 [VM/CFE] Fix expression compilation with record types
Fixes https://github.com/dart-lang/sdk/issues/56859

TEST=pkg/vm_service/test/evaluate_with_record_{1,2}_test.dart + CFE test

Change-Id: I4fdd2bc8e6c04fc59aaad28a192fe0b1833f000d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/388841
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-10-09 11:01:57 +00:00
Vyacheslav Egorov 196f6c90c2 [vm] Create dart:_compact_hash library.
This opens possibility for other core libraries to access implementation
details of compact hash maps/sets and call special "core-library-only"
methods.

TEST=ci

CoreLibraryReviewExempt: VM only library change
Change-Id: I1d7524932c34e6fbe2428853dd547d58bef2d061
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/379840
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2024-08-13 09:20:05 +00:00
Johnni Winther b6249b851f [cfe] Introduce compilation unit
This adds CompilationUnit as a supertype of LibraryBuilder as a
first step towards splitting libraries from compilation units.
The SourceLoader._builders are now compilation units and lookups
in to the SourceLoader are split into compilation units, loaded
library builders and source library builders.

Change-Id: If9958a5a67443170cc1a538106d9efd424e36889
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369643
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2024-06-10 13:41:24 +00:00
Johnni Winther 6bec589f00 [cfe] Add least supported version check of 2.12
Change-Id: Iff8a3ea624b7130cb09359fbc9787a98ba07c4e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364700
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2024-05-08 09:28:45 +00:00
Johnni Winther 63d2008355 [cfe] Make kernel AST and CompilerOptions use strong mode by default
TEST=existing

Change-Id: I8d8bc59dc742a7499338ea2d23a611696492603c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/359222
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2024-04-05 07:45:08 +00:00
Chloe Stefantsova 88403d9c3e [cfe] Show nullability formula for extension types in textual output
This is a follow-up to
https://dart-review.googlesource.com/c/sdk/+/350323 and
https://dart-review.googlesource.com/c/sdk/+/351141. It clarifies the
nullability markers shown in the .expect files.

TEST=existing

Change-Id: I248531dd892ea676935d5479c86e43ce8a87628a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350823
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2024-03-05 09:49:31 +00:00
Chloe Stefantsova ec597188e5 [cfe] Address more cases of declaredNullability being overridden
This is a follow-up to https://dart-review.googlesource.com/c/sdk/+/350323

This CL addresses more of the cases where the `declaredNullability` of a type
object is overridden by the overall `nullability`, introducing unexpected
values to the field.

TEST=existing

Change-Id: I4830cd8113604dcc38a01ff09a9c1b2f50e091ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351141
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2024-02-21 15:37:11 +00:00
Johnni Winther c4724e5a89 [cfe] Add Throw.forErrorHandling
This adds a `forErrorHandling` to the `Throw` node. This is used that the `throw` is *not* present in the source code but added to ensure
correctness and/or soundness of the generated code.

This is used for instance in the lowering for handling duplicate writes
to a late final field or for pattern assignments that don't match.

In response to https://github.com/dart-lang/sdk/issues/53519

TEST=updated ast-to-text

Change-Id: Ie103829d98fda9cd7b64e9e3d893e77d1e86d7d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347900
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
2024-02-19 12:12:02 +00:00
Johnni Winther 8a2f6495b3 [cfe] Add isImplicitCall to DynamicInvocation
This adds an ìsImplicitCall to DynamicInvocation which is set on
expression like `d()` where `d` has type dynamic, to distinguish
the for `d.call()`.

TEST=pkg/front_end/testcases/general/dynamic_call.dart

Change-Id: I73beb911bdb315a510c862e6d4876cf7673ec3c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346240
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2024-01-19 08:39:30 +00:00
Jens Johansen c959173b4c [CFE/VM] Expression compilation when inside an extension type method
VM: De-mangle names as done with extension methods.
CFE: Handle #this as with extension methods.

TEST=ci
Change-Id: I512798632a016025bf30edf8a0586d9085b4e3cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/339960
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2023-12-07 11:15:25 +00:00
Jens Johansen f5743b9f44 [CFE] Expression compilation: Use static type for extension types
This - combiend with sending the scriptUri and offset - allows us to
expression evaluate stuff on extension types.

Change-Id: I0db6c1f52ad3db4ce1a1a2a721e8f3e70033f9ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/339900
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2023-12-06 12:03:09 +00:00
Johnni Winther 33fcaec0f1 [cfe] Handle exhaustiveness checking in expression evaluation
The expression evaluator called directly into the constant evaluator,
skipping the setting up of the exhaustiveness cache used for
exhaustiveness checking.

Closes #52905

Change-Id: I367ff73d8e23127811f99dfbf451e66eef452443
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/314060
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-07-18 10:17:49 +00:00
Johnni Winther 36641368bb [cfe] Treat NonNullableByDefault as default in ast-to-text
This changes ast-to-text to mark legacy libraries instead of
non-nullable-by-default libraries.

TEST=existing

Change-Id: Ib01147e4ef48c2c5b2ffc6b23547998344dfdf2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307121
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2023-06-08 06:28:50 +00:00
Chloe Stefantsova 1a8b1370a0 [cfe] Don't emit throw of AbstractClassInstantiationError
Change-Id: I4e464bdf1decf8484cd042e973e916b5aa3b8d1c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/271960
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2022-11-24 16:35:51 +00:00
Ryan Macnak a2de36e708 [vm] Rename the default implementation classes of Map and Set.
_InternalLinkedHashMap => _Map
_InternalImmutableLinkedHashMap => _ConstMap
_InternalLinkedHashSet => _Set
_InternalImmutableLinkedHashSet => _ConstSet

This makes things nicer to read in places that display implementation names, such as stack traces, debuggers, profilers and inspectors.

TEST=ci
Change-Id: Iec851c80ea2086cbe79934565dbf35f04809a836
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/266303
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2022-11-15 17:15:58 +00:00
Aske Simon Christensen f2bc59738c Rename the VM's internal hash set classes
Rename `_CompactLinkedHashSet` to `_InternalLinkedHashSet` and
`_CompactImmutableLinkedHashSet` to `_InternalImmutableLinkedHashSet`
to make the names consistent with the corresponding `Map` class names
and to distinguish them from the non-VM-specific hash maps and sets,
which are generally named starting with `_Compact`.

Tested: ci
Change-Id: Ic1ebc44ba8beba34ceab382a4edddc6624fe3fb3
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258002
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2022-09-09 14:04:34 +00:00
Johnni Winther 6980a1b4c3 [kernel] Add VariableDeclaration.hasDeclaredInitializer
The computation of default values on super parameters requires the
notion of a declared initializer. By adding this as a flag to
VariableDeclarations the implementation can now be normalized across
parameter from source and dill.

TEST=existing

Change-Id: Ic980e68b569e3bdab38d2c7c7e4374e0c931a87b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/240403
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-04-07 14:54:08 +00:00
Jens Johansen 7b8b06d717 [CFE] Fix crash when serializing expression compilation procedure with deferred import
https://github.com/dart-lang/sdk/issues/48587

Change-Id: I37cc8313886d626edafbe04acfef90b0fe666622
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238043
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2022-03-22 12:07:48 +00:00
Jens Johansen cd10bb10dc [CFE] Fix crash if giving non-class as position in expression suite
Change-Id: Icf171550b34fb1bf01ff20c9ba8caba500a31ccf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238042
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2022-03-22 12:06:38 +00:00
Jens Johansen b6f03e150e [CFE] Reproduction & fix of crashes found by weekly bot (#83)
Calling "SpecialCasedBinaryOperator" and "SpecialCasedTernaryOperator"
with wrong number of parameters (especially too few) would not go well.
It's now checked and goes a lot better.

Change-Id: Id9606db869f020bbd7264686adaf9521bd263fb9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237900
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2022-03-21 11:41:48 +00:00
Johnni Winther 280a87df1e [cfe] Change expression_suite to use embedded sources
This changes that expression_suite tests to embed the needed source
code in the yaml file. Single source and multi sources are supported.
When using a single source, the file name is implicitly "main.dart"
and the "position" and "entry_point" yaml properties are updated to
supports this, meaning that the yaml files should only use file names
when using multiple sources.

Change-Id: Ia6756eb86a7b72dea2187f72b9f2c75c28783a0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237680
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-03-17 14:17:26 +00:00
Johnni Winther 5f7d226ae8 [cfe] Enable nnbd in expression suite
Change-Id: Iad66d179b4b2795ba68a65cf078fa69a4f65fae2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237040
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-03-16 11:44:31 +00:00
Johnni Winther 2e6d7bf6ec [cfe] Report error on instantiation of enums from .dill
Closes https://github.com/dart-lang/sdk/issues/48350

Change-Id: I0cedf8a5a12e1a8dee546eec73e012519a054e13
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/232384
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-02-11 11:24:16 +00:00
Jens Johansen 7771ed34cf [CFE] Fix crash in expression compilation caused by having dill builders in source builders scope
This should fix https://github.com/flutter/flutter/issues/97500
and the reproducable part of https://github.com/flutter/devtools/issues/3599

Change-Id: I16b45e4cc8074e0b0a62ae3220d91ae1424bacf3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231004
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2022-01-31 15:34:24 +00:00
Jens Johansen 5896462f77 [CFE] Reproduction of expression crash when starting DevTools
Change-Id: I27df2c0d594f19b7a0e051341f756589f589c4e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231003
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2022-01-31 14:33:14 +00:00
Jens Johansen adb1dc9380 [VM] [CFE]: Make VM send over type information for expression compilation
Missing:
* Function types.
* Type variables in bounds, like "method<T, S extends T>() {}" and
  "method<T extends Foo<T>>() {}"

This is in many ways a follow-up to
https://dart-review.googlesource.com/c/sdk/+/212286

TEST=service and (cfe) expression suite tests added.

Change-Id: I20472b59ed73e9845f073e176d73b2c213f9407a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215760
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2022-01-28 07:49:21 +00:00
Jens Johansen a9e2703a62 [CFE] Fix scopes for expression compilation
Before this CL, when doing expression compilation we would build scopes
like this:

[exp scope locals] -> [exp scope imports] -> [org scope]

Which means that if one looks up "Foo" in the (first) scope and
something with that name is available both via imports and via
the original scope one would find it via the import.
That's not what we want considering the expression compilation
library should pretend to be the original library.

Instead this CL copies the original scope into the expression
compilation local scope:

[exp scope locals + org scope] -> [exp scope imports]

Meaning that we would find the correct "Foo" if one was defined in
the original library and (another one by the same name is) available
via an import.

Fixes https://github.com/dart-lang/sdk/issues/48169

Change-Id: Ib9e089b465f7da1a4c5799a2165fd06c735ea7da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/229904
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2022-01-26 10:03:32 +00:00
Johnni Winther a4a1f2c0d5 [cfe] Update precedence for instantiation and constant nodes in ast-to-text
TEST=existing

Change-Id: I6269aaef293765e68e5f119184f0d24f40da9aec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212821
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-09-10 12:10:27 +00:00
Jens Johansen 48d8225b17 [VM] [CFE]: Expression compilation inside extension method
This CL handles expression compilation inside extension methods better.
It is now possible to evaluate "this" and other methods defined in the
extension.

https://github.com/dart-lang/sdk/issues/46757

TEST=service tests added.

Change-Id: I3c71eb23117e26b01961f32103f4046f0b537976
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212286
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-09-10 12:02:57 +00:00
Johnni Winther b3af778a38 [cfe] Add UnresolvedKind for fine grained unresolved reporting
- including tests for issues 46719 and 46887

Change-Id: I601fcfcb956e059f502cbece29fb2a6a00f68846
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210464
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-08-25 09:51:54 +00:00
Johnni Winther 5dc4d65114 [kernel] Add InvalidExpression.expression
... and use this to wrap expressions instead of Let

TEST=existing

Change-Id: I6d1f5cfa4693222840d6cb406790c39c6ae63e5d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208580
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-08-04 08:40:18 +00:00
Jens Johansen c0361c291c [CFE] Allow (more) private access in expression compilation
Previously one would for instance get an error when trying to expression
compile an expression like `Foo._private()` on a class like

```
class Foo {
  static int _private() { return 42; }
}
int _private() { return 42; }
```

whereas the expression `_private()` would be fine.

This CL fixes that, so both expressions are accepted.

Change-Id: I959bd5bf8bf5770852add3b979c8382d005ecf41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204782
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2021-06-24 14:58:29 +00:00
Johnni Winther 1adf5dc7c6 [cfe] Verify that only new method invocation nodes are generated when supported
Closes https://github.com/dart-lang/sdk/issues/46339

Change-Id: I404a8afd141f615cfcb6050f280a1410adaac0ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204580
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-06-23 09:41:35 +00:00
Alexander Markov 88021fd67a [vm] Enable new kernel AST invocation nodes for the VM, take 2
This change was already reviewed at
https://dart-review.googlesource.com/c/sdk/+/197586.

Bugfix is in the separate change:
https://dart-review.googlesource.com/c/sdk/+/199365.

TEST=ci

Issue: https://github.com/dart-lang/sdk/issues/45340
Change-Id: I4311909e4893af53e88895512f03d3ef84c6bc5f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199366
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-05-20 18:53:45 +00:00
Martin Kustermann 31364331e9 Revert "[vm] Enable new kernel AST invocation nodes for the VM"
This reverts commit 53e3c079b7.

Reason for revert: This change has seemingly caused errors of the form
```
stderr >> Unhandled exception:
stderr >> Invalid argument(s): Missing canonical name for Reference to <XXX>
stderr >> #0      BinaryPrinter.writeNullAllowedReference (package:kernel/binary/ast_to_binary.dart:894:9)
stderr >> #1      BinaryPrinter.visitTypedefType (package:kernel/binary/ast_to_binary.dart:2410:5)
stderr >> #2      TypedefType.accept (package:kernel/ast.dart:11115:42)
stderr >> #3      BinaryPrinter.writeNode (package:kernel/binary/ast_to_binary.dart:403:10)
stderr >> #4      BinaryPrinter.writeOptionalNode (package:kernel/binary/ast_to_binary.dart:496:7)
```

Issue https://github.com/dart-lang/sdk/issues/45966

Original change's description:
> [vm] Enable new kernel AST invocation nodes for the VM
>
> TEST=ci
>
> Issue: https://github.com/dart-lang/sdk/issues/45340
> Change-Id: Ibb307d8df8ff4ae8f2efad177880634ec9e27905
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197586
> Commit-Queue: Alexander Markov <alexmarkov@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Aske Simon Christensen <askesc@google.com>

TBR=vegorov@google.com,alexmarkov@google.com,johnniwinther@google.com,askesc@google.com

Change-Id: I05d010378cfcc5ba40f2be58b01b3ed27a8fc31e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Issue: https://github.com/dart-lang/sdk/issues/45340
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199000
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2021-05-10 12:32:38 +00:00
Alexander Markov 53e3c079b7 [vm] Enable new kernel AST invocation nodes for the VM
TEST=ci

Issue: https://github.com/dart-lang/sdk/issues/45340
Change-Id: Ibb307d8df8ff4ae8f2efad177880634ec9e27905
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197586
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2021-05-09 21:00:28 +00:00
Dmitry Stefantsov c191551fac [cfe] Remove BottomType
TEST=Covered by existing tests.

Change-Id: Ied8be1874164e68e0a3a48e1b2f9a33310071381
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183009
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-02-24 13:21:55 +00:00
Johnni Winther 56f46b0659 Remove non-nullable experiment flag from front_end test cases.
This changes the CFE expectation test suites to use unsound null safety
as default to avoid passing --enable-experiments=no-non-nullable to opt
out old test folders.

This change removes most test folders from the 'strong' tester, since
this now only supports sound null safety, which requires all libraries
to be opted in. Instead, the 'weak' tester now runs all test folders.
Additionally the 'outline' tester is changed to use unsound null safety
so that it call be used on all test folders.

The 'fast_strong' tester is removed since it should just be run locally
and it can be run by passing an option to the other testers.

References to non-existing 'shaker' folder has been removed from
testing.json.


Change-Id: Ibcc306f7b27d06b9637c205238bc408194f1d062
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184787
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2021-02-18 12:29:18 +00:00
Alexander Markov 9d1a307954 [vm] Add specialized factory constructors for small list literals
Flutter gallery in release mode:
AOT snapshot size arm64 -0.22%, arm -0.21%
instructions size arm64 -0.46%, arm -0.4%

TEST=existing tests

Fixes https://github.com/dart-lang/sdk/issues/44391

Change-Id: I4733e91ecf4601c0bcde725cf9e97f5db0b8bc13
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175821
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2021-01-11 19:32:30 +00:00
Johnni Winther 76dcd9e37d [cfe] Ensure implicit-as and typedef reference are legacy erased
TEST=existing expectation tests

Change-Id: I48571347ef95b709a0804d284902ac6af7115afd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176083
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-12-15 15:34:40 +00:00
Johnni Winther f7ae22a4c1 Reland "[cfe] Improve encoding of set/list literals for unified collections"
Change-Id: I4f8098e110c9a5e5d6e102b8c6230e85c1575c6a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175040
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-12-04 09:52:20 +00:00
Johnni Winther 7a130ccc49 [cfe] Rename isNullableByDefault annotation to isLegacy
TEST=Existing tests

Change-Id: I0aad4deea062ba2016a8be47489ffaa970bfc03e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174260
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-11-27 13:36:29 +00:00
Johnni Winther 48ae906dc4 Revert "[cfe] Improve encoding of set/list literals for unified collections"
This reverts commit 3380168c76.

Reason for revert: Performance regression on VM

Original change's description:
> [cfe] Improve encoding of set/list literals for unified collections
>
> Closes #44188
>
> Change-Id: Ib7d457f4beef0f7284922803d46cfe5d4b14cb1d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173268
> Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
> Commit-Queue: Johnni Winther <johnniwinther@google.com>

TBR=dmitryas@google.com,johnniwinther@google.com

Change-Id: If61882f73e59d0d61a2c23bd28179a881545d295
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173541
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-11-23 16:00:08 +00:00
Johnni Winther 3380168c76 [cfe] Improve encoding of set/list literals for unified collections
Closes #44188

Change-Id: Ib7d457f4beef0f7284922803d46cfe5d4b14cb1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173268
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-11-23 11:21:33 +00:00