Front-end server and gen_kernel tools now take
--dump-detailed-dynamic-interface=foo.json
option which can be used along with --dynamic-interface when
AOT-compiling application with exposed dynamic interface.
This option dumps dynamic interface broken down to members
and classes as JSON.
TEST=pkg/vm/test/transformations/dynamic_interface_annotator_test.dart
Fixes b/420811696
Change-Id: Id1b15521f47a4869fefd40e835044584fbfb5274
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431901
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
The `_as` methods for primitive types are designed to be called from
both the `_as` selector and directly from generated code.
For the primitive types that are known at compile time and cannot change
via linking or hot reload, we can generate direct calls.
Adapted from https://dart-review.googlesource.com/c/sdk/+/420380
In addition to the base change:
* Remove `int` cast helpers from DDC only code in favor of the
versions from dart:_rti.
* Moves existing optimizations from `visitAsExpression` to `_emitCast`
to apply them consistently.
Change-Id: I13d24e3756400f2358556812728db17bc73f544a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/427040
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Previously, code in a closure was compiled with the assumption that
invocations known to be statically sound didn't need any runtime checks
to guaranty soundness.
Now, if the code is retained from an earlier compile and executed after
a hot reload, any assumptions regarding soundness may be invalid.
This change transforms what was an invocation expression into a larger
expression that performs additional checks (similar to a dynamic call).
All checks are skipped if the compile generation matches the current hot
reload generation at runtime.
The soundness checks are handled by a new runtime helper method
`hotReloadCorrectnessChecks`. Any argument expressions are hoisted into
let variables to preserve their evaluation order and to ensure they are
only evaluated once. The helper checks for the existence of the
invocation target, the shape of the method signature, and runtime type
of the passed arguments. Mismatches result in an invocation of
`NoSuchMethod`. Any returned value is cast to the expected static type
of the original invocation.
Change-Id: If925f1a9b475d5ac581b2526403ab7c95753ffef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/421640
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
This is a reland of commit b9b77058a9
Original change's description:
> Migrate to use pub workspace
>
> Use `pub get` to generate `.dart_tool/package_config.json` on gclient sync.
>
> All pkg/ (and a few third_party) packages that are developed inside the sdk repo are included in the workspace from the root `pubspec.yaml`.
>
> All dependencies that are pulled in via DEPS are added as path dependencies via `dependency_overrides` in the root `pubspec.yaml`.
>
> Bug: https://github.com/dart-lang/sdk/issues/56220
> Change-Id: I38c12b608c68da54c57821116cf9aa6696936746
> Tested: relies on CQ of existing tests. Should have no effect on functionality
> CoreLibraryReviewExempt: only core library change is adding a `// ignore:` comment. Should have no influence on functionality
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/397164
> Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
> Reviewed-by: Alexander Thomas <athom@google.com>
Bug: https://github.com/dart-lang/sdk/issues/56220
Change-Id: I29afabade2d2447dea05121cb87ff50bb21a4b76
Cq-Include-Trybots: luci.dart.try:flutter-linux-try,flutter-web-try
Tested: relies on CQ of existing tests. Should have no effect on functionality
CoreLibraryReviewExempt: only core library change is adding a `//
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415561
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
This reverts commit b9b77058a9.
Revert "Add missing sample pubspec to workspace"
This reverts commit 892ea15ac7.
These seem to break the engine.
Change-Id: Ieee26deb7928c3869a1b6265326c3ce568ffe731
Tested: this is a revert.
CoreLibraryReviewExempt: this is a revert
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415582
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Use `pub get` to generate `.dart_tool/package_config.json` on gclient sync.
All pkg/ (and a few third_party) packages that are developed inside the sdk repo are included in the workspace from the root `pubspec.yaml`.
All dependencies that are pulled in via DEPS are added as path dependencies via `dependency_overrides` in the root `pubspec.yaml`.
Bug: https://github.com/dart-lang/sdk/issues/56220
Change-Id: I38c12b608c68da54c57821116cf9aa6696936746
Tested: relies on CQ of existing tests. Should have no effect on functionality
CoreLibraryReviewExempt: only core library change is adding a `// ignore:` comment. Should have no influence on functionality
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/397164
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Moving forward, the Dart Model team will own the following packages:
- _fe_analyzer_shared
- analyzer
- analyzer_cli
- analyzer_utilities
- front_end
- frontend_server
- kernel
- testing
In follow-up CLs I will create an OWNERS file for the developer
experience team, and then remove the OWNERS files for the old analyzer
and CFE teams.
Change-Id: Id7cf38ea41a6d3f9ca44f43fae1f310426a31e29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/409841
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
* Demonstrates the ability to generate metadata when inspecting the
last accepted and delta components.
* Attach the metadata to the component right before compiling with DDC.
* Use the metadata to avoid deoptimizations in the initial compile
when they are only required to support a hot reload.
* Deletion of all type rules for classes that extend Object in the
initial compile. In the future this should be reduced further to
only the classes that had a hierarchy change in a hot reload.
* Type checks on the return value of getters used to represent
fields.
Change-Id: I2812b564bc3f4d72f005d4bd11fa55ec0eb394ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/404940
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
By adding this message here, any entrypoint that makes use of this for hot reload (e.g. DartPad, Flutter tools/FE server) will all surface this same message. This probably easier than having each one try to detect errors and append its own message.
Change-Id: I5980d530b66da818e29403cc13407095d8b203dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/408380
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
This removes the support running macros in the CFE.
The scanner and package:kernel still have support for the macro modifier. This will be removed in a follow-up.
The metadata expression parser is deliberately left in, since it might serve as the basis for a parser AST.
Change-Id: I06d91eb0fac2e7a71e6afde647b03be3814dbd5f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/406963
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Morgan :) <davidmorgan@google.com>
- Adds a new instruction intended for recompiles during a hot
restart. This is desired so that DDC can differentiate between
the two recompiles and emit errors for hot reload. The VM only
ever recompiles during a hot reload, so they won't need this.
- Adds some tests to make sure recompile-restart doesn't trigger
errors that recompile will. Also tests that they're virtually
similar otherwise.
- Fixes a small issue in the delta inspector to use importUris
instead of fileUris when computing the LibraryIndex.
Change-Id: Ic375167ec72934cd380c4f538b45566bd87de433
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/406200
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Initially this visitor will reject reloads (by throwing an Exception).
Future changes will add the ability to record data about the delta to
guide the JavaScript compilation decisions.
- Rejects deltas that delete all const constructors from a class
(making it non-const).
- Adds ability to test the visitor directly by compiling components
from source via an in-memory compiler.
- Updates DDC frontend_server compiles to write errors to the output
stream.
Change-Id: Ib318f42d28367416983266a214f97821a38a2913
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/401600
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
to compile every entrypoint
This is necessary to ensure that the options used when performing
compilation during expression evaluation or hot reload match the options
that were used to compile the running program before it was started.
TEST=test case added to pkg/dartdev/test/commands/run_test.dart, CI
CoreLibraryReviewExempt: This CL does not include any core library API
changes, only VM Service implementation changes in
sdk/lib/vmservice/running_isolates.dart.
Change-Id: If11207e090d9b02d5a6a8396e09dc90d0c874f58
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/403240
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
CoreLibraryReviewExempt: This CL does not include any core library API
changes, only VM Service implementation changes within
sdk/lib/vmservice/running_isolates.dart.
Change-Id: Icbd3a8fe6c10c2c1ef3d1f4737639f32227239c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/401644
Reviewed-by: Ben Konyi <bkonyi@google.com>
With the new (and eventually, only) module format, we refer
to collections of libraries as bundles rather than modules.
This convention is a better fit as the frontend server
already treats modules as a collection of libraries.
Furthermore, places where we use the word "module" may be
better communicated by using "library bundle import" (the
component URI) or "library bundle name" (the synthesized
name we give library bundles).
This CL leaves usages of modules that are tied to user-facing
flags for clarity, e.g. "module format" and "useDebuggerModuleNames".
It also ignores usages where the intention is very much tied
to a module e.g. when using require.js.
Change-Id: I363b1eac955f710accece9fa3a8ea2624c751430
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/397200
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
This reverts commit 817306a735.
Reason for revert: Later patchset includes fix for `frontend_server_circular_evaluate_test`.
The fix is to cache the bundle/program compiler for all the
libraries in the strongly connected component, and not just
for the initial one that determines the component uri.
Original change's description:
> Revert "[frontend_server] Soft-deprecate moduleName for compileExpressionToJS"
>
> This reverts commit 294a50fc6f.
>
> Reason for revert: This breaks `frontend_server_circular_evaluate_test` in DWDS.
>
> Original change's description:
> > [frontend_server] Soft-deprecate moduleName for compileExpressionToJS
> >
> > https://github.com/dart-lang/sdk/issues/58265
> >
> > The DDC library bundle format does not give names to modules.
> > Therefore the frontend server should try and find the compiler
> > associated with the library and not the module to be consistent.
> > This then means that moduleName becomes entirely unused, and
> > therefore we can soft-deprecate it.
> >
> > Change-Id: I241c63a346d046405599384409a373ab12be2654
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396102
> > Commit-Queue: Srujan Gaddam <srujzs@google.com>
> > Reviewed-by: Johnni Winther <johnniwinther@google.com>
>
> Change-Id: I74b096f7ebc322c9d4428d236ab226ef1adcb6b9
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396567
> Reviewed-by: Nicholas Shahan <nshahan@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Commit-Queue: Srujan Gaddam <srujzs@google.com>
Change-Id: I45852c29a0b5735976f6a5f649f3ee84b26ef76c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396572
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
https://github.com/dart-lang/sdk/issues/58265
The DDC library bundle format does not give names to modules.
Therefore the frontend server should try and find the compiler
associated with the library and not the module to be consistent.
This then means that moduleName becomes entirely unused, and
therefore we can soft-deprecate it.
Change-Id: I241c63a346d046405599384409a373ab12be2654
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396102
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Running DDC + FES in incremental mode was causing FES state machine responses to fail whenever DDC emits an error. These should be captured and reported (and potentially rejected manually).
Change-Id: Ic409dd8986c984b858fec21c6f67bd52147b367d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/384824
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
Add a simple implementation that throws out all libraries and runs the
main method again which triggers all libraries to be initialized with
fresh values.
Move the hot reload tests to the ddc canary test configuration
since that is where the support works at this time.
Update frontend server to use the use the new version of the DDC
LibraryCompiler when the emit library bundle option is true.
Change-Id: I6eba613106672536ef8bfcb0ff0a55749e2fb63c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/381902
Reviewed-by: Kevin Moore <kevmoo@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>