These tests exercise the "deferred type inference of function
literals" part of https://github.com/dart-lang/language/issues/731
(improved inference for fold etc.) for super-constructor invocations
and redirecting constructor invocations, both of which have their own
code paths in the analyzer.
Change-Id: I6877ac3c07a3cca31550ba74d941d250c8410cfd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241987
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
- create a small 'facade' interface CommonElementsForDartTypes so that common/elements.dart can implement this interface to break the cycle between common/elements.dart and elements/types.dart
- Separate the tagging enums used into serialization into a separate 'tags.dart' library.
- Scattered hints to help the migration tool.
Change-Id: I8dbb993ebeb85f240392bafa53e4cc235825f63e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242506
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
When unconditionally adding in each byte, this causes the last-byte marker to appear in a constant position. The correction factor for each exit branch is the same, allowing it to be folded into subsequent load offsets.
Startup.ReadProgramSnapshot(StartupTime): on a Moto x4
arm32 40456 -> 37414 us (-7.52%)
arm64c 46012 -> 44457 us (-3.38%)
TEST=ci
Change-Id: Ie7fd69504f9d9edf0c17458281a3750931d7d97b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242392
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
These will be flagged by the next linter release which updates `non_constant_identifier_names` to flag local functions.
Change-Id: I830cb452de32ed1b966a176ff88321af9493c62c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242504
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Right now all type literal usages will perform a runtime call which is
rather slow.
Flutter happens to use type literals such as `return T;` in hot code
which causes this to show up in the profile.
This CL adds fast paths for type parameter type literals if
the type parameter value (i.e. entry of TAV corresponding to T):
* is `null`: return `dynamic`
* is a non-FutureOr [Type] with compatible nullability: return value
* is [FunctionType] with compatible nullability: return value
otherwise fall back to runtime call.
It makes simple type literal uses 10x+ faster - the kinds that Flutter
is using.
Issue https://github.com/dart-lang/sdk/issues/48757
TEST=vm/dart{,_2}/instantiate_type_literal_test
Change-Id: I1139d6689aedbc68321f47ee6c9946a3323fbf6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241968
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
These will be flagged by the next linter release which updates `non_constant_identifier_names` to flag local functions.
Change-Id: I873400f61748a145f3c2a6630a21bcd1975c309c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242503
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
These will be flagged by the next linter release which updates `non_constant_identifier_names` to flag local functions.
Change-Id: If663698d9cab270accd477a507071232905bc083
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242520
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
These will be flagged by the next linter release which updates `non_constant_identifier_names` to flag local functions.
Change-Id: I8a558d2c9b80d2a0411ca8603201d62451c734dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242501
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
These will be flagged by the next linter release which updates `non_constant_identifier_names` to flag local functions.
Change-Id: Idf2b91fa3b845d8b921b7eb68b937d19c4ea188e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242502
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Rounding usage up to the TLAB causes excessive growth because it gives the growth policy a very inflated view of the survivor ratio.
Ensure new-space grows specifically to provide enough TLABs for active mutators.
TEST=golem
Change-Id: Iab01df18c6a8ac996e0f0b2707c9da7e14c7f4a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241689
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
1/2 or 1/4 branches executed per object initialization for uncompressed and compressed pointers respectively.
Note ARM32 already has double-wide initialization.
TEST=ci
Change-Id: Iacc61cac39f74191bb2e5e06cd48b90c006b8585
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/241622
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
These will be flagged by the next linter release which updates `non_constant_identifier_names` to flag local functions.
Change-Id: I6fac27b2b720343d10732afce5cd0e8ae5ce5ebb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242422
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
These will be flagged by the next linter release which updates `non_constant_identifier_names` to flag local functions.
Change-Id: If6e6497418e7044ce906d87981e3b3afa1f26da8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242423
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
This fixes an issue where VM would run the async* generator after a
`yield` / `yield*` even though the subscription may be paused or
cancelled.
Furthermore this fixes an issue where `StackTrace.current` used
in async* generator crashes VM and/or produces truncated stack
trace.
This fixes the following existing tests that were failing before:
* co19/Language/Statements/Yield_and_Yield_Each/Yield_Each/execution_async_t08
* co19/Language/Statements/Yield_and_Yield_Each/Yield_Each/execution_async_t09
* co19/Language/Statements/Yield_and_Yield_Each/Yield_Each/execution_async_t10
* language/async_star/async_star_cancel_test
* language/async_star/pause_test
New in reland: Allow the generator to to cause cancelling it's own consumer.
This addresses the issue of original revert
-> see https://github.com/flutter/flutter/issues/101514
Issue https://github.com/flutter/flutter/issues/100441
Issue https://github.com/dart-lang/sdk/issues/48695
Issue https://github.com/dart-lang/sdk/issues/34775
TEST=vm/dart{,_2}/causal_stacks/flutter_regress_100441_test
Change-Id: I091b7159d59ea15fc31162b4b6b17260d523d7cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242400
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
This avoids json encoding that was otherwise happening even in product mode. JSON encoding shows up CPU profiling as taking significant time, particularly on low end devices.
TEST=runtime/observatory/tests/service/developer_extension_test.dart
Bug: https://github.com/dart-lang/sdk/issues/48860
Change-Id: I2cf4d949e85c0b23de01ec2033b04527d40c76fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242081
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Dan Field <dnfield@google.com>
This avoids warnings about strdup being deprecated in favour of _strdup
on Windows.
TEST=manual build, observe no warnings are produced
Bug: https://github.com/flutter/flutter/issues/59199
Change-Id: Ide390f3a719b9598bea0fc9976be3fb337f4de37
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242386
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
This is a tool that will help us later.
Change-Id: I7d0411da702c46ce57d88070afd1f35cd1dd0dd7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242385
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
With linking elements being async the resolution operation became
interruptable, so we might see incomplete element model sometimes.
Change-Id: Ic108fd1e45b055dba1a46e9a80cdc7fb2ed5ee4b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242380
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Also encodes `typeTypeArguments` as a FieldIndex instead of a number
literal.
Change-Id: I6e71c1ec358fdbadaa2b3c9d94975647c5be52fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242320
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
Currently we do not collect constants from UnevaluatedContants.
Change-Id: Ie9ff2cd09cdd654f2294f4eee42edbfdc652695f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242220
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
My local IDE was happy using the .packages file that used to be
pre-generated by default. That file was removed from the repo, so I
need to call "dart pub get" to generate it on my local workflow.
This changes makes it possible to do so.
Change-Id: I7c9433cb71423c60810c6a5fc18e7da73c9bbe0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/242261
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>