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>
The heuristic was introduced in b870dafa4f, but gets in the way of maintaining Slot(extended with field guard information) immutable during compilation.
Existing set of benchmarks doesn't seem to show any reasonable regression with this heuristic removed.
Bug: https://github.com/dart-lang/sdk/issues/47722
Change-Id: Ie94050d96852b7ffef2dc81248cda23e84d41f4b
TEST=ci
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221544
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@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>
- DartDev is not available on Android.
- DynamicLibrary.process() is not available on Windows.
Change-Id: I6606159168dd01e0fa0b9bc97b5316641123d42b
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-android-release-arm64c-try,vm-ffi-android-release-arm64c-try,vm-ffi-android-release-arm-try,vm-ffi-android-product-arm64c-try,vm-ffi-android-product-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-debug-arm-try,vm-kernel-win-release-x64-try,vm-kernel-win-release-ia32-try,vm-kernel-win-product-x64-try,vm-kernel-win-debug-x64c-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-kernel-precomp-win-release-x64-try,vm-kernel-precomp-win-debug-x64c-try,vm-kernel-precomp-nnbd-win-release-x64-try,vm-kernel-nnbd-win-release-x64-try,vm-kernel-nnbd-win-release-ia32-try,vm-kernel-nnbd-win-debug-x64-try,pkg-win-release-try,dart-sdk-win-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221500
Auto-Submit: Clement Skau <cskau@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
there is no current isolate
Fixes issue #46612
TEST=Existing tests, manual testing
Change-Id: I88e1f7185b0ccaa6dcd73ccae05935af074dcad4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221562
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@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>
The scripts in tools/dom/docs were using Mirrors to
scrape the dart:html related libraries and generate
the docs.json file, which is also used for docs in
generating dart:html. With these scripts being out
of date and our general migration plans for dart:html,
we don't need these scripts anymore. We may still
generate our dart:html documentation in the future,
but it will involve a difference process.
No change to dart:html when running `go.sh`
Change-Id: Ie10af41b5dcff192be8961aa20c1ed493efa4593
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221027
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
This change refactors `_asExternalTypedData` into multiple functions,
which are data type specific, e.g `_asExternalTypedDataInt8`.
These functions are implemented as recognized methods.
Argument checks have previously been performed in the removed
runtime entry implementation of `_asExternalTypedData.` These are
now handled in Dart.
TEST=tests/ffi/external_typed_data_test.dart
Closes https://github.com/dart-lang/sdk/issues/39843
Closes https://github.com/dart-lang/sdk/pull/47780https://github.com/dart-lang/sdk/pull/47780
GitOrigin-RevId: 65763bddd06c633583b4adbf920c32c5a7a3720f
Change-Id: I703b350d89004ebe36e70eaa44dda1d9ebb050c7
Cq-Include-Trybots: luci.dart.try:vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-android-debug-arm-try,app-kernel-linux-debug-x64-try,vm-kernel-nnbd-linux-debug-x64-try,vm-kernel-win-debug-x64-try,vm-kernel-nnbd-mac-debug-x64-try,vm-kernel-linux-debug-ia32-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221360
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
As discovered by @blaugold on GitHub, Instructions::Equals can give a
false negative on the JIT if the GC flags in the object header are set
differently.
This CL changes Instructions::Equals to only compare the
Instructions-specific portion of the object, namely the size_and_flags_
field and the content bytes. If those match, then the important parts of
the object header match: the cid is always kInstructionsCid, as the
Equals method assumes non-null instances, and the size in the object
header is calculated using the content size from size_and_flags_.
TEST=Manually ran failing tests after cherry picking CL 221360 on top.
Bug: https://github.com/dart-lang/sdk/issues/39843
Change-Id: I25c25bbe6b1bf615d4cd923bfe871da7e929822a
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-dwarf-linux-product-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-linux-product-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221467
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
For StrictCompare instructions where one side is the sentinel value and
the other side has a CompileType that cannot be the sentinel, propagate
a false (if EQ_STRICT) or true (if NE_STRICT) constant for that
comparison.
TEST=vm/cc/ConstantPropagator_StrictCompare
Change-Id: I96e4bde1a02fa841987964491c5fff176fdf82a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220769
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This change sets `top_exit_frame_info` and `vmtag` on FFI leaf calls.
We have to set this info on the thread so that the stack walker can
interpret the frame correctly.
Without it, anyone trying to walk the stack during an FFI leaf call
- like the profiler - will misinterpret the top frame and cause
a segfault.
TEST=Added regression test.
Bug: https://github.com/dart-lang/sdk/issues/47594
Change-Id: If83aeab194aa0213aee82558bb9541cd7294a935
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/220360
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
The test will cause a crash inside TSAN - most likely due to a overflow
in TSAN's shadow stack (which has a fixed size). These out-of-bound
writes will corrupt memory causing the failures.
The reduction of thist test:
main() {
final regexp = RegExp(('a*' * 200) + '\u0100*\\w');
regexp.firstMatch('a');
}
will cause a crash when running under TSAN:
% out/ReleaseTSANX64/dart test.dart
zsh: segmentation fault out/ReleaseTSANX64/dart
inside TSAN. It happens in the RegExp frontend which - due to recursive
nature - has very large stack.
TEST=Fixes one false-positive that makes "iso-stress" builder red.
Change-Id: Icabe5b35f8724ef042325e1dfe821d9aba5ea28e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221460
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
The SafepointHandler::IsOwnedByTheThread() is used in a few
ASSERT()/RELEASE_ASSERT() and accesses the [owner_] field
unsynchronized.
Issue https://github.com/dart-lang/sdk/issues/47788
TEST=Fixes one race reported when building TSAN in DEBUG mode.
Change-Id: I64371265d60c9bb68c299d1c1e8abc2175b33bc8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221331
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
TSAN instruments C++ code by adding prologue/epilogue code which
maintains a shadow stack. Using setjmp()/longjmp() is intercepted by
TSAN and correspondingly unwinds the shadow stack.
When Dart VM throws exceptions we call the JumpToFrame stub
from C++ which will directly reset the stack to the exception handler
catch entry. This leaves the TSAN shadow stack unchanged.
This means whenever an exception is thrown we leak frames in TSAN's
shadow stack. Due to using a fixed-size shadow stack, it will cause a
buffer-overflow in TSAN when too many such frame leaks happen. This can
cause arbitrary memory to be overriden, leading to awkward crashes.
This is especially an issue on the "iso-stres" builder because it
launches - in the same process - *many* small tests, more easily hitting
that limit.
This CL will workaround the TSAN issue by making runtime call save it's
state via setjmp() and make exception throughing process go via
longjmp() (which TSAN will intercept) before actually calling the
JumpToFrame stub.
=> This will ensure the TSAN shadow stack is correctly maintained.
The [jmp_buf]'s encoding of register state is non-trivial (e.g. it uses
XOR'ing of the actual saved state under certain glibc versions). So we
store any state we need to pass to the target of the `longjmp()` on the
[Thread] instead of overriding the [jmp_buf]s register state with the
arguments.
Issue https://github.com/dart-lang/sdk/issues/47472#issuecomment-948235479
TEST=vm/dart{,_2}/regress47472_test.dart
Change-Id: I4b6f0d4eacef85487c55999021d72a6d932facad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221083
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
The dart-archive bucket default ACL has been changed to make all
uploaded objects public. Therefore, we no longer need to specify an ACL
on upload. This change enables the scripts to work with uniform bucket
ACLs.
The bucket cannot be switched to uniform ACLs until this change reaches
the stable branch or it won't be possible to release Dart.
This change removes the uses of the gsutil -a public-read option from
the release scripts.
Change-Id: I27a76b9849771ddc380576ffe962926ebfbf4fc6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221341
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Alexander Thomas <athom@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>