The change is somewhat limited (for example, it doesn't allow the
replacement to be in a different library than the original), but I
believe that it's sufficient for the known use cases and can be extended
in future CLs.
Change-Id: Ic9b2ae42244134f63c36c88f3dc790e3655a7037
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221900
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
So, stop using DeclarationsTracker for it.
Change-Id: Ia53c0729e71ddbc4c9bc19902b21b9d621b2235c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221864
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This CL extracts part of the IncrementalCompiler into subcomponents.
This is part of an effort to make the state and state changes of the
incremental compiler more explicit.
Change-Id: I59cbb30558082f4db392d925bb704d03c31ccb90
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221940
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This replaces the previous implementation (and the topological sort of
classes, on which it was based) which was O(|vertices|*|edges|). The new
implementation is O(|vertices|+|edges|).
Change-Id: I4f5f1e63b4c7dd67d6f17c087724c20d4d33bf83
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221820
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
When ABI-specific integers are introduced, their mappings can be
partial. We need to account for this in the transformation and the code
we generate.
In the transformation, all sizes and offsets become nullable.
In the generated code we add `null` constants and a call to check
whether the value is not-null at runtime.
Note that with only this CL we can not generate nulls yet, because all
size and offset mappings are still complete.
TEST=pkg/front_end/testcases/nnbd/ffi*
TEST=tests/ffi*
Bug: https://github.com/dart-lang/sdk/issues/42563
Change-Id: I80d45f3f52001670bc0679a033f7daa22198d55e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221631
Reviewed-by: Ryan Macnak <rmacnak@google.com>
We're going to extend this logic in subsequent CLs, so lets give this
abstraction its own place to live.
TEST=just moving file contents
Change-Id: Ie6b267e77dd3a772bb3bbf0b79b33946ee767b0e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221630
Reviewed-by: Ryan Macnak <rmacnak@google.com>
I was pretty confused about what was being compared until this change
was able to highlight that no edits were made.
Bug: https://github.com/dart-lang/sdk/issues/47678
Change-Id: I1d37070437658063d4b84f2fb5f4a33923bf5d92
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221840
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
This does not fix#42641, but removes a recursion that can make #42641
look different.
Change-Id: Id070cea0eb10501f1750b2719ed710a938170038
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221480
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
This fixes two issues:
1. When a user navigates into SDK sources using the analyzer (Go-to-Definition) and sets a breakpoint, we map it to a URI that the VM understands
2. When the VM breaks inside an SDK source, we map it back to a local file path (so that the user doesn't end up with two versions of the same file - one downloaded, and one the analyzer sent them to)
Change-Id: Ic1bdbed29196f98e612d81c383ad31ce241446b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221082
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
ReferenceName is used in equivalence testing to match reference
reguardless of whether the reference have associated nodes or
canonical names. The implementation didn't previously account for
fields, getters and setters with the same simple name, and would
wrongfully equate them.
Change-Id: Iacc8e0eb2c5c04a3cf11c3b5104a8f0441cf3ab6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221621
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@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>
Previously when a process emits unexpected content on `stdout` during startup
the `FormatException` was not useful, it would look something like:
```
FormatException: Invalid value in input: 226
dart:convert AsciiCodec.decode
package:dds/src/dap/protocol_stream_transformers.dart 91:28 PacketTransformer._parseHeaders
package:dds/src/dap/protocol_stream_transformers.dart 40:25 PacketTransformer.bind.<fn>.<fn>
```
When the failure comes form the ascii decode, give another attempt at
decoding with utf8 since that is a common character set for tool output.
Use that in the message for the exception to make it more useful for the
reader.
Now the failure will look like:
```
FormatException: Unable to decode headers with ascii. The stream has utf8 content:
Downloading package sky_engine... 472ms
Downloading flutter_patched_sdk tools... 629ms
Downloading flutter_patched_sdk_product tools... 615ms
Downloading linux-x64 tools... 1,782ms
Downloading linux-x64/font-subset tools... 237ms
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Warning
──────────────────────────────────────────────────────────────────────────────
Your Flutter application is created using an older version of the Android
embedding. It is being deprecated in favor of Android embedding v2. Follow the
steps at
https://flutter.dev/go/android-project-migration
to migrate your project. You may also pass the --ignore-deprecation flag to
ignore this check and continue with the deprecated v1 embedding. However,
the v1 Android embedding will be removed in future versions of Flutter.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Content-Length: 518
Content-Type: application/vscode-jsonrpc; charset=utf-8
package:dds/src/dap/protocol_stream_transformers.dart 95:7 PacketTransformer._parseHeaders
package:dds/src/dap/protocol_stream_transformers.dart 40:25 PacketTransformer.bind.<fn>.<fn>
```
Change-Id: I73dcd2e3de53c4af63ddfa0032a171f311be22d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221221
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
This reverts commit 75abd86407.
Reason for revert: Breaks internal tests (http://b/207612278)
Original change's description:
> [ VM / Service ] Omit private fields from service responses by default
>
> Service responses and events previously could include "private"
> properties, which have names starting with "_". This change removes
> these properties from service objects unless explicitly requested via a
> private parameter.
>
> See go/smaller-dart-vm-service-responses for response size reduction
> data.
>
> TEST=Existing service suite
>
> Change-Id: Ia65b14872e798eaa843f7d180c57721b82371d0b
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221143
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I0b015baadfcdf4211426efa9a92804b163f88649
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221280
Reviewed-by: Michal Terepeta <michalt@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Michal Terepeta <michalt@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 is the test from the attempt to allow overlapping edits to be
merged. That work broke some other tests, but I want to record both the
current and ideal behaviors in case I can't get back to fixing it.
Change-Id: Ib41afc37463957ebd710e65847512f91fe47a0f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221180
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Every AOT user out there has been using bare instructions mode
and continuing to maintaining non-bare instructions mode simply
adds costs (both in terms of time spent making changes to work
in a mode that is not used and CI resources spent on testing it).
This change removes FLAG_use_bare_instructions and changes the code
to assume that FLAG_precompiled_mode implies bare instructions.
TEST=ci
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64c-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-dwarf-linux-product-x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,app-kernel-linux-release-x64-try,app-kernel-linux-debug-x64-try
Change-Id: I5032b13bfcb613f79865f2cfa139cca8d1b42556
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220964
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Service responses and events previously could include "private"
properties, which have names starting with "_". This change removes
these properties from service objects unless explicitly requested via a
private parameter.
See go/smaller-dart-vm-service-responses for response size reduction
data.
TEST=Existing service suite
Change-Id: Ia65b14872e798eaa843f7d180c57721b82371d0b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221143
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
HNullCheck is inserted before HGetLength when the receiver might be null.
This makes HGetLength and HFieldGet use the same pattern.
HNullCheck supports strengthening of dominated uses, which allows
specialization of string and array interceptors, leading to better code
in some cases. An example improvement is:
if (aLocale.length < 2)
return aLocale;
return J.substring$2$s(aLocale, 0, 2).toLowerCase();
-->
if (aLocale.length < 2)
return aLocale;
return B.JSString_methods.substring$2(aLocale, 0, 2).toLowerCase();
Here `aLocale` has the type String*, and the explicit null check before
`aLocale.length` strengthens the receiver at the call to `substring`.
There is very little code size change.
The inconsistency between the handling of HFieldGet and HGetlength came
to light when investigating an unexpected difference in Uri.parse between two
apps.
Change-Id: I6e76de2070ab2c0058a109896c738ea2a09b322a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221028
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>