Rationale:
Previously, we avoided introducing redefinitions that
introduced the empty non-nullable null type. This situation
arises when we do a null check on an actual null value
(making all subsequent uses effectively dead code). This
is too simple, however, since it still allows hoisting the
uses before the check. This CL gives a better solution
by introducing redefinitions without a constraining type
(which are not removed and avoid the type). In the long
run perhaps the best solution would be to simply remove
all subsequent uses as dead.
https://github.com/dart-lang/sdk/issues/32167https://github.com/dart-lang/sdk/issues/34473https://github.com/dart-lang/sdk/issues/35335
Change-Id: Ib5dd072a9e546f6b91faa52ea08e8c0f6350d7e0
Reviewed-on: https://dart-review.googlesource.com/c/89922
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
Support for 'IfNull' expression.
Support for 'rethrow'.
Tests for definite assignment and assignment expressions.
Change-Id: I053d27ca05e4ccaccc6a9fc7e10a481cd481ab21
Reviewed-on: https://dart-review.googlesource.com/c/90102
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Fix scoping of raw typed data access in dart:io.
Change-Id: I458b36bf655e429cc57e266550ff1ab00f328f45
Reviewed-on: https://dart-review.googlesource.com/c/89943
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Check if the call is typesafe instead of inlining only when type
checks are disabled.
Change-Id: Ie391bd7013941ffd3852fb8e2421e8827f41b6d0
Reviewed-on: https://dart-review.googlesource.com/c/89926
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
The cast is no longer needed due to the class hierarchy changes in
https://dart-review.googlesource.com/c/sdk/+/89923. But we don't want
to remove it yet, because we don't want to unnecessarily make the
analyzer_plugin to depend on the very latest analyzer. So for now we
ignore the hint.
Change-Id: Ic5314181cd78d72e5c9b1d00f38302773f0a789c
Reviewed-on: https://dart-review.googlesource.com/c/90101
Commit-Queue: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This CL improves AOT code for StackOverflowInstr/CheckNullInstr:
* On ARM we can do a conditional pc-relative calls for the stack overflow
checks, getting rid of the slow-paths entirely.
* On ARM64 we can do pc-relative calls on the slow path, avoiding an
extra load.
Flutter gallery size impact (in bare instructions mode):
* ARM: -3.7% RX
* ARM64: -1.4% RX
Issue https://github.com/dart-lang/sdk/issues/33274
Change-Id: Ia1acd76ac6efa26642f99e1ce3e417100aa357f3
Reviewed-on: https://dart-review.googlesource.com/c/89620
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Support for 'for'.
Support for 'for-each'.
Support for 'switch'.
Support for local functions and closures.
Support for 'try/catch/finally'.
R=paulberry@google.com
Change-Id: Idd0e528b706c1094e2bfdf32f84a9bcd7c80968a
Reviewed-on: https://dart-review.googlesource.com/c/89921
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Calls to the factory constructor 'new List' can turn into static
invocations of a backend-specific factory function. Signal an error
instead of crashing.
Change-Id: Id0a8a7f0f847c03225b7fa9da2351032d15522e0
Reviewed-on: https://dart-review.googlesource.com/c/90006
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Change-Id: I85fd7894b026180b1bc418602c0f09fcfea0a543
Reviewed-on: https://dart-review.googlesource.com/c/89543
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
These expectations will be used in a future CL.
Change-Id: I0e0659054732251452b32fedfd0ee52fac068f44
Reviewed-on: https://dart-review.googlesource.com/c/89524
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
These versions don't run the VM on the generated .dill files.
These tests are still "Slow" in status-file lingo, as they run for
about 30 seconds on a fast machine.
Change-Id: I7bd326a14c8f1f1905d4c6b4d5f850a95b135325
Reviewed-on: https://dart-review.googlesource.com/c/88967
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Handles the situations described in #34204 and #34189 when front-end
constant folding is enabled.
Change-Id: I64fd8449ac1661f6fe67411113c6f99d8009547c
Reviewed-on: https://dart-review.googlesource.com/c/90007
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
This CL adds support to the ImageWriter to write opaque blocks of
trampoline bytes
The AOT code relocator is adapted to allow limited range calls and
inserts trampolines if need be. The algorithm tries to minimize the
number of trampolines added, which for small applications will be 0.
The unconditional pc-relative calls have limited range:
* on ARM (+/-32 MB)
* on ARM64 (+/-128 MB)
To avoid verbose code for doubly-linked list, this CL adds double_list.h
Issue https://github.com/dart-lang/sdk/issues/33274
Change-Id: I0354cf4b2dd58ed5de25d67fc818f0603a2ec501
Reviewed-on: https://dart-review.googlesource.com/c/89283
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
This script can be used to compare two outputs of --print-instructions-sizes-to
and render a table that highlights symbols that became bigger or smaller
between two compilations.
Change-Id: I011584a370d8c94061da42e8e4f253c84d870bc3
Reviewed-on: https://dart-review.googlesource.com/c/89643
Reviewed-by: Aart Bik <ajcbik@google.com>
Change-Id: Id38f5e7495c245e5a7b161b55c58b8826c146a80
Reviewed-on: https://dart-review.googlesource.com/c/90000
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Change-Id: I978c90762ee85a6d7936d6a55e11d5d95d509b4f
Reviewed-on: https://dart-review.googlesource.com/c/89507
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Change-Id: Ia4df46c2e9f6edc25274492c4a7ea85a4f4b95e1
Reviewed-on: https://dart-review.googlesource.com/c/88959
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
An invalid constant is (currently) represented by an unevaluated
invalid expression. Using this instead of null fixes 63 out of 125
CFE constant-evaluation crashes with constant-update-2018 and
correctly signals 26 more previously-missed compile-time errors.
Change-Id: I5b4de3995b3a59978dfa08fc542ef0f027572eb6
Reviewed-on: https://dart-review.googlesource.com/c/89506
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
This CL adds support for parsing spread collection entries in map literals.
For now, all listeners report an error on the spread collection tokens
'...' and '...?' until support has been added for those listeners.
Change-Id: I299bb1524fda39746471c07e618df6a2305b1a2e
Reviewed-on: https://dart-review.googlesource.com/c/89860
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
This reverts commit 3f7b371f2c.
Reason for revert: Some modes failing to find new constant?
Original change's description:
> [vm] Enable timeline on Fuchsia even in product mode.
>
> On Fuchsia, the timeline is accessed without involving the service isolate or vm-service.
>
> Change-Id: I0d2351dcadcfc47835732235e1b8fafa8212f883
> Reviewed-on: https://dart-review.googlesource.com/c/89880
> Reviewed-by: Zach Anderson <zra@google.com>
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
TBR=rmacnak@google.com,alexmarkov@google.com,zra@google.com,asiva@google.com
Change-Id: Ic03a78d14821e0361d54587f1f7510bc9ebfef1c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/89942
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Null receiver guards (which look like "t1.toString;") are removed in more cases
where the following JS fragment would throw a TypeError on the same value.
Change-Id: I3872f00c90432077199542f4485b8e991f82fa21
Reviewed-on: https://dart-review.googlesource.com/c/89765
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
On Fuchsia, the timeline is accessed without involving the service isolate or vm-service.
Change-Id: I0d2351dcadcfc47835732235e1b8fafa8212f883
Reviewed-on: https://dart-review.googlesource.com/c/89880
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Support for ConditionalExpression.
Check for potential mutations in closures.
Un-promote on assignment.
Support for 'while' statement.
Support for 'do-while' statement.
R=paulberry@google.com
Change-Id: Ic9e33a08057dc3519efec759702c52ddada728ed
Reviewed-on: https://dart-review.googlesource.com/c/89763
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
In package-split mode, bytecode generation is performed separately for
each package. Previously, dropping AST was done right after generating
bytecode. However, dropping AST for a package makes it impossible to do
constant evaluation in other packages which import the package with dropped
AST. This breaks bytecode generation for subsequent packages.
To work around this problem, in package-split mode AST is removed
temporary until dillp file is written. After that, removed AST is restored
back.
Change-Id: I3d8b6a8ad98f2fe88b57f7b6393bbbe87b046c21
Reviewed-on: https://dart-review.googlesource.com/c/89822
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>