Commit graph

92643 commits

Author SHA1 Message Date
Srujan Gaddam 16fcfe7eae [dart:js_interop] Remove Object.toJS and JSNumber.toDart
Modifies JSBoxedDartObject reified type on JS backends and also
modifies JSBoxedDartObject.toDart now that a proper box is introduced.
Also uses a JS symbol in JSBoxedDartObject.toDart for a property
check so that different Dart apps don't accidentally share Dart
objects. It's now an error to call this function on non-boxed objects.

Fixes a type issue where creating a new object literal with the JS
foreign function was resulting in dart2js thinking toJSBox would
always throw. Changing the typeDescription to PlainJavaScriptObject
instead of =Object fixes that issue.

CoreLibraryReviewExempt: Backend-specific library.
Change-Id: I5cfb1f32ff4328fafdf9831b0d8da806c39391d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/309082
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2023-07-13 20:38:11 +00:00
Konstantin Shcheglov 1cf1cf3215 Issue 52918. Report -TYPE_PARAMETER_REFERENCED_BY_STATIC for extension.
Bug: https://github.com/dart-lang/sdk/issues/52918
Change-Id: I2c21239c34bf852a1770296491f30d81dd5eb66c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313520
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-07-13 17:53:38 +00:00
Konstantin Shcheglov b4cdba66e2 Remove support for getters that are instances of macros.
https://github.com/dart-lang/language/issues/1890#issuecomment-1625587927
https://github.com/dart-lang/language/pull/3205

Change-Id: I20a181a01eab4fef9a8bf6e568745eb2b8e86d6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312881
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-07-13 17:32:49 +00:00
Sam Rawlins dea256c9fc Mark private classes which are annotated with @JS as used
Work towards https://github.com/dart-lang/sdk/issues/52835

Change-Id: I300928dbfcfd819e4a9f20030cb46e2048f504e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313287
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-07-13 16:06:12 +00:00
Jonas Termansen 185aa1f36f Balance dart2js-linux-chrome shards.
Bug: b/290617138
Change-Id: If6217e2774dd7a6fe2834e64d3a9daf10eebda0d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313486
Reviewed-by: William Hesse <whesse@google.com>
2023-07-13 16:04:24 +00:00
Jonas Termansen 073ffa0ca9 Balance dart2js-hostasserts-linux-d8 shards.
Bug: b/290617138
Change-Id: Icef886185e300f4555207463d90ac5ae8f24baf1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313485
Reviewed-by: William Hesse <whesse@google.com>
2023-07-13 16:00:54 +00:00
Danny Tuppeny 4d34d7aa24 [analysis_server] Remove unused parameters and related TODOs
Change-Id: I5b3fac0efa23c9e535635651a8e8b09398770a40
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313504
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-07-13 15:57:47 +00:00
Jonas Termansen 21c18eb046 Balance analyzer-linux-release shards.
Bug: b/290617138
Change-Id: Icd9fef5b7462fcebe92a6ff4af946b225be889e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313484
Reviewed-by: William Hesse <whesse@google.com>
2023-07-13 15:51:41 +00:00
Joshua Litt 465d35fac9 [dart2wasm|js] Add support for JS backed subtypes of 64 bit typed data.
Change-Id: I534e946ffdfa6708af0c0ffdecb345adbc9561aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313286
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2023-07-13 15:29:37 +00:00
Jonas Termansen 172f76ce8c Balance front-end-nnbd-linux-release-x64 shards.
Bug: b/290617138
Change-Id: Ief19c6f377ad35f4cc8a681a7f471ddc0075ff2b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313502
Reviewed-by: William Hesse <whesse@google.com>
2023-07-13 14:12:56 +00:00
Daco Harkes a08e829ff2 [tool] Bisection tool
A basic bisection script.

Currently only supports substring matching for detecting the error.
This was enough for three use cases today:

* https://github.com/dart-lang/sdk/issues/52910
* https://github.com/dart-lang/sdk/issues/52911
* https://github.com/dart-lang/sdk/issues/52912

Produces a concise output on standard out, and a very detailed log
with all process invocation results in `.dart_tool/bisect_dart`.

Usage: tools/bisect.dart -Dstart=23f41452 -Dend=2c97bd78 -Dtest_command="tools/test.py --build -n dartk-linux-debug-x64 lib_2/isolate/package_resolve_test" -Dfailure_string="Error: The argument type 'String' can't be assigned to the parameter type 'Uri'." -Dsdk_path=/usr/local/google/home/dacoharkes/dart-sdk/sdk/ -Dname=20230712_package_resolve_test

This script starts a bisection in the provided SDK path.

It will write logs to .dart_tool/bisect_dart/.

start          : The commit has at the start of the commit range.
end            : The commit has at the end of the commit range.
test_command   : The invocation of test.py.
                 This should include `--build`.
                 This should be within quotes when passed in terminal because of spaces.
failure_string : A string from the failing output.
                 Regexes are not yet supported.
                 This should be within quotes when passed in terminal when containing spaces.
sdk_path       : The SDK path is optional.
                 The SDK path defaults to the current working directory.
name           : The name is optional.
                 The name defaults to the current date and the recognized test name.
                 The name is used for distinguishing logs.

Change-Id: Ib071a5305d4992cf189e35eb3dcc50c83101503e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313384
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-07-13 13:22:26 +00:00
Jonas Termansen 84e8babf23 Balance dart2js-hostasserts-linux-unsound shards.
The test steps with the same configurations have been unified and
the shard number balanced so each step finishes as closely to each
other as possible.

Bug: b/290617138
Change-Id: I6616fb78e5cd6db36153db0d9e2b45131eef25fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312984
Reviewed-by: William Hesse <whesse@google.com>
2023-07-13 13:09:37 +00:00
Erik Ernst ca71bbb0ea Change formal parameter syntax to require "=" (and not ":")
A named optional parameter could previously be equipped with a default
value using ':' or '=' (as in `void f({int i : 1})` or `... i = 1 ...`).
The language has now (Dart 3.0) been updated to eliminate the form
using ':' (it has been deprecated for a long time).

This CL updates the spec_parser accordingly.

Change-Id: I28f9ec605699a9ffb2f7349a6a4b698fa709247b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313482
Commit-Queue: Erik Ernst <eernst@google.com>
Auto-Submit: Erik Ernst <eernst@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: William Hesse <whesse@google.com>
2023-07-13 12:41:46 +00:00
Tess Strickland 3fcf660ed1 [vm] For now, initialize the contents of null with its address.
When running with `--no-sound-null-safety` turned on, it turns out null
is unboxed as an Mint in some cases without checking for null first.
Before, tests would fail because unboxing it would give a really
large int that was unlikely to be acceptable to subsequent range
checks and the like.

However, since 2f63ace, that memory is now zero-initialized, and zero is
more likely to be an acceptable value, so tests either fail for
unexpected reasons or, worse, unexpectedly succeed.

As a stopgap until the appropriate checks are emitted, we initialize
the contents of null with its address as an ObjectPtr like we used to.

TEST=corelib{,_2}/list_removeat_test on dartkp-* configurations.

Issue: https://github.com/dart-lang/sdk/issues/52910
Change-Id: If456d503c86202616f4f566a402118e9c41194ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313500
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2023-07-13 09:19:57 +00:00
Tess Strickland db2e318b5d [vm] Fix build on debug IA32.
set_pointer_offsets_length() sets a part of the state_bits bitfield,
so we need to move this check before it's called.

Fixes https://github.com/dart-lang/sdk/issues/52923

TEST=vm-linux-debug-ia32 builds

Cq-Include-Trybots: luci.dart.try:vm-linux-debug-ia32-try
Change-Id: I9f4ec78b03a6b7b2d45f13e9cc277411dcc90493
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313480
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2023-07-13 08:59:36 +00:00
Martin Kustermann 148af29811 [vm] Disentagle dependencies in the frontend & compiler
** KernelProgramInfo

The VM can load multiple kernel files into an isolate. Each kernel file
is represented as a [KernelProgramInfo] object. Loading a kernel blob
will result in a tree of objects

  Library
   - TopLevelClass
     + Field
     + Function
   + Class
     + Field
     + Function
       + ... closure functions ...

The entire tree belongs to one [KernelProgramInfo] object. There are
two exceptions
* after a hot-reload we inject [PatchClass]es (as owners of
old [Field]/[Function] objects) that identify the old kernel data
* expression evaluation functions will get a special data array with
information about the expression evaluation kernel data

=> We attach the [KernelProgramInfo] to the root of the tree, namely
  the [Library]

=> We introduce `{Field,Function,Class,Library}::KernelProgramInfo()`
  that will get that object - by walking up the chain.

=> We introduce `UntaggedPatchClass::kernel_program_info_` field that
  allows saving the old [KernelProgramInfo] (on which the old
  [Field]/[Function] objects are based upon) in the [PatchClass].

=> We include the [KernelProgramInfo] in the expression evaluation
  data array.

** Scripts

A [Script] object should represent a .dart source file. It contains the
source, line offsets, etc. of that dart source file. The contents of a
dart source file may be used by many classes/libraries or even many
kernel blobs (e.g. via our copying mixin application).

When we build a tree like above, we'll attach a reference to a
[Script] object to [Class] objects. But members of a class may come from
a different script, in which case we inject an intermediary [PatchClass]
that references that other script.

When the compiler frontend loads kernel, builds flow graph, etc we walk
down the kernel binary (the tree above) - all belonging to the same
[KernelProgramInfo] object, but sub-parts may belong to different
[Script]s.

=> We use the existing [ActiveClass] class that keeps track of the
current class & member inside the class we're operating on.
=> Whenever we need the script we get it from the active member
function/class.

** Misc

We make kernel related classes (e.g. [KernelReaderHelper]) independent
of [Script].

We make the [Script] objects hold on to the [KernelProgramInfo] they are
based upon (e.g. for lazy source reading). But since a given [Script]
doesn't belong to a particular kernel blob (multiple kernel blobs may
contain information about the same script) we don't expose this in the
public API.

=> In the future we could have a unique [Script] object per url (instead
of having several as we do now)

TEST=ci

Change-Id: I7bd698f497b0bd8ab8e546540bb1dad5b5a6dd48
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313381
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2023-07-13 08:17:38 +00:00
Johnni Winther 6d56a75dca [cfe] Ensure default value on super parameter tear-off
Closes #52763

Change-Id: I765c80d9889315a32832e0f881dba1fc41400fad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313124
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-07-13 08:05:50 +00:00
Konstantin Shcheglov 150587d2b5 Merge MethodElement(s) into augmented.
Change-Id: I4965554d33f4345053c2b5abc05ba463a362b641
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313301
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-07-13 05:11:57 +00:00
Samuel Rawlins e718a97882 Revert "Tweaks for mixin inference."
This reverts commit fb9d0e6dc3.

Reason for revert: Performance regression https://github.com/dart-lang/sdk/issues/52922

Original change's description:
> Tweaks for mixin inference.
>
> I started initially with the idea to move 'mixinInferenceCallback'
> to `ClassElementImpl`, but then realized that we do it for enums too.
> So, it should stay in `InterfaceElementImpl`.
>
> I left with code that I think slightly modernized, so decided to
> send it for review.
>
> Change-Id: Ib990392dc4985a71ffba1f4080237872d9a65ad2
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312521
> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>

Change-Id: I33098d8509319e9d6e62d7f5174cae2c05977436
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313440
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Jaime Wren <jwren@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-07-12 22:20:27 +00:00
Ryan Macnak 2051bcf619 [infra] Reduce the suites run by Windows ARM64 to fit under the timeout.
Change-Id: I37070079ddbdc86fb0e5144842690877abb1b031
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313283
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-07-12 21:06:27 +00:00
Kallen Tu c7187d3150 [analyzer] Consolidate more helpers in evaluation_test.
Added helpers `_field` and `_localVar` to allow tests to test their final fields and local const variables in the const tests.

The rest of the CL moves away from `_evaluateConstant` helpers (to avoid recomputing constants), to `_topLevelVar` or equivalent helpers which grabs the existing evaluation result.

This CL adds to the goal making all constant tests consistent and to avoid unnecessary const computations in the tests.

Change-Id: I508483714a51e5d060286256657ae460b65787c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312889
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-07-12 20:02:11 +00:00
Ryan Macnak 3daa47b54e [test_runner] Don't assign all vm/cc tests to the first shard.
Before:
./tools/test.py --shards=10 --shard=1 --list | wc -l  # 3664
./tools/test.py --shards=10 --shard=2 --list | wc -l  # 1047
./tools/test.py --shards=10 --shard=3 --list | wc -l  # 1146

After:
./tools/test.py --shards=10 --shard=1 --list | wc -l  # 1408
./tools/test.py --shards=10 --shard=2 --list | wc -l  # 1306
./tools/test.py --shards=10 --shard=3 --list | wc -l  # 1381

Change-Id: I2107779e79d85976c04db7c01c11581a8d9895b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313280
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-07-12 17:56:59 +00:00
Ryan Macnak 89e24c1aef [vm] Fix assertions in Windows ARM64 feature detection.
TEST=ci (forthcoming)
Change-Id: I3d34ab3af721267f9c586f4a9becdd374455cc76
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313182
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-07-12 17:14:18 +00:00
Daco Harkes 70c186dc37 [gardening][pkg] Fix test expects
The Memory column is right aligned, and we can have large memory values.

`'|  Memory |    CPU | Elapsed time | ...`

Closes: https://github.com/dart-lang/sdk/issues/52915
Change-Id: I47c836ca85109bfa99e293c5c955c416c0f4067d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313382
Reviewed-by: Martin Kustermann <kustermann@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2023-07-12 16:04:38 +00:00
Nate Biggs 64fe77f8db [dart2js] Revert invalid refinement change.
A user found another case where this fails (b/290868787).

In this case a ForwardingTypeMask is delegating the subtyping checks to its `forwardTo` mask which ends up saying the masks are equal even though the wrapper around the forwarded masks means they are not equal.

Change-Id: I015f2faf57557ff4189acb6c7144d09cf1ae6bb6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313341
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-07-12 15:56:09 +00:00
Ryan Macnak d486c52ff6 [vm, gc] Add flag to disable write barrier elimination.
TEST=ci
Change-Id: Ibf1c8afc21c695c1e959ee7463110dd2c37ed846
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311822
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-07-12 15:46:27 +00:00
Danny Tuppeny d718ab5f08 [analysis_server] Extract LSP request helpers to allow reuse in LSP-over-Legacy tests
The mixin `LspAnalysisServerTestMixin` contains a lot of helpers for interacting with the LSP server in tests and is used by both the in-process tests and the out-of-process integration tests.

We now have a third category of LSP tests that would benefit from many of these helpers (such as "getHover()") but are not talking to a native LSP server.

This change splits those helpers out into `LspRequestHelpersMixin` which contains only the request helpers without any code assuming a native LSP server, so they can be used by LSP-over-Legacy tests.

All code in `request_helpers_mixin.dart` was lifted directly from `server_abstract.dart` with no changes.

It also adds a test that error responses in LSP-over-Legacy are handled appropriately.

Change-Id: I847855a5314b5b04d700c6400b67e76e5f0d3402
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313362
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2023-07-12 15:30:15 +00:00
Danny Tuppeny c4105d35db [dds/dap] Support translating VM Instance IDs -> DAP variablesReferences and back for DAP-over-DDS
This adds two custom requests to the DAP-over-DDS handler to translate between VM/DAP instance IDs:

- $/createVariableForInstance (String isolateId, String instanceId)
- $/getVariablesInstanceId (int variablesReference)

Because DAP's variables request only fetches _child_ variables (eg. fields) but we'd likely want to align the top-level string display of a variable, the wrapped variable will first be returned as a single variable named "value", which contains both the string display value and also a variablesReference to then get the child variables (usually invoked when expanded).

These methods currently live directly in the DDS DAP adapter since I figure they're only useful for clients using the VM Service, but we can move them to the base adapter if in future this turns out to not be the case.

Change-Id: I60f28edd86c3468cc592175cb665557a1fc85056
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312987
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-07-12 15:04:20 +00:00
Daco Harkes 4333288aaa [gardening] Declare resources in test
And give test more time in tsan.

Bug: https://github.com/dart-lang/sdk/issues/52917
Change-Id: I1342612470d63233b265dc9063b0335ec8bef760
Cq-Include-Trybots: luci.dart.try:vm-tsan-linux-release-x64-try,vm-aot-tsan-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313383
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2023-07-12 14:02:41 +00:00
Tess Strickland 86d1261dff [vm] Clean up New() methods of Dart classes.
Goals of this CL, a followup to 2f63acea22:

* Ensure that X::New() depends on the initialization guarantees of
  Object::Allocate<X>(...):

  * Ptr fields are guaranteed to be initialized to Object::null().
  * Non-Ptr fields are guaranteed to be zero-initialized.

  In cases where the only uses of the allocated object before return
  was to perform unnecessary field assignments, X::New() just simply
  returns the result of Object::Allocate<X>(...).

  Otherwise, the old now-unnecessary assignments have been changed
  into ASSERTs so that they will be checked in DEBUG mode.

* Ensure that NoSafepointScopes are entered in X::New() only when
  necessary (e.g., to ensure fields used to calculate to(...)
  are properly set before being seen by pointer visitors as the GC
  may run when outside a NoSafepointScope).

  In particular, the often occurring pattern:

  auto& result = X::Handle();
  {
    auto raw = Object::Allocate<X>(...);
    NoSafepointScope no_safepoint;
    result = raw;
  }
  ...

  has been replaced with:

  const auto& result = X::Handle(Object::Allocate<X>(...));

* If a handle was allocated, the only uses of that handle before
  returning must be performed under a NoSafepointScope, and the same
  operations can be done directly on the object pointer, then do so
  and remove the unnecessary handle allocation.

Notable changes outside the above:

* Swapped ObjectPool::EntryType::{kImmediate,kTaggedObject} so that
  kImmediate has value 0, since Object::Allocate<ObjectPool>(len)
  zero-initializes the payload and without this change,
  ObjectPool::New() must set the entry types manually.

* Removed the old static ArrayPtr cached_array_ field on
  SubtypeTestCache as well as SubtypeTestCache::{Init,Cleanup} and
  instead added Object::empty_subtype_test_cache_array().

* Removed the no-arg Closure::New() method, which is never used.

* Inlined the no-arg Script::New() method into its only caller,
  one of the other Script::New() overloads.

TEST=ci

Issue: https://github.com/dart-lang/sdk/issues/52876
Change-Id: I079b4c9f73c7d2c0146c30cf2cd570b91a1ecf36
Cq-Include-Trybots: luci.dart.try:vm-linux-debug-x64-try,vm-linux-debug-x64c-try,vm-linux-release-x64-try,vm-aot-linux-product-x64-try,vm-aot-linux-release-x64-try,vm-aot-linux-debug-x64-try,vm-ffi-qemu-linux-release-riscv64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313120
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2023-07-12 07:37:16 +00:00
Sam Rawlins 23f4145206 Bump linter to 655de5d0dc30cdd1df9ce4cd16bd7489106d987f
Change-Id: I47e731a5be9ddb3c43dbacc16dbf742f4f6c5828
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313300
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-07-12 04:44:37 +00:00
Paul Berry 0c9cf2a10b Field promotion: add a test case to repro #52728.
BUG: https://github.com/dart-lang/sdk/issues/52728
Change-Id: I95be48b923ad84b725eac5099db11207d46a74b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313181
Auto-Submit: Paul Berry <paulberry@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-07-11 23:25:43 +00:00
Ryan Macnak 0ff8d76171 [test] Speed-up slow isolate tests.
- Don't need to repeatedly verify function fingerprints for each isolate.
 - Fix test detecting when it runs under debug mode or a simulator.

Change-Id: Iace0ebc274d4c01561a4b563a420e80535b1ff59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313243
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2023-07-11 22:39:28 +00:00
Ryan Macnak 2a924955e2 [vm] Remove dead VerifyOnTransition.
Dead since b34f11adbd.

TEST=ci
Change-Id: If73b702ea37b68c9f77347ff28fd582dda1e958a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313260
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Auto-Submit: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2023-07-11 22:31:57 +00:00
Liam Appelbe eb6baa33ad [vm] Async callback fast path when on target isolate
Skip creating the temporary isolate if the current thread is already
entered into the target isolate. We can marshall the args and send the
message directly from this isolate.

Bug: https://github.com/dart-lang/sdk/issues/52764
Change-Id: I94a1358ad7d2632b53c122cc38cd5675e6f5ecbc
Fixes: https://github.com/dart-lang/sdk/issues/52764
TEST=CI, specifically async_void_function_callbacks_test.dart
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312351
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-07-11 21:26:48 +00:00
Paul Berry 3ae6793469 Flow analysis: remove redundant assertion from constructor.
The assertion in the `_FlowAnalysisImpl` constructor was unnecessary
because it was checking that all variables that are reported to
`AssignedVariables` as read or written must also be reported as
declared. This is already checked by assertions in
`AssignedVariables.finish`, which is called by the `_FlowAnalysisImpl`
constructor.

I've added tests to `assigned_variables_test.dart` to confirm that
these assertions work, and I've also cleaned up the assertions a bit,
eliminating some redundancy and ensuring that in the event of a
failure the assertion failure message will be comprehensible.

Change-Id: Ife827c91d944707f093f4cb8421385f5355d11fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313140
Auto-Submit: Paul Berry <paulberry@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-07-11 21:03:29 +00:00
Kevin Moore 6709a387c6 nit: sort changelog entries by dart library name
Change-Id: I179d37e459bf697bf4cd4415dfb81e90bd2e3f5d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313220
Auto-Submit: Kevin Moore <kevmoo@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2023-07-11 20:46:55 +00:00
Daco Harkes b64ef27dec [pkg/ffi] Roll dart-lang/native
Rolling https://github.com/dart-lang/native/pull/87 manually because
of the c_compiler -> native_toolchain_c rename.

Change-Id: I2592882a7137a40703f96a487a66d31eac7c990d
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-try,pkg-mac-release-arm64-try,pkg-mac-release-try,pkg-win-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313200
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2023-07-11 19:14:48 +00:00
Konstantin Shcheglov c54b4bc5d3 Push class modifiers up to ClassOrAugmentationElement.
Change-Id: If99d9e29ec8ca87677a58cd90a68a5dda5c5af9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313183
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-07-11 18:45:20 +00:00
Derek Xu f5080bedb3 [VM/Debugger] Fix behaviour of ActivationFrame::EvaluateCompiledExpression when paused inside a closure
TEST=pkg/vm_service/test/evaluate_inside_closures_test.dart, pkg tryjob

Fixes: https://github.com/dart-lang/sdk/issues/52430
Change-Id: I72b755d31614c7c56c504130656c3668d8b7e72b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313001
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-07-11 18:41:04 +00:00
Konstantin Shcheglov 3e80d29fd6 Use AugmentationExecutableElement, AugmentationMethodElement.
These become a single property of ExecutableElement, MethodElement.
No new visitors, no new nodes and elements.

Change-Id: Ic523e9d51356e5a8d2a6cd62cd508344f561ffb0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312960
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-07-11 16:19:09 +00:00
Tess Strickland 03689db708 [vm] Fix the RISCV64 SDK build after 2f63acea.
GCC (used in the RISCV64 build) and clang (used to build other
architectures) have different views of what's visible in the return type
position for an external template method definition. Thus, move the
use into the definition body via constexpr if, which works for both.

TEST=dart-sdk-linux-riscv64-try

Cq-Include-Trybots: luci.dart.try:dart-sdk-linux-riscv64-try
Change-Id: Id7adfd93764ff11d99d3ded4893739b90bb25676
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313123
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2023-07-11 15:47:29 +00:00
Ryan Macnak 453fce9e77 [vm] Enable clang-tidy for arm, arm64, riscv64, product, release, precompiler.
TEST=ci
Change-Id: I319c932a6f4b6e18d7e53b66d69702bf017e4b93
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313060
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2023-07-11 15:13:58 +00:00
Danny Tuppeny 80a6670d5d [dds/dap] Add some basic global evaluation support
This provides support for basic global evaluation matching the legacy DAPs. The first available thread is used (because there's currently no way for the user to select a thread) and we look up a library from a file URI provided in the `context` field.

In future I hope there's a standard DAP way of getting a file from the client (see https://github.com/microsoft/vscode/issues/134452).

See https://github.com/dart-lang/sdk/issues/52574
See https://github.com/Dart-Code/Dart-Code/issues/4636

Change-Id: I7bfa466001142e7e39ebb270ce65f4746a9affcd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312980
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-07-11 15:12:41 +00:00
Martin Kustermann 9a909ac320 [vm] Remove dead lazy reading code of line starts / ...
This was originally added for kbc in [0]. But it seems this is unused
in the kernel frontend.

For performance reasons we may want to implement this at some point
properly but until then let's remove the dead code.

[0] https://dart-review.googlesource.com/c/sdk/+/112680

TEST=ci

Change-Id: Ic4f4edd976c625316f77822a4067763ab31ea3ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313122
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2023-07-11 13:29:33 +00:00
Martin Kustermann 48def8e49a Add CHANGELOG.md notice about change in return type of utf8.encode()
This is follow-up for [0]

[0] https://dart-review.googlesource.com/c/sdk/+/254903

Change-Id: I3f34a752121a369a09a5a8d7bc3c744a25e85642
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312986
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2023-07-11 13:22:18 +00:00
Graciliano Monteiro Passos ab2fe4f5e2 Document the return value of any and every for empty values.
Closes https://github.com/dart-lang/sdk/pull/52847

GitOrigin-RevId: f5382101762582c7d865833e42d9af39fc0a6131
Change-Id: Iafeb53a7e583e0309d08d9dffe3803b7f772b70d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312380
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
2023-07-11 13:05:40 +00:00
Vyacheslav Egorov 4fddaf9486 [sdk] Provide Isolate.resolvePackageUriSync
TEST=augmented few existing tests

Bug: https://github.com/dart-lang/sdk/issues/52121
CoreLibraryReviewExempt: VM-only change, other platforms don't support this API.
Change-Id: I95decae6cf1a5c6ad694747313aa0dbe0a13025d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312981
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-07-11 12:59:33 +00:00
Johnni Winther 0d47ba6890 [_fe_analyzer_shared] Remove RecordStaticType.isSubtypeOfInternal
This method caused invalid exhaustiveness checking by seeing
record types as related based solely on the structure.

The original purpose of the methods has been removed in the mean time
by the change to restrict the created spaces by the matched value
type.

Closes #52800

Change-Id: I8fb581374a4813dc63261d9e1354c4eea94f212c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312982
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2023-07-11 12:19:39 +00:00
fzyzcjy ab2d19c93d Tiny code cleanup: Remove _asyncRunZoned being an alias of runZoned
Closes https://github.com/dart-lang/sdk/pull/52778

GitOrigin-RevId: 025405feaea425604513cf1863a1d3fc9d795292
Change-Id: I70bb5e04996a9f1939571a41e1f41ab0e6c38e6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311157
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
2023-07-11 11:37:57 +00:00