This change includes the following:
- A new `tooling-daemon` CLI command to launch DTD
- Minor refactoring of package:dtd_impl to better match expected
Dart package structure
- Updated build rules to create dart_tooling_daemon.dart.snapshot
Change-Id: Idd91bc4ce64ce790db5bad323a50d9cf65523dc2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344800
Reviewed-by: Dan Chevalier <danchevalier@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
The direct algorithm for solving for equality replaces the more
general constraint solving algorithm. It reduces complexity and
removes the requirement on the constraint gathering and solving engine
to be applicable at the earlier stages of compilation.
Change-Id: I73dfa39bb1534803c6985578708ecab198c26e25
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/343920
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
This reverts commit 7784cf3f94.
Reason for revert: broke windows bot
Original change's description:
> analyzer: Do not overwrite an original exception when a plugin crashes
>
> Maybe related to https://github.com/dart-lang/sdk/issues/38629. These tests have been skipped for so long, enabling them took some work, to migrate them from '.packages' files to package config files.
>
> Some other tidying in the test file:
>
> * inline `byteStorePath`, only used once.
> * simplify `_packagesFileContent` and `_getPackagesFileContent`
> into a static getter.
> * simplify `_defaultPluginContent` into a const String, so it can
> be used as a function parameter default value
>
> The diff is way bigger than the functional changes, because we sort
> elements.
>
> Change-Id: I193316316750e80268b684fdc1abe558a77994fe
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344601
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Samuel Rawlins <srawlins@google.com>
Change-Id: Ibeb761afebad4fb4166cec756743dbb35d323e7d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345143
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Use a pinned HTypeKnown on the receiver of the HInstanceEnvironment to
pin the type expression. When the the receiver has a wider type that
is legal for the type expression, this keeps the type expression at a
location where it is valid. Type expressions can still be hoisted if
the HTypeKnown is redundant and optimized away.
Bug: #54329
Change-Id: Iae378f9d517e3e22deca198195cad9811cf37772
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344841
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
So, we can move `pumpEventQueue()` into shared code.
And don't repeat `take()` in test methods.
And use the shared `IdProvider` of the collector.
This let us see as new instances of results are created at different
execution points of a single method, with multiple asserts.
Change-Id: I14a871adceae8c8bd8ee6dcbce8893e1daa62a13
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344941
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This avoids allocating lists in dynamic calls for type
arguments.
So far the closure shape checking functionality also
- as a side-effect of shape checking - added default type arguments
to a growable list. We now cleanly separate the logic to use
default type arguments vs shape checking.
=> Doing so allows removing the remaining usages of [List] in the RTT.
=> Probably also results in smaller & faster dynamic calls.
The list allocation is now pushed to the slow path where we
create [Invocation] object that is then used for NoSuchMethod
handling.
Change-Id: I4823cda0aa9b5f1f137813bc5848c365665da5fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344822
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
This avoids allocating lists in dynamic calls for positional/named
arguments.
=> Doing so allows removing more usages of [List] in the RTT.
=> Also results in up to 50% faster dynamic calls.
=> Probably also results in smaller code.
The list allocation is now pushed to the slow path where we
create [Invocation] object that is then used for NoSuchMethod
handling.
Change-Id: If578fb044a6cf7f31bd409c177b361181ba68a01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344821
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
The previous method I used didn't account for Windows drive letters or host names, and ended up using a bunch of '..' to go back to the root unnecessarily.
Fixes https://github.com/dart-lang/sdk/issues/54129
TEST=pkg/vm/test/transformations/resource_identifier_test
Cq-Include-Trybots: luci.dart.try:pkg-win-release-arm64-try,pkg-win-release-try,pkg-linux-release-try
Change-Id: Ida627148c178137cb3684eb23d0b30c16791308b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344762
Reviewed-by: Moritz Sümmermann <mosum@google.com>
Commit-Queue: Moritz Sümmermann <mosum@google.com>
Auto-Submit: Parker Lougheed <parlough@gmail.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
This reverts commit 717ce7a69c.
Reason for revert: breaking Google3
Original change's description:
> options map support scaffolding in driver
>
> Konstantin and I chatted a bit about this so at least some of it shouldn't be too surprising to him but please do feel free to grab me to chat.
>
> That said a few pointers would be handy. Notably, this change:
>
> * introduces a new `SharedOptionsOptionsMap` for use in SDK drivers (and preserve current semantics)
> * this is currently public but will be private once driver is more evolved to accommodate multiple options files
> * removes the shared `_analysisOptions` from the analysis driver with a baby step to using the one shared in SharedOptionsOptionsMap
> * removes context_builder and collection v2 experiments (and tests)
> * I'll harvest some more functionality from these in future changes but for now they're distracting and hard to maintain
>
> This work is all to setup moving analysis options awareness into file state objects which will allow us to remove `sdkVersionConstraint` info from options (finally) and a host of other good stuff (see https://github.com/dart-lang/sdk/issues/54124).
>
>
>
> Change-Id: Ic4278184016d1018b4b5b1c6ac5ba9e2546927a5
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344860
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Commit-Queue: Phil Quitslund <pquitslund@google.com>
Change-Id: Ia988c5c9cd328d0adce3d8e6ff019e389819a957
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344960
Auto-Submit: Phil Quitslund <pquitslund@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Maybe related to https://github.com/dart-lang/sdk/issues/38629. These tests have been skipped for so long, enabling them took some work, to migrate them from '.packages' files to package config files.
Some other tidying in the test file:
* inline `byteStorePath`, only used once.
* simplify `_packagesFileContent` and `_getPackagesFileContent`
into a static getter.
* simplify `_defaultPluginContent` into a const String, so it can
be used as a function parameter default value
The diff is way bigger than the functional changes, because we sort
elements.
Change-Id: I193316316750e80268b684fdc1abe558a77994fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344601
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Konstantin and I chatted a bit about this so at least some of it shouldn't be too surprising to him but please do feel free to grab me to chat.
That said a few pointers would be handy. Notably, this change:
* introduces a new `SharedOptionsOptionsMap` for use in SDK drivers (and preserve current semantics)
* this is currently public but will be private once driver is more evolved to accommodate multiple options files
* removes the shared `_analysisOptions` from the analysis driver with a baby step to using the one shared in SharedOptionsOptionsMap
* removes context_builder and collection v2 experiments (and tests)
* I'll harvest some more functionality from these in future changes but for now they're distracting and hard to maintain
This work is all to setup moving analysis options awareness into file state objects which will allow us to remove `sdkVersionConstraint` info from options (finally) and a host of other good stuff (see https://github.com/dart-lang/sdk/issues/54124).
Change-Id: Ic4278184016d1018b4b5b1c6ac5ba9e2546927a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344860
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
When a const list access does not have a const argument, fall back to
normal compilation. TFA optimizes const list accesses to direct calls to
`_ListBase.[]`, so the code generated by the intrinsic handler is not
any better, and the generated code in the intrinsic handler does not do
bounds check.
Fixes test standalone/array_bounds_check_generalization_test.
Change-Id: I6455826815c22a731bb830aec08b8bdd701e0d52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344820
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This code appears redundant. It was adding contexts to the declarations tracker as contexts changed, but this was also being done once at the end (in the method "addContextsToDeclarationsTracker" mentioned in the comment).
Apparently at some point I added a TODO suspecting this was unnecessary but didn't realise the performance implications of it on a large project.
There are existing tests that ensure the declarations are tracked correctly (although we don't use them for completions, they're still used to resolve macros in dartdocs).
See https://github.com/dart-lang/sdk/issues/54513
Change-Id: Ibdb7d00c288e78fc44c48a4f9febff688e2db323
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344702
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Prior to this change, both `_scheduleContextFiles` and `_findPackages()` would enumerate `_analysisContext.contextRoot.analyzedFiles()`. This is an Iterable that calls `getResource()` for every item so on large folders showed up on the profile:
https://github.com/dart-lang/sdk/issues/54513#issuecomment-1877065904
This change combines them into a single method so we iterate only once.
It does slightly change the order of things (SDK files were previously scheduled before packages), but the only alternative I have is to add `toList()` but that will need to allocate (and repeatedly grow) a list which I suspect is overall worse.
Other than the order, there should be no functional changes here - I moved the body of `_scheduleContextFiles` into `_findPackages()` and renamed it (which unfortunately doesn't diff nicely because it moved in the file).
See https://github.com/dart-lang/sdk/issues/54513
Change-Id: I2a5539a93ee8ca2cdbad031efcfc9bbaf23e9ab9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344703
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Do not revert: The main channel version must be upgraded now that the
version 3.3 beta has been cut and reverting this change puts the
release infrastructure into an unsupported state. Please fix forward
any potential problems that occur downstream and loop me into the
discussions so we can improve the release procedures in the future.
Change-Id: I8706c3d74fe0474d34a99c5cbbb8e9a88b586cdd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/329902
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Kevin Chisholm <kevinjchisholm@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
If a static field or getter is annotated with
@pragma("vm:platform-const-if", <cond>) and <cond> const evaluates
to true, then uses of the static field or getter are const evaluated
when a target operating system is available. If <cond> const evaluates
to any other value, then the annotation is ignored.
For example, when runtime-only code is guarded like the following,
using Flutter's kDebugMode constant, then debug mode Flutter programs
can alter the defaultTargetPlatform for testing, but in release mode,
the defaultTargetPlatform getter is const evaluated and code guarded
with defaultTargetPlatform checks can be eliminated if unreachable:
@pragma("vm:platform-const-if", !kDebugMode)
TargetPlatform get defaultTargetPlatform {
...
assert(() {
if (Platform.environment.containsKey('FLUTTER_TEST')) {
result = TestPlatform.android;
}
return true;
}());
if (kDebugMode &&
platform.debugDefaultTargetPlatformOverride != null) {
result = platform.debugDefaultTargetPlatformOverride;
}
...
}
TEST=pkg/vm/test/transformations/vm_constant_evaluator
Change-Id: I55b88502a908c56cf42a761dd06741f15c8a23d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/333220
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
Not sure if there's a good reason to keep this as `resolve2` since there's no simpler `resolve` to be found. If there is, please let me know and I can revert this and add a doc to `resolve2` for clarification.
Change-Id: I67c3825e9db95ec3f3c618f08664ed655394c041
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344460
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>