Currently it using legacy stringified parameters which
makes it hard to pass complex structured data to it.
TEST=ci
CoreLibraryReviewExempt: vm-service implementation changes no affecting public corelib APIs.
Change-Id: I1291e0a2971ad51fef4bc4a2d53e7ec0a76b3131
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/437221
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
Since the test uses existing system temp directory entries that
aren't created/maintained by the test itself, they may be removed
between the two calls to statSync(). Modify the test to allow for cases
where the first statSync() returns a non-notFound result and the second
returns a notFound result.
Also check that at least one iteration of the loop had a successful
result where the statSync() result is the same for both and was not a
notFound result, as all system temp entries retrieved by listSync()
being removed before one or both statSync() calls is highly unlikely.
TEST=standalone/io/file_windows_test
Fixes: https://github.com/dart-lang/sdk/issues/61007
Cq-Include-Trybots: luci.dart.try:vm-win-release-x64-try
Change-Id: If4bb4a6f6b1e21558e447e4e5a918523c69ff044
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/437442
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Previously, `attachFinally` took advantage of
`Reachability.rebaseForward` to compute reachability after a
`try/finally` statement. This was overkill, since
`Reachability.rebaseForward` contains special logic to account for
widely diverging reachability stacks, whereas `attachFinally` always
deals with reachability stacks that have an immediate common parent.
This change adds an assertion to verify that the reachability stacks
always have an immediate common ancestor, and replaces the call to
`Reachability.rebaseForward` with the equivalent direct logic.
Making this change will simplify the process of writing a spec for
flow analysis.
Change-Id: Icd7d3ebc150d1836932efe3891b3ea1077134351
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/437300
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
The reports the declaration conflicts through the _Declaration objects,
which streamlines the code and helps providing more targeted messages.
Change-Id: I013c9974de87c5a1c541ba6aa5d78a1ba63e1074
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/437241
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Before an assist call on a file with non-windows lineendings would first
search through the entire file for Windows line endings, then search for
the non-Windows line endings. As such Windows line endings was faster.
This CL changes the semantics slightly from "Windows line endings if
any Windows line endings exist" to "whatever line endings are first
used" which should be good.
It speeds up assist calls with non-Windows line endings:
Statistics on 5 runs each:
```
Windows / 2000: No change.
Windows / 4000: No change.
Windows / 8000: No change.
Unix / 2000: 1000 assist calls: -46.9900% +/- 6.1715% (-0.88 +/- 0.12) (1.86 -> 0.99)
Unix / 4000: 1000 assist calls: -59.1561% +/- 6.3982% (-1.79 +/- 0.19) (3.03 -> 1.24)
Unix / 8000: 1000 assist calls: -63.8429% +/- 4.3083% (-3.68 +/- 0.25)(5.76 -> 2.08)
```
Change-Id: I61278ed4ad31b891e87951da0a6162fe37376888
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/437224
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
The two pieces of information we're tracking are
- the number of libraries in each library cycle
- the number of lines of code in each library cycle
The data is reported in terms of percentage.
This doesn't give us any way to correlate the two values. Knowing that
there is a library cycle with M libraries and a cycle with N lines of
code, doesn't tell us whether it's the same library cycle in both cases.
Still, I think it will help us understand the nature of the code that
we need to be able to analyze quickly.
Change-Id: I36a8bf11c4c6fdced6c524225be7a633062351ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/437126
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
By default the integration tests spawn the server using the snapshot from the active SDK. If you forget to recompile the SDK when running the integration tests, you may get inaccurate results.
One option is to set the `TEST_SERVER_SNAPSHOT` env variable to `"false"` which will run the tests from source, however using the "Run All Tests" command in VS Code will result in a lot of timeouts because tests run concurrently and each one will cause a compilation.
This change instead creates a new VS Code task that will compile the server to a temporary file in `.dart_tool`, and creates a launch configuration that triggers this task (via `preLaunchTask`) when running integration tests. This supports both running all tests (with the "Run All Tests" command) or running individual integration test files, with just a single up-front compilation.
Change-Id: I0970ffb76240abd54ff2c8a9c9be4bab40693691
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/436341
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
The diff makes this change look bigger than it is.
Here's how the code worked before: `compute()` called `_addFromProducers()`. `_addFromProducers()` had a local function, also
called `compute()`, which is called per CorrectionProducer. The local
`compute()` function would unconditionally create a ChangeBuilder and
call each CorrectionProducer's `compute()` method, then call back out
to an instance method called `_addFixFromBuilder()`, which would drop
the computed change on the floor if `fixKind` was `null`.
This CL contains the following changes to the above system:
* The local `compute()` function and the instance method,
`_addFixFromBuilder()` are combined together, into one instance
method, `_addFromProducer()`.
* Then, the `fixKind` check is moved to the very top of that
method, bailing out _before_ computing changes if `fixKind == null`.
Change-Id: I6c61059fc36ec1587b15ca01b43830a5b179da9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/417326
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
While doing specification work for flow analysis, I noticed that in
circumstances where a flow model needs to have both the `split` and
`conservativeJoin` operations applied to it, sometimes flow analysis
applied `split` first, and sometimes it applied `conservativeJoin`
first.
The actual order doesn't matter, since `split` only affects the flow
model's reachability, and `conservativeJoin` only affects the flow
model's variable info. But for the purpose of making the specification
clearer, it's nice to be consistent. This change adjusts the order so
that `split` always happens before `conservativeJoin`.
Change-Id: Ia5dfc9335ee85f122ae274f6bb850f83f12b88d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/437060
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Profiler does not allow 2 distinct Bytecode objects to use the same
range of bytecode, as it needs to map PC to a Bytecode unambiguously.
So this change removes reuse of the field initializer bytecodes for
a field getter (in case of const fields).
TEST=pkg/vm_service/test/get_perfetto_cpu_samples_rpc_test
Change-Id: I758286f6f4fcfe2e2169bbc19ae233594e263522
Cq-Include-Trybots: luci.dart.try:vm-aot-dyn-linux-debug-x64-try,vm-aot-dyn-linux-product-x64-try,vm-dyn-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/436740
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
This CL introduces an `IsolateData::asset_base_path` which contains
the fully resolved base path used for assets which are loaded with a
relative path. (Resolving both PATHEXT and symlinks.)
The asset base path is now only resolved once, instead of on every
relative asset load.
The asset base path is now eagerly resolved.
To prevent existing error messages for files not existing changing in
`dartdev` and `Isolate.spawnUri`, files not existing errors are
ignored.
To prevent `tests/standalone/io/named_pipe_script_test.dart` from
failing, failing to canonicalize a file path is treated as no asset
base path rather than reporting a failure.
TEST=pkg/dartdev/test/native_assets/*.dart
Bug: https://github.com/dart-lang/sdk/issues/60946
Change-Id: I79a9144d220dfb3e54311725d41f8f91c88db3a1
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-linux-release-try,pkg-mac-release-try,pkg-mac-release-arm64-try,pkg-win-release-arm64-try,pkg-win-release-try,vm-aot-dyn-linux-debug-x64-try,vm-aot-android-release-arm64c-try,vm-aot-linux-debug-x64-try,vm-aot-mac-debug-arm64-try,vm-aot-win-debug-arm64-try,vm-aot-optimization-level-linux-release-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-msan-linux-release-x64-try,vm-asan-linux-release-x64-try,vm-linux-release-x64-try,vm-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435421
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Migrate hand-rolled _writeXxxFragment helpers to the shared _writeTemplateFragment. This eliminates duplicated serialization logic (ID / name / offset / modifiers), shrinks the code base, and makes it easier to add new fragment types without boiler-plate.
Removed flags from `bundle_reader` and `bundle_writer`, will remove flag classes in the future as they will be replaced with reading/writing modifiers.
Change-Id: I79aabd1e94bfa831d6718bb2889a6a00e6561112
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/437102
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
E.g. when sending 2000 results to a completion request, sending (json
and utf8 encoding) can be a very big part of the cost and it's very
confusing having it attributed to "self" in "request".
Also `mapSuggestions` looked much cheaper than it was because it used
`run` instead of `runAsync`.
Change-Id: Ifd219adb25fa658930548536eb8eb46276acd4a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/436922
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Replace eight bespoke implementations for reading fragments with the existing `_readTemplateFragment()` method.
This enforces the consistent use of the template method design pattern, reduces code duplication, and makes future maintenance easier.
Change-Id: If213b146e4b055523432c6d12f36994cac8f38c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/436820
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>