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>
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>
- to isCovariantByDeclaration and isCovariantByClass, respectively.
This is done to align the terminology with the spec.
TEST=existing
Change-Id: I96b2e5d6e05caca431aad2b54545e928aee034e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213041
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
This should fix the base builder.
Bug: b/198416551
Change-Id: I900a22f6e7d2f5b013de35a00103c987cff5a605
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213042
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
This fixes a bug where an extension wasn't available when multiple
imports had the same name but the extension wasn't exported through
the first import.
Change-Id: Idfb6836111465baa66b339e1114206b5d8216715
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212820
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This uses the class ErrorType which may be an outdated field on ErrorCode, but it works for a prototype.
Fixes https://github.com/dart-lang/sdk/issues/46957
Change-Id: I98de8faf7f3ad738e9e27b0d5dd5add531b78b77
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211460
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
While confirming things related to the staticElement of these tearoffs, I wanted to make sure that type checking of expressions derived from tearoffs are functional.
Change-Id: I83c48b03a620bdc5c3e81775fae48f2d5d3a39a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212801
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>