This CL makes the VM add support for .dart_tool/package_config.json via
* the --packages=<file> command line parameter
* the `packageConfig: <file>` parameter to `Isolate.spawnUri`
It also allows now `package:*` uris being used in `Isolate.spawnUri`
The CL also removes the unused `packageRoot` parameter from the Dart to
C++ interface as well as in various places in C++.
The CL also aligns the implementations between sdk and sdk_nnbd more.
Issue https://github.com/dart-lang/sdk/issues/41649
Issue https://github.com/dart-lang/sdk/issues/41245
Issue https://github.com/dart-lang/sdk/issues/41246
Change-Id: I642dfb89f82b3f2c1613e443850bf0b4fb91f4a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144766
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
This reverts commit ca94ad7112.
Reason for revert: Appears to break dartkb.
Original change's description:
> [VM] Remove unnecessary Closure.clone() from sync*.
>
> Instead, this CL wraps sync*'s sync_op in an additional function
> that captures local copies of the necessary closure state.
> Notably this state includes the parameters of the original sync* function
> as these also need to be cloned for each instance.
>
>
> Note: a large number of .expect files have a small number of changes
> due to the additional wrapper function, as well as some extra plumbing.
>
> Bug: https://github.com/dart-lang/sdk/issues/37753
> Change-Id: If099dbfe9e5d62979626b852386fd0173fc76de5
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136190
> Commit-Queue: Clement Skau <cskau@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
TBR=vegorov@google.com,cskau@google.com
Change-Id: I89e517196f03622337f909f0fcecbdc77c9dda93
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/37753
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144920
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
Instead, this CL wraps sync*'s sync_op in an additional function
that captures local copies of the necessary closure state.
Notably this state includes the parameters of the original sync* function
as these also need to be cloned for each instance.
Note: a large number of .expect files have a small number of changes
due to the additional wrapper function, as well as some extra plumbing.
Bug: https://github.com/dart-lang/sdk/issues/37753
Change-Id: If099dbfe9e5d62979626b852386fd0173fc76de5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136190
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
This reverts commit cab69e7706.
Reason for revert: It was a temporary submit
Original change's description:
> [BUILD] - Initial CL to unfork the NNBD Dart SDK
> NOTE: This is a trial submit and will be reverted immediately.
>
> - Flips the flag from --nnbd to --no-nnbd so that by default it builds
> the NNBD version
> - using the --no-nnbd flag results in the SDK being built in a
> directory which has the 'Legacy' suffix added to it
> (e.g: out/DebugX64Legacy)
> - the '--enable-experiment=non-nullable' flag still needs to be passed
> in during execution so that CFE runs in that mode. This is different
> from the 'null_safety' flag
>
> Change-Id: I7d25d9710818af5919c0bb83abe51153172f5886
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144880
> Reviewed-by: Siva Annamalai <asiva@google.com>
TBR=asiva@google.com
Change-Id: Ib0f99fc1a42c9c7a8b21f8542f4a35dba9105d5c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144900
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
NOTE: This is a trial submit and will be reverted immediately.
- Flips the flag from --nnbd to --no-nnbd so that by default it builds
the NNBD version
- using the --no-nnbd flag results in the SDK being built in a
directory which has the 'Legacy' suffix added to it
(e.g: out/DebugX64Legacy)
- the '--enable-experiment=non-nullable' flag still needs to be passed
in during execution so that CFE runs in that mode. This is different
from the 'null_safety' flag
Change-Id: I7d25d9710818af5919c0bb83abe51153172f5886
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144880
Reviewed-by: Siva Annamalai <asiva@google.com>
Fixes in _LinkedHashSet
Fix in int.tryParse
Brings ~150 test to passing
Change-Id: I494c164135e103e31d4ef6a2e4809e464ec3ba63
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144783
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
This works around bugs in UndefinedBehaviorSanitizer and Clang.
Bug: b/28638298
Change-Id: I6be595f9664516019d28017d24559583a1ae3a21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144354
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
The CFE is evaluating the constant as if strong mode is always
enabled.
This is a temporary work around and we should be able to access
the mode flag here in a future change.
Change-Id: I28842a692183c8da7aa42086a034f5388af83af5
Issue: https://github.com/dart-lang/sdk/issues/41657
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144815
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
This will make it easier to write automated tests of the preview
server.
Change-Id: I4605beaa9ce3a8f43ec358568a53f24b4f05dece
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144801
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This adds support for analysis domains that plugins contribute to by
sending notifications. I've only implemented folding so far, but most
of this CL is to cache results from plugins and to adapt sending server
capabilities.
Instead of using a NullNotificationManager, the LSP server now uses a
regular NotificationManager, except that results won't be forwarded to
clients. LSP handlers will fetch partial results from plugins and merge
them with data from the server that will be computed when needed.
I've extracted the server capabilities calculation from the init
handlers into ServerCapabilityComputer. It will also contain the
interestingFiles glob from active plugins and re-register capabilities
whenever plugins change.
Change-Id: I9869240cbfa284592e952498933e638b89a2a763
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142981
Reviewed-by: Danny Tuppeny <danny@tuppeny.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Originally, edit links were implemented as generic "post links," that
had no special handling except to fire a post request.
At this point, this is no longer the case. We at least want to
specialize the error message, and we have TODOs to do more
specialization (targeted reloading of the UI).
Note that 'edit-link' is already a class, it refers to the edits the
migration tool suggests as the migration. Therefore I used the class
'add-hint-link' instead of 'edit-link.'
Lastly, post-links were styled like buttons. But they are not the only
links that should be styled as buttons now, so just use that class
instead of having special styling.
Change-Id: I8241a5ec24e6a290b94a75327c06257abdfc011b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144660
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
These tests are only meant to run on the VM. They won't work on
dart2js because they require doing I/O to check the status of
generated files.
Change-Id: I3611dd68353827828e9993fa9d042fb086863396
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144800
Reviewed-by: Janice Collins <jcollins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Only removing checks for common calls within the type system that
we know are always safe.
Added `@notNull` on arguments typed to be non-nullable (in the nnbd
version) to avoid producing the null checks.
Added `Object` type to arguments to match the return type and avoid
casts when returning.
Change-Id: I05de45a8d923497f7340348ef2c0b9f72da5414b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143862
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
With this change, DDS takes responsibility for service extension
registration via the service protocol in addition to handling service
extension request routing.
Service extensions registered through dart:developer will continue to
be handled by the VM service as those extensions live within the main
Dart process (this functionality already worked before this CL).
This change also includes a version bump for package:json_rpc_2 to pull
in a bug fix required for this change.
Change-Id: Idb6050058f7695d34276953be159419a5b1b9711
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144349
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Previously, we used the owner field to find the function whose entry
points to fix up after deduplicating instructions/code objects. However,
this means retrieving and checking the owning Function for each Code
object that has one, even if that Code object isn't the current code
object for the owning function. Instead, now we extend the instruction
deduplication visitors to Functions, where visiting a Function means
visiting its active Code object before fixing up the entry point cache.
Since the ProgramWalker also visits Code objects, this means visiting
some Code objects twice (once in the ProgramWalker and once when
visiting the Function for which it is the current code). However, since
the deduplication process is idempotent, the additional visits will not
cause the entry points for the Code object to change further (which
would otherwise invalidate the caches of already visited Functions).
Thus, the order of the visits does not affect the results.
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-product-x64-try
Change-Id: Idd12fc94c5fb98f1fc9eb669d09b47822b0eac1e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144700
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>