Start using constructor tearoffs in libraries that have been migrated to
null safety.
Change-Id: I1a448a42b811c2f278d25a823356ee60a452848f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/223341
Reviewed-by: Anna Gringauze <annagrin@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Closes https://github.com/dart-lang/sdk/issues/47324
Erases static interop class types in favor of `BaseJavaScriptObject`.
Types are erased everywhere except for constructors, whose invocations
are instead wrapped with a cast. Constructor type erasure is avoided
to ensure the AST is still type-valid. Factories with bodies have
static stubs added instead, and tests are added for this change.
Change-Id: I7231aaaf32d22bc6261adb672a602e8a9e6c86a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215948
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Riley Porter <rileyporter@google.com>
Previously only a super helper would be created as needed when there was
a super getter or setter call a constructor. If both a get and set exist
only the first encountered would trigger a helper to be generated. The
second helper would be missing and the call to it would trigger an
exception.
Now the helpers are tracked with unique names to avoid collisions.
Fixes: https://github.com/dart-lang/sdk/issues/47698
Change-Id: I561adc0ce8f97e81a9e12d749d4d80e1f5e73f38
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221743
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
This avoids have tracked dill libraries as part of the incremental
compiler state, and avoids the need for public mutable state on the
incremental compiler.
Change-Id: Ia61f22499f619d7ead4eed23d3d1eb24b8caec9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221464
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
This is a move towards fully encapsulating the state of the incremental
compiler from outside usage.
Change-Id: I1243602aa6c4bcc3e6fbf8450bd8cdf7fa5ad5d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221327
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
strict-casts is mostly a drop-in replacement for the deprecated
`implicit-casts: false` option. One big difference, seen in this CL, is that
strict-casts will report a non-Iterable (or non-Stream) in a for-each loop.
Change-Id: Ibc463ae9c870b6a795483c5dea0d2b856e7fd883
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221546
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
This prepares for returning more that just the component from an
incremental compilation.
TEST=existing
Change-Id: I3ee269083290097f1a92d77d105b607a6a02f1f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221086
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
This minor change makes it a bit easier to consume ddc as a library.
Change-Id: Ie98a4fa78c313d827cf1a395b26a4f7859a9413c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220120
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
In the test suite, the options passed to the two phases of the
compile drifted apart. Some were false when compiling the module
but true when printing that module as Javascript. This surfaced
when some unused portions were migrated to null safety.
Change-Id: I2d5c648bc53e5c9fe3f014446393d0f893bd5382
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218181
Reviewed-by: Anna Gringauze <annagrin@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Change-Id: I0111e74d312f6d3aeebb80f017a4f48fc6186109
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218220
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Zero runtime affect to these unpublished packages
Allows using standard tools such as dart test, etc
Also allows better checking of dependency constraints
TEST=no effect on SDK build process
Change-Id: Ic6fbe6ce8f57724a87c058eccad64ce8e7473af1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218180
Auto-Submit: Kevin Moore <kevmoo@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Temporarily add names of static members so they can be accessed by the
debugger. Eventually, these will be accessible through the symbol data
and should be removed from the compiled Javascript.
This increases the size of the compiled output by ~1% in a large
google3 application.
Names and types of static members were originally removed from the
compiled output in https://dart-review.googlesource.com/c/sdk/+/48455
because they are not needed for runtime correctness.
Change-Id: Idfd827ececec80d903586917676ec027e2a5a9e8
Issue: https://github.com/dart-lang/sdk/issues/40273
Issue: https://github.com/dart-lang/webdev/issues/1430
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217501
Reviewed-by: Anna Gringauze <annagrin@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
- Module symbols tests now surface compile time errors from the
code under test.
- Fix errors in the code being tested.
Change-Id: Ica549c710f41ee22ac784fba99f9e12be664ac5f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217024
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
The WebSQL standard was abandoned more than 10 years ago and is not
supported by many browsers.
The `dart:web_sql` library was marked as deprecated in Dart 2.14. This
CL makes the library inaccesible, removes support for `dart:web_sql` imports,
and removes the `Window.openDatabase` API. The old code for `dart:web_sql` is
still generated by the html generators. Removing that will be handled by a
separate change.
Closes https://github.com/dart-lang/sdk/issues/46316
Change-Id: I892107396b3b227b4f33344377585aa5e5328288
Bug: https://github.com/dart-lang/sdk/issues/46316
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216080
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
The added field holds the interface signature type for a Procedure when
this is different from the class signature type (implied by the function
parameters and return type). This is needed for forwarding semi stubs
when its declared type is different from the called super member.
Closes https://github.com/dart-lang/sdk/issues/47072
TEST=pkg/front_end/testcases/general/implement_semi_stub.dart and more
Change-Id: I4a7cdc9d564fb0a59e7b06e83646b5410d8d82f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216420
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <dmitryas@google.com>
Most of these arguments are flowing through to a `--packages` argument
which allows passing the `package_config.json` file. In the long term we
should remove the `.packages` file entirely.
TEST=None, the change should have no visible impact.
Change-Id: I60a8b175d5e217a85588bbcb91cc5095514066b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/211503
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Restore the behavior originally added in
https://dart-review.googlesource.com/c/sdk/+/172082 to call `.push()`
on Javascript Arrays directly when it is safe.
After some experimenting this optimization no longer appears to be
as effective for lists of native types (the type check is little
overhead) but is still observable for lists of user defined
interface types.
Change-Id: I034666a512a7886e5022498e2d6bd3f8aaceebbd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215483
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
This change updates the classes Message, MessageCode, Template,
LocatedMessage, and FormattedMessage so that they uniformly refer to
error message text using the terminology `problemMessage` and to
correction suggestions using the terminology `correctionMessage`.
This brings them into alignment with the names we've decided to use to
unify the structure of front_end and analyzer, and makes them match
the names used in the anlayzer and front end's `messages.yaml` files.
Change-Id: Idcbb7ccfff6bb4e99ca22a3ef3c19d83880cf3c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/215154
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
- Adds tests for various types of constructors.
- Recognize when a constructor is const and mark the class symbol
accordingly.
Change-Id: I9ae7fc2837a6821b196f06a267603fd18c3e5075
Issue: https://github.com/dart-lang/sdk/issues/40273
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208362
Reviewed-by: Anna Gringauze <annagrin@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
* Tests constructor tear off values and calling torn off constructors.
* Covers default, named, redirecting, and factory constructors at break
point locations in a method, global function, and inside the default
constructor.
* Create new test suites for legacy code (Dart language version 2.11)
in amd and ddc module systems.
* Sound and Unsound suites now run code without a Dart language comment.
Change-Id: I9cf16c258ce6ece7c436f9deb044ed821f980d1b
Fixes: https://github.com/dart-lang/sdk/issues/47214
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214866
Reviewed-by: Anna Gringauze <annagrin@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
This is a reland of fb36bba5f2 with
a fix to the ordering to ensure all the expectations run.
Original change's description:
> [ddc] Add web library environment variables
>
> Ensure frontend server builds for the `DevCompilerTarget` add the
> environment variables needed for `bool.fromEnvironment()` calls for
> conditional imports.
>
> Change-Id: Ifd372c1cf385fc843534d85af1ac9ae75a6285b8
> Fixes: https://github.com/dart-lang/sdk/issues/47207
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213802
> Commit-Queue: Nicholas Shahan <nshahan@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
Change-Id: Id88aeaf0ddc783936d413c06099df031bc7cb0a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214224
Reviewed-by: Anna Gringauze <annagrin@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
This reverts commit fb36bba5f2.
Reason for revert: New test fails on windows configurations.
Original change's description:
> [ddc] Add web library environment variables
>
> Ensure frontend server builds for the `DevCompilerTarget` add the
> environment variables needed for `bool.fromEnvironment()` calls for
> conditional imports.
>
> Change-Id: Ifd372c1cf385fc843534d85af1ac9ae75a6285b8
> Fixes: https://github.com/dart-lang/sdk/issues/47207
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213802
> Commit-Queue: Nicholas Shahan <nshahan@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
TBR=johnniwinther@google.com,nshahan@google.com,annagrin@google.com
Change-Id: Iedfc4c1a5b24b515646d4f1b486bcb2f19bb7783
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/214222
Reviewed-by: Anna Gringauze <annagrin@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Ensure frontend server builds for the `DevCompilerTarget` add the
environment variables needed for `bool.fromEnvironment()` calls for
conditional imports.
Change-Id: Ifd372c1cf385fc843534d85af1ac9ae75a6285b8
Fixes: https://github.com/dart-lang/sdk/issues/47207
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213802
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
CFE transformation to add a function body for external fields,
getters, and setters, routing to the relevant js_util
getProperty and setProperty optimized calls.
Change-Id: Ia3d0f05fda50f20d217c0a67e0fd636bb774000b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213600
Commit-Queue: Riley Porter <rileyporter@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Expression compiler worker tests sometimes reach the timeout limit
on CI machines, split them into two batches.
Closes: https://github.com/dart-lang/sdk/issues/45484
Change-Id: I502de5d768f29be862e593379e3a906ec6c21eb0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213734
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Anna Gringauze <annagrin@google.com>
This CL removes async markers where await wasn't used.
In a few cases this also meant the ability to make the procedure not
return a future at all.
Also - at least on the VM with my benchmark run on my PC - returning
new Future.value(whatever) in a non-async procedure is faster than
returning whatever in an async procedure.
TEST=CI and existing tests.
Change-Id: I4ba888313c87de76bb0ca02c19eb1ab45f168a85
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213480
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Fixes#47190
TEST=None, only markdown files where edited.
Change-Id: Ife204f9c792b6bce30d0cd7bf2260ced11c8f2b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213049
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Helper methods for locations in constructors (`super` not available)
were missing type information for the tearoff. This replaces the use
of a helper that would itself would be torn off.
Added a new form of helper method that performs the tearoff and
binds the type. NOTE: Generic type arguments are still applied
outside of the helper.
Change-Id: I8dafe0d8357ecc9e1d070046a82e9e83e1a16ed9
Fixes: https://github.com/dart-lang/sdk/issues/47175
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212861
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
This CL handles expression compilation inside extension methods better.
It is now possible to evaluate "this" and other methods defined in the
extension.
https://github.com/dart-lang/sdk/issues/46757
TEST=service tests added.
Change-Id: I3c71eb23117e26b01961f32103f4046f0b537976
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212286
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
- to isCovariantByDeclaration and isCovariantByClass, respectively.
This is done to align the terminology with the spec.
TEST=existing
Change-Id: I96b2e5d6e05caca431aad2b54545e928aee034e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213041
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
* Update tearoff runtime equality algorithm with newly specified
requirements.
* Update kernel golden files for the dartdevc target to include
the static method lowering for constructor tearoffs.
* Avoid adding source maps and debug symbols to the static methods
created by the CFE lowering.
* Add additional expected non-nullable values detected in the
nullable inference tests. These correspond to the values that
appear in the static method return statements.
Measurements taken from large applications show the lowering causes
a code size increase of 2.5%-3.5%. That increase did not appear to
create any measurable difference in initial page load time but if
there turns out to be a regression we can revisit each of the various
lowerings to implement support in DDC at the site where the constructor
is torn off.
Fixes: https://github.com/dart-lang/sdk/issues/46486
Fixes: https://github.com/dart-lang/sdk/issues/46837
Change-Id: I01fa39d4f1d0e937919dd1466bb6a34c91a10e75
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206960
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
When a mixin introduces a forwarding stub setter in the class
hierarchy there also needs to be the accompanying getter in the same
class if a getter is present further up the class hierarchy. This
is because the setter is represented as a property with only a setter
and the lack of a getter will not cause a lookup further up the
prototype chain.
Fixes: https://github.com/dart-lang/sdk/issues/46867
Change-Id: I8e41eb9d2569f0819200a82367ab7c723a1011cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209854
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Migrate member accesses of the ddc runtime library to the
`runtimeCall()` and `runtimeStatement()` methods. These properly
track the use of the library when compiling in the expression
compiler.
This fixes an issue where the `dart` library top level name could be
missing if an expression doesn't happen to trigger a code path that
tracks the use of the library.
Change-Id: I44e99d1b424059c0ce63f6df21fca804dafdb05c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210064
Reviewed-by: Anna Gringauze <annagrin@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
* Splitting expression eval tests into separate tests per module system to avoid timeouts
* Adding some extra timeouts to various Chrome operations in the e2e suite
* Running in non-headless Chrome on Windows to avoid strange flakiness problems
* Minor test suite reformatting
For timeouts, see: https://dart-review.googlesource.com/c/sdk/+/208347/21..22Fixes#45713
Change-Id: Id51d412da1ffc66b443c73cdb50daa777bdce929
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207562
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
Moves dart2js DebugPrinter and Indentation to pkg/kernel/lib/text
and produces the AST of compiled libraries when ddc is run using
the --summarize-text flag.
Change-Id: I195ff99a0929ac12791b4f7b6c5e755b19065c23
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208460
Commit-Queue: Riley Porter <rileyporter@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
- Use one client to communicate to asset server in AssetFileSystem
- Set maxConnectionsLimit to 200 on the client to prevent broken sockets.
- Lower the retry count on the http client in AssetFileSystem to 4 to
for faster turnaround, now that we have less breaking connections.
- Update tests not to hold onto all the connections while waiting for
simultaneous reads to finish.
Related: https://github.com/dart-lang/webdev/issues/1345
Related: https://github.com/dart-lang/sdk/issues/46647
Change-Id: I36a453c3889353c66b8939d3d44868cf63badc17
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208243
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Anna Gringauze <annagrin@google.com>
Removes the lazy loading of the underlying type in LazyJSTypes.
As such, this removes the need to keep AnonymousJSType and
LazyJSType separate, and is therefore refactored to
PackageJSType. Similarly, subtyping is fixed such that
PackageJSTypes are all subtypes of each other.
Change-Id: If489defdbeb5cb932db802a7d146ad2fc393b12c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207982
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
- Collects `FunctionSymbols` for top level functions, getters, setters,
as well as class methods, getters and setters.
- Add test cases.
Change-Id: If26c59e920c3e6e914c7f06e3b725afdf048c4e1
Issue: https://github.com/dart-lang/sdk/issues/40273
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207100
Reviewed-by: Anna Gringauze <annagrin@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
- New version has been migrated to null safety.
- Update tests that are currently broken. It looks like a CFE bug
was fixed and now the private static fields are accessible.
Change-Id: I3d9bde85b65c0e219f756df2d9531539eb7f732b
Issue: https://github.com/dart-lang/sdk/issues/46617
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207382
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Preparation to begin migrating dev_compiler libraries to null safety.
With this change any file we remove the old language version comment
from will be opted into null safety.
Change-Id: I567d139a6c6bfa0b8f820b16e3eb87a2f49228b3
Issue: https://github.com/dart-lang/sdk/issues/46617
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206961
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
We use `package:shelf/shelf_io.dart` to serve the requests,
which in turn uses `package:shelf_proxy/shelf_proxy.dart` as
an inner request handler.
On exception (such as seen in the webdev CI failures) the shelf_io
returns 500 response, which is currently is not causing a retry in
RetryTimeoutClient.
This change adds retries on 500.
Add tests with server returning InternalServerError.
Closes: https://github.com/dart-lang/webdev/issues/1345
Change-Id: I73470d73fb5651edee4bf2033ae514930bfe28c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206581
Commit-Queue: Anna Gringauze <annagrin@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Recent flakes in webdev CI show failures to load dill files
due to broken sockets (most likely caused by connection timeouts).
This change adds retries and timeouts to the asset server file
system to make it tolerant to breaking connections.
- Add RetryTimeoutClient wrapper for HttpClient that performs
retries with delays and connection/response timeouts, based
on the idea in
https://github.com/dart-lang/http/blob/master/lib/retry.dart
- Make AssetFileSystem use the RetryTimeoutClient.
- Add tests for reading multiple files concurrently.
- Add tests for ExpressionCompilerWorker reading assets using
standard, multiroot, and asset file systems.
- Simplify uri that AssetFileSystem uses to query the asset
server, since we no longer need to load package uris.
This will eliminate a step in uri translation in dwds.
- Validated that changes do not break google3 manually.
Change-Id: I2ff163b8d99cd0b7551f3f33a71e6b306540e3c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204880
Commit-Queue: Anna Gringauze <annagrin@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
There was an error in the test hiding the fact that we were not
collecting the names for private instance fields correctly.
Change-Id: I1af3d3c2cc9afb92844bc8ec657be1599f1d5b8a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205761
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Adding explicit source maps to the operator created a breakable location
when viewing source-mapped dart code in chrome devtools. There isn't a
breakable point in the javascript for a `!` operator so trying to enable
the breakpoint visible in the dart code would trigger some "other
breakpoint".
Recent changes in the V8 debugger have changed which "other breakpoint"
would be triggered.
16b0767adc
This causes our tests to fail and makes the user
interaction a little confusing. Removing the extra source map here seems
to be the most reasonable solution because it prevents a possible
breakpoint from appearing where there isn't a breakable location.
Now, the ! operator doesn't introduce any new source mapping it simply
continues the previous mapping.
Change-Id: I5903bfeaf1bcb2e2a3ce883433153575aa1fd05a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204742
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
- Collects `VariableSymbols` for global variables and class fields.
- Add test cases.
Change-Id: Id79d60d01f84948c4c7b0bf9e54fbdd232da63da
Issue: https://github.com/dart-lang/sdk/issues/40273
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204086
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
We are seeing CI flakes in webdev when using expression_compiler_worker
in tests involving expression evaluation, for example, see linux tests
for dwds in the following PR:
https://github.com/dart-lang/webdev/pull/1343
The logs show that HttpFileSystemEntity.exists fails due to a broken
pipe, which we suspect is due to http client closed too early.
This change is an attempt to fix the problem by
- logging exceptions thrown in expression compiler worker
- awaiting for the request to be read before closing http client in
HttpFileSystemEntity.
TEST=pkg/dev_compiler/test/expression_compiler/asset_file_system_test.dart
See investigation of the CI issue in:
https://github.com/dart-lang/webdev/issues/1345
Closes: https://github.com/dart-lang/sdk/issues/46388
Change-Id: Iaf98f08e8ebb618bf8365bd497f01ae685f0d3f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203841
Commit-Queue: Anna Gringauze <annagrin@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Module symbol information now includes basic details the classes
compiled in the module.
Add tests and refactor to share some of the options for running the
incremental frontend compiler and ddc.
Change-Id: I6d3eb16bd6fb70c4c0af46de93a0f7bf96151c4f
Issue: https://github.com/dart-lang/sdk/issues/40273
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/202865
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
When encountering a FutureOr<T> where both the type argument and
FutureOr have unspecified nullability, compile the FutureOr type
without any nullability wrappers.
Change-Id: Ic822e9d5cb74864a424963d5e624c4e2bf311b33
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203122
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
_setPropertyUnchecked version that can be inlined.
No change in the generated JavaScript for dart2js.
Change-Id: Ie4a8e5a34826b6c9083d34656aaa27050635cb21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200933
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
This is a temporary fix to give debug tools a recognizable string so
they can hide the type variables from the current scope.
The prefix is only applied when the type appears outside of the
top level type table.
This will require a change in dwds to filter variables with names that
begin with this string.
Change-Id: I2942f462280195d81a7de2b710e6b958770d152a
Issue: https://github.com/dart-lang/sdk/issues/45649
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199581
Reviewed-by: Anna Gringauze <annagrin@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Safari has a bug that makes it a syntax error for a function name
to overlap with names of parameters in functions with default
parameter values.
This CL changes DDC to generates code to circumvent this issue
when emitting top-level methods. Fortunately, the Safari bug
doesn't trigger with ES6 methods, so we don't need to do anything
for Dart instance methods.
The only other occurrence of named functions in DDC are
`function*` generators that we emit. Those take no arguments,
so we don't need any additional renaming there.
Fixes#43520
Change-Id: I2e4588701a294a8f3c5b47956826ada4ed973e6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198200
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Allows the method to be called in other places to get the normalized
type without emitting any code.
Change-Id: Ib05c27560f565a04cf48920f6a1eb392cfc5c82c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197901
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Emits legacy and nullable wrappers to the types that appear in
circular hierarchies.
There is still missing nullability information if FutureOr appears
in the type hierarchy but that fix uncovers a larger issue with the
FutureOr type. See https://github.com/dart-lang/sdk/issues/45870.
Change-Id: If5894eaff632c5a961f1316d8803032fae2a0ec5
Fixes: https://github.com/dart-lang/sdk/issues/45767
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196600
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
This reverts commit 853597a978.
Reason for revert: Breaks google3 (b/186088197)
Original change's description:
> Optimize js_util setProperty calls for non-function value types.
>
> No change in the generated JavaScript for dart2js base on a sample
> foo.dart file and tests/lib/js/js_util/properties_test.dart
>
> Bug: #44533
> Change-Id: Ib6866fa7fca1f13b03c75dd4f1eac904b18811e3
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193838
> Reviewed-by: Sigmund Cherem <sigmund@google.com>
> Commit-Queue: Riley Porter <rileyporter@google.com>
TBR=sigmund@google.com,srujzs@google.com,rileyporter@google.com
Change-Id: I3f08d29e2d6a1a7846b8d67fadc314ad947f54cf
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: #44533
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196484
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
No change in the generated JavaScript for dart2js base on a sample
foo.dart file and tests/lib/js/js_util/properties_test.dart
Bug: #44533
Change-Id: Ib6866fa7fca1f13b03c75dd4f1eac904b18811e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193838
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
See: https://dart-review.googlesource.com/c/sdk/+/196026
TEST=Code cleanup exclusively (sorting imports); no new tests.
Change-Id: Ib07a82ff418138c542d6a83cfab9aabbb285f866
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196180
Auto-Submit: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Marks `Function` as an extensible type so that DDC knows to use the
symbolized version of the equals operator.
The `Function` class at runtime already has its equals method attached
as the "symbolized" version. Consider `a == b`. When DDC knows `a` is
statically a raw `Function` and non-nullable (more likely with sound
null safety) the generated code should call the symbolized equals
member ex: `a[$_equals](b)`. Without this change the generated code
would be `a.equals(b)` and fail at runtime because the method does
not exist.
With this change co19_2/LibTest/core/Function/operator_eq_A01_t01
starts passing.
Change-Id: I80dd2abbbb04f1b7ab7e21dd14561a45f6e81459
Fixes: https://github.com/dart-lang/sdk/issues/45601
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194204
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
- Fixes calls that pass `when` or `message` arguments
- Updates location information on the expression statement versions to
point to the beginning of the `debugger()` call instead of the `;` at
the end of the line.
Change-Id: I56e6d3358a4a4f0f04b4087d062c513fa6729bd3
Issue: https://github.com/dart-lang/sdk/issues/45544
Change-Id: I31838b5877d139554e3aa39c9833fd83ae729a0e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195053
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
* Now tests both DDC + AMD module systems
* Porting more tests + purging them from the regular test
* Fixing a bug related to string-typed JS scope objects
Change-Id: I703d3760971ef8c14ef4157a71b364d8d3c22aaf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194080
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
Adding the dartdevc_test target to the pkg-linux-debug bot config since some of its tests require that the sound SDK be built. Also failing more gracefully if the expected dill is not found.
Change-Id: I5d2004a3a13d9f73dcb51afb3c68c0b7c18e614e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194108
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
- Ensure public fields of private classes exposed by typedef are
properly treated as virtual.
- Add modular test that exercises the errors fixed by this change.
Change-Id: If97f66de5b0742612024a2f727d83ca9dc73389c
Fixes: https://github.com/dart-lang/sdk/issues/45512
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193899
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Adding 'dartdevc_test' target to pkg-X builders.
Splits eval tests into sound and unsound suites.
Adding more robust event polling (instead of just waiting 500 ms).
Turns on sound mode for the ported tests.
Also ports a couple more tests.
Change-Id: Ia8e9095e1e3330ea1732a4fa4f14425777de5127
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193446
Reviewed-by: Anna Gringauze <annagrin@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
Also changing strings resolved from JS objects to be more like those seen in the Chrome console.
Change-Id: I52adf2add57822f296eb93b49028f75202e02c3c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193064
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Apply new lints, cleanup violations, and ignore in `lib/src/js_ast` to
avoid adding additional diffs with the version it was forked from.
Change-Id: I1def25865bf195120c594223ebdc0f59139e75b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192241
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
The web compilers don't support getter/field invocation encoded as a
FunctionInvocation on an InstanceGet because it doesn't work for
getter/field invocation of js-interop properties, since the InstanceGet
wouldn't result in a Dart function but just JavaScript function.
To support this in the new method invocation encoding, a special
expression, InstanceGetterInvocation, is used to encode getter/field
invocations in dart2js and ddc.
Change-Id: I21da8e8686f66ae4ce4d44245073b9e424f975b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192181
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
In some cases, such as file system exceptions, ExpressionCompilerWorker
fails to start but does not close its receiver port, which causes the
consumer to wait indefinitely for responses.
Make ExpressionCompilerWorker communicate the failure to the consumer,
close the receiver port, and exit.
Added tests to verify graceful exit.
Issue that uncovered the bug: https://b.corp.google.com/issues/183218372
Change-Id: I54a9c3620cfc5f77c101b26b4e98b6eeb03ad7e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192260
Commit-Queue: Anna Gringauze <annagrin@google.com>
Reviewed-by: Gary Roumanis <grouma@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
This is part of a series of changes to add support for SDK expression eval tests.
Change-Id: Ia96931fdf81324fa131014b49ec2067507c451f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191022
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
The full workflow for an end-to-end test:
1) Perform test/compiler options pre-initialization.
2) Start an instance of Chrome (with 1 tab) and save a persisted debug connection for use in all tests.
3) For each separate Dart program to be tested:
1) Create inside a temp directory the HTML bootstrapper, DDC-compiled JS sources, and auxiliary JS files (dart_library.js or require.js).
2) Initialize a DDC ProgramCompiler/IncrementalCompiler and perform a full compile of the program, saving the compiler's state for subsequent incremental compiles.
3) Enable the debugger and set a URL breakpoint at the program's main JS entrypoint.
4) For each test for this Dart program:
1) Navigate to the HTML bootstrapper, pausing when the target module is loaded (at the breakpoint set above).
2) Set a breakpoint at a JS location translated from a Dart breakpoint ID via source maps.
3) Resume the debugger, pausing at that breakpoint. Remove the breakpoint.
4) Reconstruct the local JS scope, then evaluate the Dart expression.
5) Evaluate the JS expression inline, then compare results with expectations.
5) Disable the debugger to clear its state.
4) Shut down Chrome and clean up any temporary directories.
Other notes:
* Supports bootstrapping/compilation on AMD and DDC module systems only (though expression eval is only supported on AMD)
* Requires that Dart breakpoint IDs be set declaratively (no support for columns)
The test structure/flow is subject to change. While I port existing tests, Dart programs will consist of inline source file strings with simple breakpoints. In the future, we want to allow more complicated Dart programs to be specified (like in the modular test framework) and more complicated expression evaluation test patterns (rather than allowing only a single evaluation per test).
Change-Id: I5de7cfa66991fd14b24fa16edd1615f55c041ae3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190962
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
Reviewed-by: Nicholas Shahan <nshahan@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>
The CL is a step towards have a more restricted and wellstructured
handled of references and canonical names.
The CL moves Reference to canonical_name.dart and makes
CanonicalName.reference private, and replaces CanonicalName.getReference
with a 'reference' getter.
It also removes NamedNode.canonicalName, Field.getterCanonicalName and
Field.setterCanonicalName so that these can only be accessed through the
corresponding reference. This is to reduce the reliance on the
canonical names which, ideally, should only be part of serialization and
deserialization.
TEST=existing
Change-Id: I955fb7d52d4e112d8741f7c12dcf38b74ae0c91a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190442
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
* Add InstanceGetterInvocation for getter/field invocation in web
backends
* Add localFunction getter to LocalFunctionInvocation
* Remove isNot from EqualsCall and EqualsNull - the encoding didn't
carry its weight.
* Remove uses of Name.name
* Remove BottomType code from VM
TEST=existing
Change-Id: I99d05d35b9ef193d092cc151c99ad472dbd60834
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188725
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
No change in the generated JavaScript for dart2js based on both a small
foo.dart sample file and tests/lib/js/js_util/properties_test.dart
All changes in generated JavaScript for DDC are smaller and clearer:
- foo.dart: https://paste.googleplex.com/4738045023617024
- properties_test.dart: https://paste.googleplex.com/5107699705446400
Bug: #44533
Change-Id: I670f0226fbef90d05a95c51d918831bea58d6aa3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/187840
Commit-Queue: Riley Porter <rileyporter@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
The CFEs FormattedMessage always had two getters to get the text inside
one that would supposedly give an ansi formated version of the message
and one that would supposedly give a plaintext formated version of the
message. They both returned the same string, though, which would either
be with ansi escape codes or plain text depending on the environment at
compile time.
This CL fixes that by having both messages, and letting the reporting
(i.e. whenever the message is read) decide which to use. That way we
can - for instance - report errors with color if the terminal supports
it correctly when reusing a dill (and reissuing problems, but where the
terminal support changes) and if printing the problem to an html <pre>
field (like observatory does).
It also cleans up two different implementations of whether we think
the terminal supports colors or not, by deleting one of them.
This is the second try. Patchset #1 is the original.
Patchset #2(and possibly beyond) is the changes.
TEST=Existing test suites.
Change-Id: I8e483049ce81ce1bd8e5396b588a31e0ad3a8630
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/187402
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
This reverts commit f63f7736c5.
Reason for revert: This somehow breaks the Windows bots. `python tools/test.py -n dartk-win-release-x64 standalone_2/io/process_shell_test`.
Original change's description:
> [cfe] Actually have both ansi and plain text formatted messages
>
> The CFEs FormattedMessage always had two getters to get the text inside
> one that would supposedly give an ansi formated version of the message
> and one that would supposedly give a plaintext formated version of the
> message. They both returned the same string, though, which would either
> be with ansi escape codes or plain text depending on the environment at
> compile time.
>
> This CL fixes that by having both messages, and letting the reporting
> (i.e. whenever the message is read) decide which to use. That way we
> can - for instance - report errors with color if the terminal supports
> it correctly when reusing a dill (and reissuing problems, but where the
> terminal support changes) and if printing the problem to an html <pre>
> field (like observatory does (1)).
>
> It also cleans up two different implementations of whether we think
> the terminal supports colors or not, by deleting one of them.
>
> (1) At least sometimes. It works - I think - only for 'evaluateInFrame',
> but that's another story (and will be fixed in a follow-up CL).
>
> TEST=Existing test suites.
>
> Change-Id: Iedaedd9a5c41458d40c23ed4b706324c004ae943
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186291
> Commit-Queue: Jens Johansen <jensj@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
Change-Id: I0b53f943a61f76705badfead30d9e1ee35baff57
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186941
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
The CFEs FormattedMessage always had two getters to get the text inside
one that would supposedly give an ansi formated version of the message
and one that would supposedly give a plaintext formated version of the
message. They both returned the same string, though, which would either
be with ansi escape codes or plain text depending on the environment at
compile time.
This CL fixes that by having both messages, and letting the reporting
(i.e. whenever the message is read) decide which to use. That way we
can - for instance - report errors with color if the terminal supports
it correctly when reusing a dill (and reissuing problems, but where the
terminal support changes) and if printing the problem to an html <pre>
field (like observatory does (1)).
It also cleans up two different implementations of whether we think
the terminal supports colors or not, by deleting one of them.
(1) At least sometimes. It works - I think - only for 'evaluateInFrame',
but that's another story (and will be fixed in a follow-up CL).
TEST=Existing test suites.
Change-Id: Iedaedd9a5c41458d40c23ed4b706324c004ae943
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186291
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
This was used to build the sdk long ago. Last year (in April!) we removed
the last use of it internally, so the file can now be removed. At this
point both internal and external build systems use the compile platform tool.
Change-Id: Ib92b2ae4b0b3f1b7b7ec4bc6dd50ad2723016ec4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186661
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
This change adds a placeholder for int.operator >>>.
No implementation is added yet.
This change unblocks implementation of this operator in
the backends (VM, dart2js, DDC).
Issue: https://github.com/dart-lang/sdk/issues/44912
Issue: https://github.com/dart-lang/sdk/issues/30892
Change-Id: I9912ca9f44d594e9c5fa91f5fc65e807fe48cc7a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185480
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
The front end previously enforced a stricter-than-spec requirement on
conflicting imports on its own code. The check was included of the
kernel snapshot and therefore always enforced, even in published sdks.
The extra check was removed a month ago and now tools/sdks/ have been
updated to use a later version of the sdk, so the unneeded hide
combinators can now be removed from the source code.
Closes#44667
TEST=existing
Change-Id: I1d1053b1ef9a40b6a918eef515a02d7b404906c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185084
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
The CFE FunctionNode has a new getter for the Future value type that
can be used in null safe libraries.
Legacy libraries will still rely on flatten to get the type of the
Future.
Change-Id: I54ad3bc096fdb981f7f499f2ba3ddfcb01fd97d6
Issue: https://github.com/dart-lang/sdk/issues/44745
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185240
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Null sources appear to come from files that contain only external
declarations. These sources can simply be ignored in the summation
of the sizes of dart files that make up a module.
Change-Id: I38864c7f4a3e208b19e26d5a887445fdf4622479
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184901
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
This assertion fails when compiling the SDK because the types
dynamic, Null, and void all have `Nullability.nullable`.
They are safe to allow through unchanged because each has their own
visitor that avoids the nullability wrapper at runtime.
Change-Id: I0ce345ce11dddb345eab3708804cbde6a540fdd1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184880
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Since the flag is now enabled by default, there should be no mention of it.
There are still some uses in front_end/testcases that are not just removable
(it also uses `no-non-nullable`). There migth be more uses that are not
as easily found as grepping for `--enable-experiment
Removes two VM tests where fixing them meant they were just duplicating
the corresponding non *_2/ tests.
Fixes#44941
TEST= Large number of tests chaged.=(no-)?non-nullable`.
Change-Id: Ief755981ccde9a5482fcdf408c2929c74433a710
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183688
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Improve the performance by loading resources in parallel if possible.
Change-Id: Ibf93b7aa7510a110740399eef825f3c140c6dfd5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184203
Auto-Submit: Gary Roumanis <grouma@google.com>
Commit-Queue: Gary Roumanis <grouma@google.com>
Commit-Queue: Anna Gringauze <annagrin@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
This is in preparation to migrate package:kernel to null safety.
For the visitor interfaces to support non-nullable return types, the
implementations must avoid using `null` as return value in its base case.
TEST=Refactoring
Change-Id: Ie8fa5d41b99850d9e4abb59634c72920c64128d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183691
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
- Fix violations
- Ignore lint in js_ast directory. Still holding onto hope that we will
merge this with dart2js version and move out of the ddc package.
- Import all lints from pedantic 1.9.0
Change-Id: I834b4b197dcf0b6924417cdd337cda9a1b6249d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183043
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
This reverts commit ce81216885.
Reason for revert: Flutter dependency
Original change's description:
> [kernel] Ensure that visitors don't implicitly returns `null`
>
> This is in preparation to migrate package:kernel to null safety.
> For the visitor interfaces to support non-nullable return types, the
> implementations must avoid using `null` as return value in its base case.
>
> TEST=Refactoring
>
> Change-Id: Ie5e4153f8d3779d94957bb13b3d2d2a942040ff2
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179760
> Commit-Queue: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Jens Johansen <jensj@google.com>
TBR=jensj@google.com,johnniwinther@google.com
Change-Id: I61b838d3371e6b1de2427716d056324c120be499
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183689
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This is in preparation to migrate package:kernel to null safety.
For the visitor interfaces to support non-nullable return types, the
implementations must avoid using `null` as return value in its base case.
TEST=Refactoring
Change-Id: Ie5e4153f8d3779d94957bb13b3d2d2a942040ff2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179760
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
- Added support for --define to the VM and dart2js
- Added support for -D and --define for `dart run` and `dart compile js`
Remaining improvements:
- Add support for providing multiple comma separated values for `dart
run`, `dart`, and `dart2js`
Related issue: https://github.com/dart-lang/sdk/issues/44562
TEST=Updated CLI tests and added new dart2js tests.
This reverts commit e49937769f.
Change-Id: I5f9275b829665eb5e8695403d67f230e752ab0e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183180
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
- Copy the internal version of dart_library.js without any changes.
- Unblocks syncing this file again.
- Update ddb script to use the dart2js preamble for d8 which includes
assignment of a global `self` and the fake event loop for better
error handling.
Change-Id: I01c2ad82fe7c36bb393f9eab897f558daabf6b8b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181522
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Just some preliminary formatting to make it easier to see the diffs
when I merge the changes from the version in google3. The diff
algorithm gerrit uses doesn't handle the change in indentation very
well.
Change-Id: I2a4daa50d0051140569d51bea5845a0366ba1dad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180700
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
In non foreign-js calls this is immediatelly passed to wrapType which will
normalize it to the same value. So this is only added as a small optimization.
Change-Id: I145d58ad0244a2e7068a928b231f69a9491c465e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180444
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
This change prepares for an upcoming CFE normalization.
Today kernel AST shows type literals as TypeLiteral nodes. Soon the CFE
will change the representation and canonicalize type literals and
represent them using constnats.
With this change, the compiler will recognize both the old and new
patterns.
Change-Id: I5aa3d99743c95c2dda04d299e586e77540fb7f7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180266
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Used in the SDK runtime library like the getGenericClass helper but this
is intended to be used when we statically know the type of the class to
be retrieved. Helps avoid breaks caused by an upcoming CFE change that
turns type literals into constants.
Change-Id: I262dd2dae347170050d2fe5cd2722ab132951036
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180265
Reviewed-by: Sigmund Cherem <sigmund@google.com>
- load summaries on updateDependencies and replace them by full
kernel files for current module on expression evaluation
- add tests for compiling expressions in various modules
- add tests for compiling expressions after updating dependencies
- test expression compilation in sound null safety mode
Change-Id: I243e8d1535e9510bc51f094545743d82bdbf23ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179404
Commit-Queue: Anna Gringauze <annagrin@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>