Fixes assertion error because it cannot properly infer 'this' for field
not inserted in the ast.
Fixes#38961.
Bug: 38961
Change-Id: I4230fc2d8c47eb84ad2627651f4d7ca2787e5f33
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122141
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
This serves two purposes:
1) It can aid in debugging to better know which object you have.
2) It paves the way for a future re-design of toString so toString never
leaks.
Change-Id: Ice32209b19b961b7e92de829d8bee0ddd8bd6e93
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122140
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Loading of appended snapshots used to try read the executable itself
via arg[0] which holds the "path" to the executable.
However, when the executable is being invoked via PATH the "path"
can be just the name of the executable with no actual path.
This would cause the file reading to fail to find the file and
therefore fail to read.
This in turn caused standalone executables to fail to run when invoked
via PATH.
Bug: https://github.com/dart-lang/sdk/issues/38912
Change-Id: I08501661441db90ce6cff96a9337a5770ec3524d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121853
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This CL also completes the renaming of "neither" into "undetermined" by
renaming kNeither value in the nullability enum in
runtime/vm/kernel_binary.h into kUndetermined.
Change-Id: Ia266bf1b35577212b696fb4a093340ee8e986256
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121989
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Re-enables tracing when built against the public Fuchsia SDK. Was
previously only available on in-tree Fuchsia builds since tracing had
not been exposed in the public SDK.
Change-Id: I54026268f96f762a84c92c24df377249990159a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122081
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
- Start the kernel isolate only when a compilation is needed
- Remove some dead code and state in the loader path
Change-Id: I39e14cd79cda18b155af6334a11635c44e2fc11f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121923
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
This reverts commit 56991ad94b.
Reason for revert: broke building Flutter apps in release mode
Original change's description:
> [vm,aot] Simple unreachable code elimination before type-flow analysis, take 2
>
> This is the relanding of https://dart-review.googlesource.com/c/sdk/+/121500
> with fixes.
>
> Original CL description:
>
> This change adds transformation for very early cleanup of unreachable
> code such as code guarded by if statements with constant conditions or
> code used in assert statements when assertions are disabled.
>
> The advantage of cleaning such code early is that type-flow analysis
> won't be looking at it and TFA-based tree shaker is able to remove
> more code.
>
> flutter_gallery_total_size -0.5663% (arm), -0.5409% (arm64)
> build_bench_total_size -2.533% (arm), -2.449% (arm64)
> gesture_detector_total_size -4.183% (arm), -4.072% (arm64)
>
> Change-Id: Ief8ebd0cd828c0e7a847a824f44d2d97a3595b87
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121901
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Commit-Queue: Alexander Markov <alexmarkov@google.com>
TBR=vegorov@google.com,kustermann@google.com,rmacnak@google.com,alexmarkov@google.com
Change-Id: I25fe5d4457bfcc5ee25506810aa7eee01ca1b28a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122023
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This is the relanding of https://dart-review.googlesource.com/c/sdk/+/121500
with fixes.
Original CL description:
This change adds transformation for very early cleanup of unreachable
code such as code guarded by if statements with constant conditions or
code used in assert statements when assertions are disabled.
The advantage of cleaning such code early is that type-flow analysis
won't be looking at it and TFA-based tree shaker is able to remove
more code.
flutter_gallery_total_size -0.5663% (arm), -0.5409% (arm64)
build_bench_total_size -2.533% (arm), -2.449% (arm64)
gesture_detector_total_size -4.183% (arm), -4.072% (arm64)
Change-Id: Ief8ebd0cd828c0e7a847a824f44d2d97a3595b87
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121901
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
https://dart-review.googlesource.com/c/sdk/+/113904 previously "fixed"
printing for the old RTI by only using the new implementation if
USE_NEW_RTI was passed. This change fixes the root cause of the printing
failures, so we can fully switch to the new implementation.
Change-Id: Iaca56566ebebbaaad15d312c3e57204859417a9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121903
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Delayed type arguments are only used by generic closure functions, so
their initialization can be omitted for non-generic closures.
This is the follow-up for 1f58504ee6.
Change-Id: I61b05a4a4e2af4d2d8a543f6eec985a47b811761
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121924
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Use asr/lsr/lsl instructions instead of add ZR with shifted
operand as those are prefered instructions for Arm.
Change-Id: Ice2629bf5a23a745c3bf5138d8a220f7522dca52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121710
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
The function was broken on arm64 due to incorrect
mask calculation (based on the target ISA).
Change-Id: Ib5c26bf4c7b901ae27f2a0580c4f88b2b7952212
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121709
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
Remove shards from builder configuration for now because there is currently only
one test.
Change-Id: I5dcce5601ed46e36b28f9cab9bede1d81c1a42ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121865
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
There are could be conflicts in inferred types attributes between
function and its closures, so attributes for closures should be
written separately.
Change-Id: Iae395d73fdc2dfcb6b55137176f198f02e9b079b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121907
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This is follow-up to 9e636b5ab4.
Change-Id: Ia167e9faea9b3085fdc1076666d05360646153e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121942
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
These tests were all broken due to incorrect nullabilities in a
generic class method. The brokenness was masked by issue #38900,
which was fixed in 1b044eec08.
Change-Id: Ib77c437ae147afd10cc46e0685db25ce844bd99b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121960
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
It would have been very useful in helping to track down
https://github.com/dart-lang/sdk/issues/38341#issuecomment-542892773
to have this information surfaced through the instrumentation output.
Specifically, it would be nice if the user could hover over a type
annotation that was *not* made nullable due to a propagationStep whose
`reason` was `StateChangeReason.upstream`, and see information about
all the edges for which the `sourceNode` corresponds to that type and
`isUpstreamTriggered` returns `true`. These are, in effect, the edges
that prevented the type from being marked nullable.
(Note that there's another possible reason a type might not be marked
nullable. It might be that there are no edges for which the
`destinationNode` corresponds to that type and `isTriggered` returns
`true`. In this case, the node is indeterminate, so the migration
engine left it as non-nullable because there was no need to make it
nullable).
Change-Id: I9b969201b813496d41f3a373454c2659f683178d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121941
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This field is only used to implement partial instantiation of generic
closures - so it is irrelevant in non-generic ones.
Keeping it null instead of empty_type_arguments allows to completely
elide a store (which saves around 2 instructions per closure allocation)
Change-Id: I1039993a1cfd1bc4b476214712d90b2c443e7cc6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121983
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>