Last roll was from 6/18/2020.
Allows to enable "implicit-int-float-conversion" warning in the dart codebase.
Change-Id: Ida1a3a477e5bc45993dc10e0c3db410265a005ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191300
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Evaluated constant instances in kernel are represented as a list of
field->value pairs. Tree shaker should not remove fields used in
constants as it may potentially affect identity of constant instances
(non-identical constants may become identical).
Previously, fields used in constants were only marked as written,
so they could still be removed as write-only fields.
Furthermore, if such field was also used as an interface target
it could be converted to an abstract getter, causing the conflict
during kernel AST serialization.
This fix marks fields used in constants as also read, effectively
preventing their tree shaking.
Flutter gallery AOT snapshot size is not affected.
TEST=pkg/vm/testcases/transformations/type_flow/transformer/regress_45324.dart
Fixes https://github.com/dart-lang/sdk/issues/45324
Change-Id: Id6d35604757ad6ba1e23f7227aa9b769448c2688
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191280
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This CL adds code to detect situations when we hit
null error through GDT call with non-null receiver.
We achieve this by making receiver's cid part of the
GDT calling convention and checking this cid
in runtime entry responsible for throwing the null
error.
This CL is an attempt to narrow down b/179632636
and collapse various impossible crash reports
into a single native crash cluster by crashing VM
instead of throwing a null error.
TEST=tested manually
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm64-try
Change-Id: If2ed4646c4c0f403016266e4e83e296a7b234cb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191141
Auto-Submit: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Android L and newer (API level 21) provides a way to
specify abort message which will be included into
crash report created by debuggerd.
Make sure our DynamicAssertionHelper uses this functionality
if available.
TEST=tested manually
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-android-release-arm64-try,vm-kernel-mac-release-x64-try
Change-Id: If25cd168d43677e0a0fe9b63e21a017415686ab7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191140
Auto-Submit: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Make the parser handle metadata properly according to the spec.
There has been some confusion in regards to metadata because
https://github.com/dart-lang/language/blob/master/accepted/future-releases/small-features-21Q1/feature-specification.md
(used to) say we needed a spec update.
That was done in the parser in
https://dart-review.googlesource.com/c/sdk/+/182668
but really that made the parser adhere to the spec as it was which is
also correct (as the spec change wasn't needed at all).
The parser also needs to be able to skip metadata, though, and that
wasn't done it that CL which caused the issues in
https://github.com/dart-lang/sdk/issues/45120
The work directly in this CL is:
* Add lots of comments to parseMetadata to make them more up-to-date with
the spec.
* Fix skipMetadata to correspond to parseMetadata.
* Tests verifying that 45120 is fixed in the parser and that metadata in
general works as expected in the parser.
(In working on this, the future specification was corrected to say that the
spec did not need updating. Thanks to Erik for the quick turn-around
there).
Bug: #45120
Change-Id: Id1e4912cac7e5d9113efe083b3ecd06e6834a16e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190880
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Instead of being part of the --trace-precompiler output, there is
is a new flag --write-retained-reasons-to=<path>.
To allow for non-functions to have reasons for retention, the
JSON objects in the array now have one additional field:
* type: a string, the C++ type of the Dart object.
This CL also wraps all the machinery in a RetainedReasonsWriter
class instead of putting it in the Precompiler interface.
TEST=vm/dart{,2}/use_trace_precompiler_flag
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try
Change-Id: Ifa40ac64fdcbdad5114499425c7f8b08e327fa76
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190525
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
There are two fixes:
1) If a function was compiled but not retained, precompiler
should still trace through types used in exception handlers.
2) Certain auxiliary functions such as implicit closure functions
and field initializers were added to 'possibly_retained_functions_'
set but were not traced through AddTypesOf and were not added to
'functions_to_retain_' set.
Flutter gallery AOT snapshot size
release - no changes
release-sizeopt arm +0.13%, arm64 +0.14%
TEST=ci
Fixes https://github.com/dart-lang/sdk/issues/45179
Issue https://github.com/dart-lang/sdk/issues/44852
Change-Id: Ide9a7e82a7bb9098dc90bc41a76e527e7a5cb603
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190781
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
Current version of dwds does not supply module format to the
expression compiler worker, resulting in initialization failures.
Add default 'amd' format so dwds continues to work with new SDK
version before a matching update that passes format to dwds
lands.
Change-Id: I10e8ddc09b48b91c9c085a6d7579ad01c6e13399
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190820
Reviewed-by: Gary Roumanis <grouma@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Anna Gringauze <annagrin@google.com>
Service.getInfo().serverUri can be null if the VM service server hasn't
finished starting up. The CLI isolate should wait for this URI to not be
null before attempting to start DDS.
Fixes https://github.com/dart-lang/sdk/issues/44787
Fixed: 44787
Change-Id: Iadce0901351c0bc5238a4dc805483cce818e9e15
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190361
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
E.g. recover `Map<int, int>{}` by ignoring the map (i.e. it's
just a literal map), recover `new {}` as just `{}` etc.
Fixes#45251.
Change-Id: I44e67ca6d3b9b068014b8e28822a61063c794d57
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190022
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
If a type variable T is used in an `is` or `as` expression (e.g.
`42 is T` or `42 as T`) or is part of a subtype check, then any types
which may be substituted for T via instantiation must also be treated as
participating in a type check.
This CL ensures that the RTI need computation includes type arguments
for those substituted types and that those types are included in the
list of implicit checks.
Additionally, in order for this to work, this CL fixes a bug in which
the impact transformer was failing to register generic instantiations
occurring in (partial) constants.
Fixes: https://github.com/dart-lang/sdk/issues/45046
Change-Id: I98ae0eca0adcbbb26cdd664318da0da578b289b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190460
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
The lifetime of program compilers in JavaScriptBundler is too short,
moving the program compiler cache to FrontendCompiler instead
so the ProgramCompilers created during main compilation could be reused
for expression evaluation until the next compilation.
Closes: https://github.com/dart-lang/sdk/issues/45266
Change-Id: I7d41476c7064f16cab2783f88c49114a08a0c038
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190301
Commit-Queue: Anna Gringauze <annagrin@google.com>
Reviewed-by: Jonah Williams <jonahwilliams@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
More specifically on 64-bit platforms, when other heuristic fail:
- in AOT mode unbox all int typed phis.
- in JIT mode unbox all non-Smi int typed phis i.e. mixed
Mint/Smi phis.
This brings treatment of int phis closer to how we treat other
boxed phis.
This considerably improves AOT code quality for loops which
our current conservative heuristic does not currently hit,
for example:
void foo(int start, int end) {
for (var i = start; i < end; i++) {
}
}
Code like this would use a boxed Phi previously which does not make
sense.
In JIT mode to really benefit from aggressive unboxing we
might need to shift from over-reliance on Smi operations, e.g.
when phi is unboxed we want to cascade that through and unbox
operations which are performed on it transitively. This requires
much more sophisticated algorithm and is outside of scope for this
change.
In AOT we in general treat all arithmetic operations as operations
over 64-bit int values so unboxing phis makes more sense.
As a result of this change we see small improvement in code size:
flutter_gallery_app_so_gzip_size -0.2392%
TEST=ci
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try
Change-Id: Iae9a16f353e53f649da4e665d2812ad47099a674
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/187860
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
* remove `isCompleted` field which duplicates `completer.isCompleted`
* make `completer` non-nullable
* make `files` non-nullable
* move `folderIterator` from class as field to `perform()` as local
Change-Id: Ic67dbf8d4e6487152ae1ca6752c45f5c59c70862
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190725
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Also update the generator:
* Remove same unnecessary '?'
* Update MemberType.name, TypeRef.ref to be non-nullable
Bug: https://github.com/dart-lang/sdk/issues/45165
Change-Id: I438e9ce1e02faac9417a7d2d4ace143f2cf6feb3
TEST=Just the regular trybots.
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190722
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Allows removing a branch when decompressing pointers and removing fixup sign-extension after Smi ops that use 32-bit ops to detect overflow. Increases the code size of indexed and stores for some widths due to addressing mode limitations.
TEST=ci
Change-Id: Ia48353cccbbc586dd0d2e055a843c65e37c63a30
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185660
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
The http package now requires Uri objects.
Change-Id: I3952e8ac9dce6549a1936c48cd4f060224827fc3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190527
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
This is a follow-up to https://dart-review.googlesource.com/c/sdk/+/185381.
That change introduced a more compact serialization of canonical sets,
but it didn't include correct counting of heap size of tables
allocated during deserialization of canonical sets.
This change adds counting of heap size of canonical tables.
The heap size benchmark numbers will regress with this change,
but this is only due to a more accurate counting, not due to a real
regression.
TEST=ci
Change-Id: I42ee3bd91f0420bf41c660d2eaa51e9901d9b198
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190580
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
In the inferrer code like `local == null` would use the type information
for the operands to determine whether the call was `o == null` or
`null == o`. This had the side effect that if the left operand was a
local variable known to have value `null` the case would be treated as
`null == o` and the local would not be promoted to non-null on the false
branch.
Change-Id: I5fa08f8c891578f4c8e337e6cf5882fc2383063f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/189210
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Saw a crash in logs, was able to reproduce.
Change-Id: I2632c9ec7c3c34e6498f74e17507505128664418
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190400
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>