Treating createSentinel as returning a value of type Never caused issues
whenever its result flowed into a union, since the union would just
simplify to its other component. This meant that if a late field started
out uninitialized and was later initialized to a constant, we would see
it as only ever having the constant value. This caused isSentinel to
always return false even if the field hadn't been initialized yet.
Instead, we support a late sentinel value in the abstract value domain
and use this value as the return type of createSentinel during
inference. Additionally, inference treats _lateReadCheck as a simple
narrowing to exclude the late sentinel value.
Change-Id: I086bfd77576930e3ca2a4cfc9bd63476b6636685
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210646
Reviewed-by: Stephen Adams <sra@google.com>
* When testing for pragmas in the inliner, call function.has_pragma()
early to avoid more expensive Library::FindPragma query.
* When scanning through object pool entries in
Precompiler::AddCalleesOfHelper, skip over OneByteString and null
objects quickly. They are leaf and there could be a huge number of
those objects.
AOT gen_snapshot time of a large Flutter application built in
flutter/release mode for arm64 (best of 5 runs):
Before: 81.589s
After: 74.415s (-8.79%)
TEST=ci
Issue: https://github.com/dart-lang/sdk/issues/43299
Change-Id: I960451c73b42dab9845f0e0eafacaa9bb23720e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213288
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Helper methods for locations in constructors (`super` not available)
were missing type information for the tearoff. This replaces the use
of a helper that would itself would be torn off.
Added a new form of helper method that performs the tearoff and
binds the type. NOTE: Generic type arguments are still applied
outside of the helper.
Change-Id: I8dafe0d8357ecc9e1d070046a82e9e83e1a16ed9
Fixes: https://github.com/dart-lang/sdk/issues/47175
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212861
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
When loading a value of a static final field with trivial initializer
generate a Constant instruction instead of LoadStaticField.
Initializer of a static field is considered trivial if it is null, int,
double, String or bool literal.
TEST=vm/cc/StreamingFlowGraphBuilder_StaticGetFinalFieldWithTrivialInitializer
Fixes https://github.com/dart-lang/sdk/issues/47120
Change-Id: Id2bfc3da8c14376f7f1ef829265cca29a018bad1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212873
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Check for odd case of attempting to type instantiate an extension (it's not supported).
Re-write some TODOs as comments.
Change-Id: I14fd2a4e21139939ca60e415be9ac31b93ea50ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213240
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
This makes it more closely mirror the Dart_NativeEntryResolver,
and acts as an extra sanity check that signatures (roughly)
align between the FfiNative decl. and the native function.
TEST=Updated runtime/vm/dart_api_impl_test.cc
Change-Id: I40799dc583ec14db14dc453afed4e2d1eb06fced
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212566
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
There are a few subclasses that could be renamed to be more consistent,
will do this in a separate CL.
R=brianwilkerson@google.com
Change-Id: I3adccf32e463b4c622a08d206d2ec0d9e49e72cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213117
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
It is already enabled by default in the latest language version.
Change-Id: I91feabd596c35410890601ae82c446be5ea6ad3d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213116
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
js_interop_1_test awaits the completer itself instead of the
future which is triggered when the completer completes.
Change-Id: I6a784ced7caaade457cd444823e8cd21d338b9b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213025
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Change-Id: I7dc14ea10f769dd36ff15f3ee9ffc40ce78cf4bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213105
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Eventually we will remove it completely, but for now let's make it
more correct.
Change-Id: I09c338bcf2e12aecb75b5b9646104e97cf35705c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213030
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This change removes handling of StaticGet and ConstructorInvocation
nodes in annotations. This code became redundant since constant
evaluation was moved into the front-end.
TEST=ci
Change-Id: Idfa16624d28cdf73da09b52aec429d881e43a36e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212871
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
The `toString` called `(-this).toString()` recursively
for negative durations.
If instantiated with the minimal integer on native,
that call would recurse infinitely.
The code has been wrong since we removed arbitrary precision integers.
TEST= Add test for regression case, otherwise covered by existing tests.
Change-Id: Ifb58bbc5aee38ef760f9352aede1694b79bae931
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212300
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
We want to avoid the "Returns" phrasing for getters.
Change-Id: Ia738c1566f720200a7b65a4ff441e1196129a6f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210286
Auto-Submit: Nate Bosch <nbosch@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
`typeInstantiate` is a new "operation" in const expressions. It doesn't
do much, but does find the correct staticElement to be used in the
FunctionState.
Instantiated static type is necessary on a FunctionMember.
Change-Id: I15b72c870ce9bfc2b8b1fc592553c988e9cc243c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212604
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>