Previously we created artifical edges from a LUB node's components to
the LUB node; now the nullability propagation algorithm understands
how to propagate nullability downstream through LUB and substitution
nodes, so no artificial edges are needed.
Change-Id: Ib2fef14c3dcd58a013ad8e057fd55597a1deb4fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105402
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This paves the way for removing the transitional API altogether.
Change-Id: I95181b04173d3439d278f898ae3b5ec574108b32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105411
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
It wasn't detected by the "unused field" hint because there is another
field in the same file with the same name that *is* used
(NullabilityMigration._graph).
Change-Id: I955f30d010ddaa2d218f61daf32978d391182708
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105410
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
We need to make sure that it is set when we create FileState(s).
Change-Id: I68103902d0f4df659291e02dd7809b2140b9af72
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105480
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This gives us more flexibility for how we want to publish and deploy
the tool. We now have the option, for example, of making a command
line app that invokes the tool and does not depend on analysis_server.
Note that some testing infrastructure had to be duplicated. I plan to
consolidate this infrastructure in follow-up CLs.
Change-Id: I046506bc2bb5c3e467e15885f198ee0632351ee9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105463
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This is a temporary way to ensure the bots will fail on these test suites until
the test matrix provides the output directory. At that point, the .json files
will be used to track test failures and the exit code is no longer necessary
TBR=vsm@google.com
Change-Id: Ie96c3835760de02addc89f7ccbcb3ccb04c21940
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105405
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
This addresses the most concerning problem in #37117
Change-Id: I38feb310023b066922a8049c5026a49572c3e399
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105461
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
This allows the test runners to use snapshots instead of using the compilers
directly from source.
Change-Id: I70664a740bed8de647adb658bd521cd574aa685e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104385
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
For this to work properly, we first need the test infrastructure to have support
for the `--output-directory` flag (see base CL)
Change-Id: I75f788d19ad3b4e9523830250c4a1c9de8418cda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104400
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Closes#37153
Isolate.resolvePackageUri was the only API which had an implementation
across DDC and dart2js. The implementation in dart2js has been broken by
default since Dart 2.0.0 without a user implemented hook that is not
used on any public repo on github. Our current supported path for
invoking the compilers on projects disallows the import altogether on
the web and it is only usable with an older version of the
`build_web_compilers` package, or by invoking the compiler manually
outside of the build system. This CL does not break the ability to have
the import when invoking outside of the build system.
- Drop implementation for `Isolate.resolvePackageUri` from the dart2js
and DDC patch files.
- Drop all references to `defaultPackagesBase` since it is not used.
- Drop all tests under `isolate/browser` since we do not expect any
support on the web. Most of these tests would have already been
failing. Remove status file entries that refer to the deleted tests.
Change-Id: I4a19213b0946d835c00e9c107a714f3bc5672f86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105080
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
This reverts commit 0779751b82.
Reason for revert: Broke test unittest-asserts-release-win:pkg/analyzer/test/generated/resolver_test (see https://ci.chromium.org/p/dart/builders/ci.sandbox/analyzer-win-release/5691)
Original change's description:
> Fix implementation of isDartCore and isDartAsync.
>
> It's not sufficient to check the name of the library, since a
> user-provided library could always name itself `dart.core` or
> `dart.async`.
>
> Change-Id: Id99cfc1ec89c5941e16b556e3c4dd175875a673f
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104580
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Paul Berry <paulberry@google.com>
TBR=paulberry@google.com,brianwilkerson@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I7a27b46f4b2d1b3b43f9943933ec2a75b5a5b806
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105346
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
The change in the CL prevents the widget transformer from introducing
compile-time errors.
Change-Id: Ib4a73eb13fb33397daeb5d17c613c42a1d1a6025
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105245
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Kernel mode only
Build with:
> dart bin/dartdevc.dart -k --compile-sdk dart:core --modules amd -o dart_sdk.js
For now, this doesn't support building only parts of the SDK - dart:core brings everything in.
Change-Id: I23cda3064408778dc93c9b3d4be757f1e99bae0e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104811
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>
The Dart2JSCompileAll test has not been working for a while due to
- issues with package config
- issues with getting the sources compiled with CFE after the switch to
kernel pipeline.
Revised this benchmark/test to instead load the kernel_service dill file and do a CompileAll of CFE.
Should fix
https://github.com/dart-lang/sdk/issues/36630https://github.com/dart-lang/sdk/issues/27369
Change-Id: I07f5c81fc6938d318b84fa9ea2fa033ec30a05e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103406
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
This CL cleans up the displayed help text, better organizes and displays
the list of fixes that are or can be applied, and addresses
a comment in https://dart-review.googlesource.com/c/sdk/+/105002
Change-Id: I2e71001ae7eda61b3b01ce999cb9fdca968a9b93
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105322
Commit-Queue: Dan Rubel <danrubel@google.com>
Auto-Submit: Dan Rubel <danrubel@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Prevent windows from doing a path lookup for 'dart:core' which will
crash. All we need is a string source with a uri..
Change-Id: I742060633f3bd89323ad3e3f0f19ae80c1aedbae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104806
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Change-Id: I02b2ceba0bf545932e8e99c940bb2373d9eb75ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105320
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This removes this --list option from dartfix and instead displays
the list of fixes when the --help option is specified.
Partially addresses https://github.com/dart-lang/sdk/issues/36875
Change-Id: Ibd8b124c2c20a752f7e661672eac8aa2e4483b26
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105002
Auto-Submit: Dan Rubel <danrubel@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
So, that when changes to code that don't affect APIs are made, we
can use already linked bundles, and fuse it with informative data to
create elements with actual offsets and comments.
R=brianwilkerson@google.com, paulberry@google.com
Change-Id: Ia0aa8af3c734b2cff497b49363064a26d601ebf1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105142
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Before this CL this code would crash fasta:
```
class A extends Function() {}
```
Now it produces a compile time error instead:
```
t.dart:1:7: Error: Can't use a function type as supertype.
class A extends Function() {}
^
```
(technically it already issued it, but crashed before doing so).
Bug: #36824
Change-Id: Iaeb9dc8390d4a9ab7b473848c3311f08a4dbba6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101283
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Suprisingly this doesn't seem to affect performance, but doing basically
the same thing in two different ways is suboptimal.
Change-Id: I1cc52bceb05a0af4d0e0d0574c3599c063cf42a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105242
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Prior to this CL, we would issue a warning whenever a CanonicalNameError
was encountered.
This is in principal a good thing, but because we currently have no way
to detect if the sdk we get is the one we expect
(by any other measure than when it issues a CanonicalNameError) we often
issue these warnings for no "real reason" whenever, for instance,
the flutter sdk changes.
This CL splits the CanonicalNameError in two such that errors with
references to the sdk ("dart:" libraries) issue CanonicalNameSdkError
instead, an we then handle that differently. Namely we silently ignore
the error (i.e. don't issue a warning) and just don't initialize from
dill.
This should remedy the situation and be strictly better than to always
swallow CanonicalNameErrors.
Bug: 36032
Change-Id: Idbae0b5ee5b9843a5dbeb49b3c65ae25f5962e36
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105240
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
It seems that we don't really need to have the same elements for them
for resynthesizing element model and resolved AST.
R=brianwilkerson@google.com
Change-Id: I05efdf90671f596f2f8b85a3808eb2c4c87ea8c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105003
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
- Skeleton Rti type
- Skeleton test
- Add dependency on command-line flag to get dart:_rti into platform dill
Change-Id: Idf383269c66c9951e23fd70a45ce65c54a973586
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104921
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Also, correct source position for CheckStack instruction in the prologue of
a closure.
Change-Id: I175e5398296f17a1f67a223d45725206e65e0e8b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105040
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Caused by a ternary operator with differently typed branches.
Change-Id: I5f9cfc28c274c125db0a999237f81dc3523896cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104240
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
+ emit a bit more progress info with -v
Change-Id: I60e44b2a383c8f55ef57c2a4cca98340baa66a01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104001
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This method should return `null`, since it doesn't visit an expression.
Change-Id: I018241c0d2e9b9f00bfe293352cf2707551c81e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104881
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
We need this to support existingImports filtering, because filtering
is done on suggestion basis, not on the whole suggestion set basic,
because of re-exports.
R=brianwilkerson@google.com
Change-Id: Id97cb122fa6e3c5c62e367098e1917eba997a76f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104808
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This reverts commit bb6e558534.
I found a problem with --use-summary2 in DAS.
When we implement actual API signatures, changes in bodies
change offsets for nodes, but summary2 also includes offsets,
and they don't match. So, DAS crashes. I will need to rework
offsets and other @informative data storage, so its turns
out that we cannot pretend so use real SimpleIdentifier(s)
anymore.
R=brianwilkerson@google.com
Change-Id: I1193cc3f6fd25aea1c39531e8a685b60b347166e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104949
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Change-Id: I119c44b30a1d3c6fb0d725ddb546cd3dcb31dab1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104809
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Note, this has the effect of including all DDC Dart sources with the
shipped SDK: we ship everything under sdk/lib.
This should enable https://github.com/dart-lang/build/issues/2262
Change-Id: If66bc7c620034e7f2acf7d2c3e9524a408417681
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104383
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
For constant field initializers, compile the initializer expression
to Kernel, perform local type inference, and perform necessary
rewrites during outline construction. This will support constant
evaluation during separate compilation.
Change-Id: I65fe601595c04c45d586d0bac97c2ade6ab15a90
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104564
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
An internal benchmark via kernel worker of lots of outline
calculations in worker mode with reuse and the incremental compiler
(and lots of dill loaded dependencies) goes from ~160 seconds to ~150 seconds.
Change-Id: I80afa10caacef5e14e569928a1d421bd3e8ab342
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104003
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
It's not sufficient to check the name of the library, since a
user-provided library could always name itself `dart.core` or
`dart.async`.
Change-Id: Id99cfc1ec89c5941e16b556e3c4dd175875a673f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104580
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
So that we can start dogfooding it.
I noticed that we logged too much data, so I reworked what we
log in LibraryContext.
Currently performance will be subpar, due to using content hash as
file's API signature. So, any change to a file, even in a method
body will cause the whole library cycle (and everything that depends
on it) invalidation. I will implement computing API signatures for
parsed unit (hopefully reusing something already existing) in a
following CL.
R=brianwilkerson@google.com, paulberry@google.com
Change-Id: Ifb77e29188484b6784edbaa6a6d5daca6800ef2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104603
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This is required because otherwise
Object() == null
requires the type signature of Object.operator==(Object o) to be
changed to Object.operator==(Object? o). Which I don't think is the
behavior we want.
Confirmation that this CL is correct has been sent to the language
team. I recommend we land, which will unblock my subtyping CL, and
roll back/readdress later if need be.
Change-Id: I498f9870e7128b2cac3012fff0cb1ab50fcc8df7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104344
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Mostly this is adding an abstraction so we can produce the jsonl files that will
allow us to track the status of each test individually.
On a separate CL I'll be moving the tests out of the current unit tests into
their own step in the test matrix.
Change-Id: Id4537db1458949370195124164b120b49a7a526c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104384
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
So, that we don't have to allocate these lists for each instance.
This makes it cheaper to have serialize more objects.
In a synthetic performance test, where we turn IDL builders into
bytes 100 times, this improves time to bytes from 45 to 34 seconds.
R=paulberry@google.com
Change-Id: Ie8c9a8ed01b4c0d4abeba96ed5e99bd430f9309d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104600
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
We don't want to keep it on while building summary1, because there
are changes in type manipulations that depend on it.
R=brianwilkerson@google.com
Change-Id: I4f84860ec197eb8f40dba80ecb51868f3d48e5e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104421
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Also made some minor improvements to the handling of method calls.
Change-Id: I8728a7901cfe61f88563b71e290e9d5b303afda1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104486
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Exception: also create hard edges for the relation between a type
argument and the corresponding type parameter bound, because that
can't be fixed by a null check.
Change-Id: I71b21ddb11c1bb1060cb6f13efde13855770e2b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104485
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reland the change to build some annotations during outlining, with a
bug fix. Annotations from patch classes and procedures were not
applied to the actual class or procedure, which is fixed.
The original commit was reviewed at
https://dart-review.googlesource.com/c/sdk/+/103806
The revert was reviewed at
https://dart-review.googlesource.com/c/sdk/+/104220
The original commit message was:
During the outline phase, after top-level type inference, compile
annotations for libraries, classes, fields, procedures, and
constructors.
Change-Id: I836160ddad4114ded72701e8a3938f703228931c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104560
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
This was a lot of bookkeeping for very little added value. If we want
to experiment with changing the behavior of the migration tool in the
future, we should experimentally change it and see whether the quality
of the migration improves; it's not worth speculatively keeping
multiple behaviors around while the tool is being developed.
Change-Id: I9a59e2626be7e9e84a937e287421abcdc971aba5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104482
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Previously we were creating hard edges for the default values of
optional parameters. This was incorrect; we don't want a hard edge
because we don't want evidence of non-nullability to propagate
upstream from an optional parameter to the const expression that sets
its default value.
Change-Id: I44e12ae96987fd7a9defc538b0704cf76262473f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104500
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Rather than use an edge from `always` to ensure that these nodes are
nullable (which is error prone since it could be overridden by an
assertion), we simply place these nodes in the ordinary nullable state
at the time they are created.
As a side effect we can reduce the amount of code we have to plumb the
nullability graph through.
Change-Id: I46cf5b2026aeb2917cb35a7ad0d36a0a0562ecc5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104481
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
It is unlinked summary based, we don't support it with summary2.
So, to not crash we return the empty list.
R=brianwilkerson@google.com
Change-Id: Ic220ae3526a3a3e2f06c60b4e25d7e7cef69af60
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104201
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
+ assert classes and members have an output unit
Change-Id: I69749d54d79a66fea4947034458295010f83c0cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103805
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Introduce HPrimitiveCheck for checking the receiver or argument of
primitive operations. These will eventually go away with NNBD since it
will be a call-site type error to invoke `+` with a null receiver or
operand.
Change-Id: I54bf64f8231a234341c1ddf5ad4dba26909d613d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104185
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
These violations look like actual bugs and were not simply mechanical fixes.
Change-Id: I69ae67751e48829fc4733dcb327ba0aa52602c91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104063
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
During the outline phase, after top-level type inference, compile
annotations for libraries, classes, fields, procedures, and
constructors.
Change-Id: I95ca65fd58ad88d9452a28d5a0652bee44aeda3a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103806
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Change some of the straightforward collections to use spreads, for
elements, and conditional elements. Many of the patterns in this file
can't be translated because they are more complex - keep the simple ones
with a declarative structure so that it is more clear when there are
extra computations or side effects that are meaningful.
Change-Id: I135b10641f61fc43ebbc4bbd7196c315339c3ee8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104103
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
We were inconsistent about using return and argument types with
overridden methods. It is technically safe to omit them since they'll be
inferred from the super class - but it's more explicit and readable to
repeat them here. We were already using types on some of the overrides -
add them to the remainder.
Change-Id: Id8529e40a80c8ff3d5feb231a37a12d3d6487b4d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104160
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
The test is failing, for now I plan to just land the test in its failing test and change the status once it starts passing.
Change-Id: I305c32cc7a163e280bdb766f29835264c331c9ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103680
Reviewed-by: Vijay Menon <vsm@google.com>
Add specific error text for the dynamic call failure cases:
* Calling null.
* Calling an object instance with a null `call()` method.
* Passing too few or too many arguments.
* Passing incorrect named arguments.
* Passing too few or too many type arguments.
* Passing type arguments to a non-generic method.
This does not address the issue of a missing name. The errors still just
reference 'call'. Tagging a name could be added in a future change.
Issue: #36165
Change-Id: I21592ef506908559da0bfe9aac5ed5bae7fcb84e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103645
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
This adds support for BabelJS to test.py's dart2js compiler
configuration. When --babel is specified directly or through a named
configuration, test.py will run an additional step after dart2js that
post-processes the javascript output by running it through BabelJS with
the specified Babel configuration. BabelJS is added to the DEPS in its
standalone form. d8 is used to run BabelJS standalone to avoid adding
a dependency on NodeJS. d8 can only write to stdout but not to files or
stderr, which makes it necessary to change the test_runner to handle
commands that expect their output to be piped to a file.
Changes:
* Add --babel option to test.py.
* Add babel option to pkg/smith.
* Switch IE11 builder to use babel transformation.
* Fix option list comparison bugs in pkg/smith.
* Change dart2js compiler configuration to generate files using the
test name rather than just "out.js" (update test that relied on this).
* Remove runtime_configuration dependency on test_suite.
* Remove obsolete blocks adding --preview-dart-2 dart2js arguments.
* Make dart2js' compiler configuration more like DDC's.
* Remove createCommand method that is no longer used.
* Remove support for "OtherResources" which was only used for
dart:isolate tests on dart2js and DDC.
* Skip co19_2 tests that are slow to transform with babel.
* Simplify the timeout handling in the test runner with Future.timeout.
Change-Id: I32e4917b2a57ecbe684538e40d744f0101c552a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/90402
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
The new HBoolConversion instruction can be removed after the NNBD transition is complete.
Change-Id: I136c23f10440cb2414db32e5054b743714f7116b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103681
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
* Source file location
* Assertion source code
This change embeds the information as strings into the compiled source. In the
future we could reconstruct the source file location at runtime from the stack
trace.
In tests with various large applications this added roughly 1MB (0.1MB
compressed) or less to the compiled file size.
Fixes: #36995
Change-Id: I2634f7eab6e54eec209094b52429987dd62c0828
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103568
Reviewed-by: Vijay Menon <vsm@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
I deprecated 'abstract', but I don't see any uses of it outside of
analyzer, which I have fixed. So, maybe we should remove them right now?
R=brianwilkerson@google.com, paulberry@google.com
Change-Id: Ifd86a6b0148be49df6455672742f825ffd50f661
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103661
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
When the .packages file has changed we need to re-check all package-uris
to see if we need to invalidate the builders (if the file uri for a
package uri library (e.g. if the package was upgrade) has changed we
have to invalidate it).
This translation is semi-expensive though, so if we can avoid it that
would be a good thing.
This CL caches the "base URI" for packages from the previous run,
so we can start by comparing the base-URIs: If the base-uri for a
specific package hasn't changed, nor will the actual translation.
Only if the base uri has changed we do the actual translation,
and thus save many package-to-file-uri translations.
An internal benchmark via kernel worker of lots of outline
calculations in worker mode with reuse and the incremental compiler
(where the .packages file change every time and we have lots of
package-uri libraries) goes from ~185 seconds to ~162 seconds.
Change-Id: I3ed48b23a590dbf66f8a2379bb88e1b177f1f034
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103804
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Before this CL we removed from from the builders map, but left them in
the libraries list.
When using the incremental compiler via kernel worker (where we
continually replace dill builders) that meant that this list would just
keep growing.
This CL cleans it up and the builders map and the list should now be
in sync
An internal benchmark via kernel worker of lots of outline
calculations in worker mode with reuse and the incremental compiler
goes from ~215 seconds to ~185 seconds.
Change-Id: I254558d517f544fe31b5673e0dc8748048f0c5ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103630
Reviewed-by: Kevin Millikin <kmillikin@google.com>
This was a left-over from when unbinding, and should no longer be needed.
An internal benchmark of lots of outline calculations in worker mode with
reuse and the incremental compiler goes from ~248 seconds to ~215 seconds.
Change-Id: Iedb6a3fb11504610c061503efb741e35919f0d32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103629
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Merges InlineWeeder and InlineReductive into one visitor and computes
an InlineData object from which all decisions can be made.
Next step is to compute InlineData in the scope visitor (the first visitor
of the first modular phase).
Change-Id: I0c435ae1b3d7afdff1cee7abac657c9362995a67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103632
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This avoids (yet another) inconsistency from the imprecision of
called once. In this case the inlining of some methods that are
called once is dependent on whether we meet their call-site directly
or indirectly first, effectively making the inlining decision subject
to the enqueuing order.
Change-Id: I8d6b9c18fdb82f6d1b566e6bb58344211678daf2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103631
Reviewed-by: Sigmund Cherem <sigmund@google.com>
A negative result was wrongly returned as a positive value.
Since positive values are preferred, the implementation now adds the modulus
enough times to make the result positive.
Change-Id: I87a2ceb359345846740a749ab6b46b1d45e7ba21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103664
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
This adds quite a lot of information though, because we send many
strings.
Before: 20686 characters.
After: 55345 characters.
Theoretically we could do better, and send information about existing
imports only once as well, so when the user continues typing in a
single file, without touching imports, we don't send any new data
about imports (maybe just a confirmation that it is still the same).
But I'm not sure if this is a worthwhile optimization.
Actually, even included suggestion sets have similar property - they
don't change for a given file, unless there are changes to other
libraries which we might want to include.
R=brianwilkerson@google.com
Change-Id: I2f55e2dc85508849146aa39eb279beabaec937c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103561
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
+ and use it in the dart2js modular tests
Change-Id: I66cf29dcea7fb705135049e7a6ea4eb17052f3d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103575
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
This includes:
* accepting null values like sdk-summary or .packages (which are not used when building kernel for the sdk itself)
* allow enabling language experiments
* only exclude-non-sources on the non-incremental code path if that's requested
Change-Id: I08eeb643676f1f1406f0f3030c341d68179d42a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103574
Reviewed-by: Nate Bosch <nbosch@google.com>
This builds on the prior CL to improve the error messages
for missing switch statement body, missing finally clause body,
and others.
Change-Id: Ia2def1f3a75d5581356c12aee4705ef21870f749
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103571
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>