Commit Graph

1972 Commits

Author SHA1 Message Date
Lasse R.H. Nielsen b837038cf9 Update dart:async documentation and fix null-safety mistakes in the documentation.
Large update to `Zone` which sorely needed it.

Change-Id: I5d398e4c401ea8b17c7706e7e01ae2e22137ce77
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178620
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-01-14 16:40:53 +00:00
Dmitry Stefantsov 0de9b16e7a [cfe] Give a hint on erroneous super-bounded types
Change-Id: Ifb4caaf8995f9f139fd24b4ae6e9c071a83459ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178240
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-01-14 16:25:23 +00:00
Daco Harkes 9922491ba8 [vm/ffi] Migrate pkg/front_end tests to Allocator
New API landed in: https://dart-review.googlesource.com/c/sdk/+/177705

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

Change-Id: Id45274313edbb3842438b66b9c0917a86884c8ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178993
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-01-14 12:27:53 +00:00
Daco Harkes 5d40d52fca [vm/ffi] Add Opaque type
Issue: https://github.com/dart-lang/sdk/issues/44622
Issue: https://github.com/dart-lang/sdk/issues/43974

TEST=samples/ffi/sqlite/lib/src/bindings/types.dart
TEST=tests/ffi/vmspecific_static_checks_test.dart

Change-Id: Ib9e72df6a07b1bc2b72a7db66f945652814baf51
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-arm-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try,analyzer-nnbd-linux-release-try,front-end-linux-release-x64-try,front-end-nnbd-linux-release-x64-try,benchmark-linux-try,dart-sdk-linux-try,pkg-linux-release-try,vm-ffi-android-release-arm-try,vm-ffi-android-release-arm64-try,vm-kernel-nnbd-win-debug-x64-try,vm-kernel-win-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178984
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
2021-01-13 17:04:08 +00:00
Lasse R.H. Nielsen ef8cc2c1cf Remove LateInitializationError.
As per planned breaking change to let platforms decide how they and what throw for late initiaization errors,
we no longer need a public `LateInitializationError` class. It's confusing to have one if some platforms throw
something else instead.

Removes the public abstract class. The dart:_internal implementation class `LateError` no longer implements it.
This is the only implementation of the public interface, and the class which platforms either throw directly,
or through front-end lowering of the feature.

Remove mentions in tests. All tests now just expect `Error`, some platform specific tests might test the message.

TEST=rewrote tests referring to LateInitializationError.

Change-Id: I54344a67f89ce101ed770412db134e12354cdcc4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174928
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-01-12 20:21:33 +00:00
Lasse R.H. Nielsen fe7efd5606 Update documentation in dart:core.
Fix null safety issues and tweak documentation where it can be improved.

Change-Id: Ia8cc20274ae151c454662bf5f137913787365a64
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177960
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-01-12 13:06:41 +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
Daco Harkes 78ca1452dc [cfe/test/ffi] Move ffi_sample.dart to nnbd folder
Bumps `package:ffi` to a version using `?`.

Moves `ffi_sample.dart` from `general` to `nnbd` to prevent errors on
the usage of `?` in `package:ffi`.

Change-Id: I8bce1850ce4d144174a2e3705b0ae00523b45c73
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178201
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-01-08 14:15:12 +00:00
Dmitry Stefantsov cf8887bd7e [cfe] Update the conversion algorithm for checking super-bounded types
The update is specified in the following:
https://github.com/dart-lang/language/pull/1133

Change-Id: I2850b1acf7c94b8174c21cf899c9b926a03d9cc8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175726
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2021-01-08 11:58:32 +00:00
Johnni Winther 35e23fbb88 [cfe] Add tests in preparation for refactoring of class hierarchy builder
Change-Id: Ic8df1dabe3ed53c41e0660315f87c313759585e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177707
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-01-08 11:25:51 +00:00
Johnni Winther dd5b455a0c [dart2js] Handle super access in mixin declarations
This crashed because the canonical name for the replace procedure
was unbound before all references to it had been loaded, causing
subsequent reads of the canonical name to create reference without
a target.

This broke the flutter web smoke tests.

Change-Id: I6249cfda85ff76b5e2dd31bb0cf8d6312ad50c1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177861
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-01-07 13:45:18 +00:00
Jens Johansen 5fac8d3d71 [CFE] Reproduction and fix of duplicate string-named 'abstract member-signature'
Before this CL, the map we use to "reuse" references when doing
experimental invalidation mapped from String to Reference.
In bug #44523 two abstract member-signatures have the same textual
(String) name meaning that via the lookup one would get the correct
one, one would get the wrong one, they would get the same one
which eventually causes a crash when trying to serialize.

This CL fixes the issue by mapping via the Name instead, which
basically - for private names - wraps the name and the library
which disambiguates it.

This CL also includes the reproduction of #44523.

Fixes #44523.

TEST=Mostly relying on existing test coverage.

Change-Id: Ib62ebca0b7f5092f0b8410d3c458663c3032eca1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177704
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-01-07 13:11:18 +00:00
Johnni Winther 80c307feb8 [cfe] Handle FutureOr<int> as context type for +
Closes #44595

Change-Id: I0631deb9d23b5e4a7618268b5e1f0f850bfd5ad9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177703
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-01-06 14:57:30 +00:00
Johnni Winther 061d714971 [cfe] Add test for issue 40945
This has been fixed for some time. Adding a test to verify.

Closes #40945

Change-Id: I7ce93c7c1b8cd054bb57a1923aa8a3f98a9ad7db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177606
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-01-06 09:07:00 +00:00
Johnni Winther b4d4316de0 [cfe] Rename stub kinds
ForwardingStub -> AbstractForwardingStub
ForwardingSuperStub -> ConcreteForwardingStub
MixinStub -> AbstractMixinStub
MixinSuperStub -> ConcreteMixinStub

TEST=refactoring

Change-Id: Ice76a41ce8e1071f553ed8fd3ecbb29c97377161
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177129
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-12-29 16:54:55 +00:00
Dmitry Stefantsov 0642e7a245 [cfe] Deem all intersection types syntactically not nullable
Closes #44362.

Bug: https://github.com/dart-lang/sdk/issues/44362
Change-Id: Id54de1848e6af1108956476e241bab5c0ed96a4b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177124
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2020-12-29 09:58:35 +00:00
Johnni Winther 60702d4158 [cfe] Make field assignability immutable
Changes fields to be either mutable or immutable by construction.
This ensure that we don't create setter references for fields that
cannot be assigned to and is a prerequisite for replacing @fields/
@fields= canonical names with @getters/@setters.

TEST=existing expectation tests and verification

Change-Id: I70b9a504ee6f221b7c334ac02620feb0d5f7ae01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176665
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-12-28 16:11:14 +00:00
Johnni Winther 5645bd0e06 [cfe] Don't replace dispatch target with interface target on super property set
In response to b/176332835

Change-Id: Id131ba44817aa55399ba3b44b9fe5db833847f75
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177100
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-12-28 14:43:14 +00:00
Johnni Winther 52db62dd65 [cfe] Use MixinSuperStub
This CL adds stub for each concrete mixed in member into mixin
applications. The body of the stub calls the original member via
a super call.

This addition means that resolution of super access now use the
stub and not the original declaration as the target, which means
that it will be correct even when mixed in members are cloned. For
this reason, dart2js no longer needs to perform its own super
member resolution.

When a super call targets a mixin super stub (after cloning) it
can be optimized away by redirecting the call to the `stubTarget`
of the call. This optimization is performed in dart2js.

Since dart2js now uses the correct super target, its runtime
mixin application needs to avoid overriding members already
declared in the mixin application. These members are the
forwarding super stubs which ensure that correct runtime types
when members with covariant parameters are implemented.


Change-Id: Iab71ffcc400aa6a683987bc20b9553a263ebc8e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176526
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-12-25 23:32:17 +00:00
Daco Harkes b6b82dd3ac [vm/ffi] Support nested structs
This CL adds support for nested structs in FFI calls, callbacks, and
memory loads and stores through the Struct classes itself.

Nesting empty structs and nesting a structs in themselves (directly or
indirectly) is reported as error.

This feature is almost fully implemented in the CFE transformation.

Because structs depend on the sizes of their nested structs, the structs
now need to be processed in topological order.

Field access to nested structs branches at runtime on making a derived
Pointer if the backing memory of the outer struct was a Pointer or
making a TypedDataView if the backing memory of the outer struct was
a TypedData.

Assigning to a nested struct is a byte for byte copy from the source.

The only changes in the VM are contained in the native calling
convention calculation which now recursively needs to reason about
fundamental types instead of just 1 struct deep.

Because of the amount of corner cases in the calling conventions that
need to be covered, the tests are generated, rather than hand-written.

ABIs tested on CQ: x64 (Linux, MacOS, Windows), ia32 (Linux, Windows),
arm (Android softFP, Linux hardFP), arm64 Android.
ABIs tested locally through Flutter: arm64 iOS.
ABIs not tested: ia32 Android (emulator), x64 iOS (simulator), arm iOS.
TEST=runtime/bin/ffi_test/ffi_test_functions_generated.cc
TEST=runtime/bin/ffi_test/ffi_test_functions.cc
TEST=tests/{ffi,ffi_2}/function_structs_by_value_generated_test.dart
TEST=tests/{ffi,ffi_2}/function_callbacks_structs_by_value_generated_tes
TEST=tests/{ffi,ffi_2}/function_callbacks_structs_by_value_test.dart
TEST=tests/{ffi,ffi_2}/vmspecific_static_checks_test.dart

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

Contains a temporary workaround for
https://github.com/dart-lang/sdk/issues/44454.

Change-Id: I5e5d10e09e5c3fc209f5f7e997efe17bd362214d
Cq-Include-Trybots: luci.dart.try:dart-sdk-linux-try,dart-sdk-mac-try,dart-sdk-win-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-mac-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-kernel-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-ia32-try,vm-kernel-nnbd-mac-release-x64-try,vm-kernel-nnbd-win-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-nnbd-linux-debug-x64-try,vm-kernel-precomp-win-release-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-msan-linux-release-x64-try,vm-kernel-precomp-msan-linux-release-x64-try,vm-kernel-precomp-android-release-arm_x64-try,analyzer-analysis-server-linux-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169221
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-12-18 09:34:35 +00:00
Johnni Winther bc9f91587e [cfe] Support extensions by default in textual outline testing
Change-Id: I844aefe253041b755fa04c8467a8503715f232f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176442
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-12-17 17:57:43 +00:00
Johnni Winther 706632d994 [cfe] Use isPureExpression to ensure temp variables are not created for this expressions
Closes #44475

Change-Id: Ie5a767448e27d2f84b90ebd0ebe2287d897fcd6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176441
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-12-17 17:57:43 +00:00
Paul Berry 6853db8e77 Update code to avoid breakages when language issue #1274 implemented.
In preparation for supporting inference of non-nullability from local
boolean variables, we need to change a small amount of code to avoid
test breakages.

Bug: https://github.com/dart-lang/language/issues/1274
Change-Id: Ia49e37f9ba2cd94967c7e1d411a3269593c0eeb9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176501
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-12-17 15:16:04 +00:00
Dmitry Stefantsov 6b7442ce14 [cfe] Check types in declared interfaces of local functions
Closes #44476.

Bug: https://github.com/dart-lang/sdk/issues/44476
Change-Id: Id3457d4e6cc2248e773f40e2c9a22b88de58b659
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176245
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2020-12-17 10:14:43 +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
Jens Johansen 75e6406f5e [CFE] Fix incremental compiler bug when library claimed to have other library as part
This CL fixes a bug where the incremental compiler could potentially
* invalidate to few builders,
* output too few libraries, or
* crash

if one library claimed to have another (stand-alone) library as part.

This could happen when the library claimed to be a part was invalidated,
though it wouldn't always because it is sensitive to ordering.

The issue is that the library claiming to have another library as a part
lists that library as its part. Normally such a "pair" is only one
library and thus only has one LibraryBuilder (when from dill). Because
it's actually two libraries though, there are actually two LibraryBuilders.
Under normal circumstances we map from the part uri to the "main builder"
but in this case that could (depending on ordering) override the actual
builder which caused the bug.

Change-Id: Iff9037575ff53b48126b20f9fc5a6c8a52ed5198
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176241
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-12-15 15:20:10 +00:00
Jens Johansen 9673d47a06 [CFE] Fix crash when trying to use DillLibraryBuilder as part
Change-Id: I612b7d5a50c6f60513529ae1bb8365e2a91ca014
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176084
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-12-15 13:44:50 +00:00
Jens Johansen f94c7a10ef [CFE] Set accessor problem on malformed uri (aka set as synthetic)
This avoids a crash caused by libraries with such an uri being
used as a part, and a DillLibraryBuilder thus being added (or attempted
to be added) to a list of SourceLibraryBuilders.

Change-Id: I4f7dc8e982e86407337b2c6ea2e3ef608e7f1064
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176081
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-12-15 07:50:49 +00:00
Johnni Winther 5dbb6e245b [kernel,cfe,ddc] Add new method invocation node to package:kernel
This adds
* InstanceInvocation, DynamicInvocation, FunctionInvocation, and
   LocalFunctionInvocation, EqualsCall, and EqualsNull as a future
   replacement for MethodInvocation.
* InstanceGet, DynamicGet, InstanceTearOff, and FunctionTearOff as a
   future replacement for PropertyGet
* InstanceSet and DynamicSet as a future replacement of PropertySet
* StaticTearOff as an addition to StaticGet

TEST=pkg/front_end/test/binary_md_vm_tags_and_version_test.dart

This CL combines
* https://dart-review.googlesource.com/c/sdk/+/171729
* https://dart-review.googlesource.com/c/sdk/+/172649
* https://dart-review.googlesource.com/c/sdk/+/172650
* https://dart-review.googlesource.com/c/sdk/+/172651

using the initial encoding fo EqualsCall and EqualsNull

Change-Id: I98e020b5f2b405a812663bdcd2c05aba8efa74c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175480
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-12-14 10:55:48 +00:00
Johnni Winther b24ac718ec [cfe] Handle missing suffix recovery in body builder
Closes #44347

Change-Id: I576e657a74b89cad5b150f11a3af59ee1d5c963d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175660
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-12-10 14:00:37 +00:00
Johnni Winther 80161c3081 [cfe] Use Member.fileUri for DillMemberBuilder
Change-Id: Iab72b4975029fb262d4fd62a121b7d73a03edb53
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175640
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-12-10 10:17:17 +00:00
Jens Johansen c1d2c25ef1 [CFE] Add constant coverage in expect files
Change-Id: I0fc009708aa6e330366ad0689c4634a1df90d9c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175368
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-12-10 08:57:17 +00:00
Johnni Winther 8103c90dbf [cfe] Use combined member signature in override inference in legacy code
+ emit only one message per method given that it now always has the
same root cause, namely that the combined member signature does not
exist.

Closes #31797

Change-Id: Id89a5557c5fdda1db087c20cbe92847dd08216a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175305
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-12-09 17:33:20 +00:00
Jens Johansen a8b372057e [parser] Recover better from 'late' field/variable declaration in non-nnbd
Fixes #44379
(https://github.com/dart-lang/sdk/issues/44379)

Change-Id: If97d0d57b1fe16777f6208b49a8b472420ac526a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175306
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-12-09 13:01:39 +00:00
Johnni Winther 3d19493f2d [cfe] Add flag to identify lowered locals
+ add predicate helpers to identify these and extract their
original names.

TEST=pkg/front_end/test/predicates/predicate_test.dart

Change-Id: I4d94c575d010b6b01c985eaf5392b9e0e979d044
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175250
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-12-08 14:53:14 +00:00
Johnni Winther c19225224b [cfe] Handle lowered Map/Set/List constants in constant evaluation
Change-Id: Ib3b3a39478fe0927fc0168a9916684fd9ac09f77
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175247
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-12-08 10:42:43 +00:00
Johnni Winther 30252ed0f8 [cfe] Handle legacy operator == in combinedMemberSignatureType
Previously, the special casing was only performed when creating
a new member. In a follow up, the combined member signature type
will be used for override inference also for legacy libraries and
thus need in [combinedMemberSignatureType].

Change-Id: I23036c0282cdcd633ffe2e9c524e9554cb9dc5ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175249
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-12-08 09:49:23 +00:00
Lasse R.H. Nielsen 6e29700e16 Update List constructor documentation, deprecate constructor.
Emphasize that the operation is going away,
and mark constructor as deprecated.

TEST= Refactoring+deprecation only, covered by existing tests.

Change-Id: I82aa044cd2cf7bf347b624371399f44bda8f4a07
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173261
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2020-12-07 16:20:28 +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 a3236f6622 [cfe] Disable verification of opt-in/opt-out types
In response to https://dart-review.googlesource.com/c/sdk/+/174860

Change-Id: I8d037bcd833990d242c0822adecbd0c4086e604f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174925
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-12-03 17:08:43 +00:00
Johnni Winther 87ef15787a [cfe] Handle write during late local initialization
In response to issue #44372

Change-Id: I6ad0730e662f7fcd8987a745cbab72dbb91c2045
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174923
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-12-03 16:41:53 +00:00
Johnni Winther 442fa7f44e [cfe] Update message for missing default value
Update in response to issue #44329 and to match the change
in https://dart-review.googlesource.com/c/sdk/+/174300

Change-Id: Ia28887f0fad54927b82b7aa29acb88231053cd6a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174800
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-12-03 14:46:23 +00:00
Dmitry Stefantsov 1d8d2de0a4 [cfe] Use buildInvalidInitializer to report duplicating initializers
Closes #43363.

Bug: https://github.com/dart-lang/sdk/issues/43363
Change-Id: I1de61c2be0d8a30dc184aad7cb392d0c92c5237b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174403
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2020-12-01 16:55:45 +00:00
Jens Johansen deca91c86d [CFE] Record const constructor coverage when evaluating constants
This CL records which const constructors were evaluated
(i.e. contributes coverage) but doesn't actually
save the coverage into the dill file.

runtimes for constant evaluation:
dart2js: No difference proven at 95.0% confidence
flutter gallery: No difference proven at 95.0% confidence
big internal app: No difference proven at 95.0% confidence

sdk sizes:
vm: no change
dart2js: no change
flutter: no change

compile sizes:
dart2js: no change
flutter gallery: no change
big internal app: no change

Change-Id: I2567446c1b78180d73fd7613bc9e780e1a067f5b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170435
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-12-01 09:20:14 +00:00
Clement Skau 2d36c85ff8 [vm] Removes support for --causal-async-stacks
All existing embedders have been opted into --lazy-async-stacks, the
VM also uses it as it's default in all configurations.

After this CL, any user of --causal-async-stacks will get an error
message when trying to use it.
=> In any such case, please simply remove the flag.

TEST=Exhaustive CQ.

Bug: https://github.com/dart-lang/sdk/issues/37668
Change-Id: Ia440afcf2dba464aa8b8cf381b93bbac8eb9f8dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172564
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-12-01 07:27:14 +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 b9541a14bb [cfe] Mark combined member signatures as legacy when needed
If synthesized members have legacy signatures, mark these as
nullable-by-default even when inserted into opt-in classes.

Change-Id: I956912402cae85f6ceb28a73477d44917780a6d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174240
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-11-27 11:09:09 +00:00
Lasse Reichstein Holst Nielsen b64550eaff Add a nullFuture in dart:internal.
This is the future returned by `dart:async` in some cases which used to return `null` pre null-safety.
Code inside the SDK which *needs* to not change its timing of events can recognize the future and skip waiting for it, giving the same "synchronous" behavior as before the null safety change.

Longer term, we need to wean people off depending on the specific interleaving of events.
Maybe we should randomly shuffle our microtask queue.

Change-Id: I8d52e74f0549a3068f5dfaffb28c7894b324c49d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172641
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2020-11-25 11:58:53 +00:00
Johnni Winther 90ec6f2531 [cfe] Ensure that shorting is stopped before expression usage
The creation of the shorting stop expression was done lazily
in NullAwareExpressionInferenceResult.expression. Since the shorting
calls flow analysis to stop null promotion doing this out of order
let to inconsistent flow analysis state.

This CL introduces an `inferNullAwareExpression` the allows to
caller to continue the shorting (if in an opt-in library). The
inferExpression method, used everywhere else, stops any shorting
currently in progress.

Closes #43275

Change-Id: I448163e29bdb0de8e493e5c62aa0474d0c9a593f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173729
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-11-25 11:28:13 +00:00
Johnni Winther d75f7005a0 [cfe] Stop shorting in ??
Closes #44276

Change-Id: I60f398c413f3b40215e9049ee3292eaf7f700d7c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173722
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-11-24 16:01:38 +00:00