Commit graph

99073 commits

Author SHA1 Message Date
Nate Biggs df5a3d8678 [dart2js] Fix dump-info tests by starting indexing at 0 instead of 1.
Also should cache on `serializedId` rather than just the `name`.

Change-Id: I16e095fea5f320d39d55374ce354b9302c3a1e75
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346024
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2024-01-12 21:51:51 +00:00
Srujan Gaddam d0e3d48172 Update DEPS to package:web 0.4.2
Change-Id: I7f3f3fdde23e1e43a2cf341c7fed786bacbad09b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346080
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
Auto-Submit: Srujan Gaddam <srujzs@google.com>
2024-01-12 20:53:08 +00:00
Jake Macdonald e04801ee0e fix executor_test.dart
Change-Id: Ia90bd8def75589605c1a6d0fc73adfc05201255b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346023
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2024-01-12 20:17:43 +00:00
Nicholas Shahan 95cad9c8a6 [ddc] Fix semantics of capturing loop variables
Fixes the for loop lowering to JavaScript when there are function
expressions in the loop initialization, condition, or updates.

Manually assign source mapping information on js_ast nodes to 
make stepping in the Dart debugger make as much sense as possible.
With these mappings three steps are required on each loop variable 
on each iteration but it ensures that the mapping always points to the
variable instead of some random line of code in or around the original
for loop.

Fixes the failure on language/loop/for_variable_capture_test.

Issue: https://github.com/dart-lang/language/issues/3539
Change-Id: I755b88faef11804986fb3d1b2c328da3dd08fe8d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345145
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2024-01-12 20:04:52 +00:00
Paul Berry 973eca72f5 Fix handling of extension types in relational patterns.
In https://dart-review.googlesource.com/c/sdk/+/345082, type erasure
was added to the handling of relational patterns, to address some co19
failures, e.g.:

    extension type const BoolET1(bool _) {}
    const True1 = BoolET1(true);
    String testStatement1(bool b) {
      switch (b) {
        case == True1:
	  ...
      }
    }

This was failing because the type of `True1` (`BoolET1`) is not
assignable to the argument type of `operator==`, which is
`Object`. (This is because extension types do not, by default, extend
`Object`; they extend `Object?`).

Adding type erasure elimited the co19 failure, but it caused other
code to be allowed that shouldn't be allowed, such as:

    extension type const E(int representation) implements Object {}
    class A {
      bool operator <(int other) => ...;
    }
    const E0 = E(0);
    test(A a) {
      if (a case < E0) ...;
    }

This shouldn't be allowed because the type expected by `A.<` is `int`;
allowing `E0` to be passed to this operator breaks extension type
encapsulation.

The correct fix is for assignability checks for `operator==` to use
`S?` rather than `S`, where `S` is the argument type of
`operator==`. This is consistent with the patterns specification, and
it ensures that `== null` and `!= null` are allowed, while continuing
to prohibit relational patterns that break extension type
encapsulation.

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

Bug: https://github.com/dart-lang/sdk/issues/54594.
Change-Id: Id090f432500d75ba694383f1788d58353cd1fc72
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345860
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2024-01-12 19:31:40 +00:00
Greg Spencer e49f1ccbbe Fix the way that DartFileEditBuilder handles imports
It also handles imports a little better than it used to: it will replace an import that has the same URI and prefix with an updated one with appropriate show and hide combinators.

Bug: https://github.com/dart-lang/sdk/issues/54496
Change-Id: Ib53275f2d58c19085fe02cb83267c8dc0c23838b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344940
Commit-Queue: Greg Spencer <gspencer@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Greg Spencer <gspencer@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2024-01-12 19:30:12 +00:00
Devon Carew a246fbb9cb [docs] update dart:html template files
Change-Id: I6084ba14a903945372b67f5e066ed6ed7d4e2969
CoreLibraryReviewExempt: doc only change
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345741
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
2024-01-12 18:17:13 +00:00
Nate Biggs 06adfb8d6b [dart2js] Fix resource usage of binary to json converter tool.
Improves binary -> json conversion from >900s to ~52s for a large program.

This change contains 2 major fixes:
1) Make element name deduping be O(1) rather than O(n) by using a hash map. I didn't calculate how many duplicated names there were but this change improved the runtime of the conversion process by ~10x.

2) Use chunked string writing for the json encoding/file writing process. By doing chunked conversion with buffered writes we avoid having the entire JSON blob in memory and fewer midsized write operations end up being faster. Without this the program took ~87s for the same large program.

Change-Id: I2d3cddbbb96895b68086fce2256937d567beff11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345940
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
2024-01-12 17:11:51 +00:00
Paul Berry c46b63d2c7 Disable legacy code support in the analyzer.
Before this change, the analyzer supported analyzing legacy code if
the (somewhat confusingly named) global variable `noSoundNullSafety`
was set to `false`. This was used to support legacy code while google3
was still migrating to null safety.

Now that the internal migration process is complete, the analyzer no
longer needs to support legacy code. As a first step in removing that
support, this change removes the `noSoundNullSafety` flag and all the
unit tests that made use of it.

From this point forward it will not be possible to use the analyzer to
analyze code that has a Dart language version less than 2.12.

Change-Id: Idce4b271d1cfc43d25251b7a899259d62b421caf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345365
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-01-12 17:05:58 +00:00
pq 8b7e1a1379 associate analysis options with FileState instances
Preliminary to https://github.com/dart-lang/sdk/issues/54124.

Next step will be to update all lookups to use this new getter.


Change-Id: Ib4a0234ffc8badf906eee4fbd8c363ef4a25adac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345745
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-01-12 17:03:48 +00:00
Jake Macdonald d2e490782c add json serializable macro as a language test
Change-Id: Ifabcad0acc361abcba9af20568acc19bd872ddb9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345760
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Morgan :) <davidmorgan@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2024-01-12 16:47:21 +00:00
Alexander Thomas a100968232 [python3.12] Fix syntax warnings in utils.py scripts
Bug: https://github.com/dart-lang/sdk/issues/54306
Change-Id: I3abfac0765721246b59451152d322a111d685644
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346022
Commit-Queue: William Hesse <whesse@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Auto-Submit: Alexander Thomas <athom@google.com>
2024-01-12 16:38:51 +00:00
Tess Strickland a5758a0dc3 [gardening] Assert no errors in CompilerState::TypedListClass.
The assert, which is only triggered if we need to generate
calls to the _nativeGetX/_nativeSetX methods, should be checking for
no error, not that there is an error.

TEST=vm-aot-linux-debug-simriscv64 builds

Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-simriscv64-try
Change-Id: Ie360a067a6432503fa82ca7eb3d5f9281e0579f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346041
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2024-01-12 15:21:23 +00:00
Sergey G. Grekhov f02b05630a [co19] Roll co19 to b5126f0bd51ea0819df8d5c362574f951a564940
2024-01-12 sgrekhov22@gmail.com Fixes dart-lang/co19#2480. Fix typos, add issue numbers (dart-lang/co19#2481)
2024-01-10 sgrekhov22@gmail.com dart-lang/co19#2477. Rename and reorder existing constants tests for match operators before adding new ones (dart-lang/co19#2478)
2024-01-10 sgrekhov22@gmail.com dart-lang/co19#2420. Add null-check-pattern tests for extension types (dart-lang/co19#2475)
2024-01-10 sgrekhov22@gmail.com dart-lang/co19#2119. Add missing experimental flags (dart-lang/co19#2474)
2024-01-10 sgrekhov22@gmail.com dart-lang/co19#2119. Fix typo and improve error messages in Timer tests (dart-lang/co19#2473)
2024-01-09 sgrekhov22@gmail.com Fixes dart-lang/co19#2471. Fix timer constructor tests. Add check for microtasks (dart-lang/co19#2472)
2024-01-09 sgrekhov22@gmail.com Fixes dart-lang/co19#2428. Add `call` member tests for extension types (dart-lang/co19#2438)
2024-01-09 sgrekhov22@gmail.com Fixes dart-lang/co19#2449. Update positions of analyzer expected errors (dart-lang/co19#2450)
2024-01-09 sgrekhov22@gmail.com Fixes dart-lang/co19#2440. Add asyncStart/End() to Stream interface tests (dart-lang/co19#2457)
2024-01-09 sgrekhov22@gmail.com dart-lang/co19#2420. Add another variable pattern exhaustiveness test (dart-lang/co19#2469)
2024-01-08 sgrekhov22@gmail.com dart-lang/co19#2420. Add constant pattern exhaustiveness tests (dart-lang/co19#2467)
2024-01-08 sgrekhov22@gmail.com dart-lang/co19#2436. Add expected constant evaluation error for CFE (dart-lang/co19#2470)
2024-01-08 sgrekhov22@gmail.com dart-lang/co19#2420. Add null-assert pattern exhaustiveness tests (dart-lang/co19#2468)
2024-01-05 sgrekhov22@gmail.com dart-lang/co19#2420. Add parenthesized pattern exhaustiveness tests (dart-lang/co19#2464)

Change-Id: I86862732cca7c042120bf312403279c2cc10c135
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345960
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2024-01-12 11:23:39 +00:00
Tess Strickland df72359786 [vm/compiler] Convert _TypedList get and set methods to normal methods.
Previously, they were implemented as native methods with special
replacements in the inliner.

Instead, create force-compiled versions of the original inliner
replacements and use those instead of native methods, unless the
flow graph compiler doesn't support unboxing the requested element type.
In that case, the force-compiled version just calls a native method,
and we only keep the native methods that might be needed (that is,
for double/SIMD element access).

Also, revert the change in 26911a6176, since now the _getX/_setX
methods are appropriately inlined instead of failing to inline due
to being native methods.

TEST=vm/dart/typed_list_index_checkbound_il_test

Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-x64-try,vm-aot-linux-release-x64-try,vm-linux-debug-x64-try,vm-aot-linux-release-simarm_x64-try,vm-linux-release-simarm-try,vm-ffi-qemu-linux-release-arm-try
Change-Id: I4840883d1fc12b36a450803da339406bec149044
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/330786
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2024-01-12 10:29:09 +00:00
Daco Harkes ac5e3d38c3 [vm/ffi] Introduce SizedNativeType
Both `sizeOf` and `AllocatorAlloc.call` use the new type as bound.
This prevents runtime errors on trying to call these two static
methods with unsized native types. All tests testing for these runtime
errors have been deleted.

The `NativeTypes` implementing `SizedNativeType` are as follows:
* The native integer types, `Float`, and `Double`.
* `AbiSpecificInteger` and it's subtypes.
* `Struct` and `Union` and their subtypes. The

The `NativeTypes` not implementing `SizedNativeType` are as follows:
* `Void` has no size.
* `Opaque` and subtypes have unknown size.
* `Handle` is considered opaque. Cannot be used as field in compounds.
* `Array` does not carry a size in its type. Can be used as fields in
  compounds with an annotation specifying the size.
* `NativeFunction` is considered opaque. Would have variable size.
* `VarArgs` is only a marker in function signatures.

`Struct`s and `Union`s can have only `SizedNativeType`s and `Array`s
as fields. Documentation for these is in flux in another CL, so we
should update it there.

This CL also replaces a bunch of `extends NativeType` with
`implements` clauses and made `NativeType` itself `abstract`.

TEST=Dart SDK build
TEST=ffi test suite

Bug: https://github.com/dart-lang/sdk/issues/54542
CoreLibraryReviewExempt: VM and dart2wasm feature only.
Change-Id: Ib4f6b58f7204bd063ace20133162798d8c9483e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345221
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-01-12 10:13:39 +00:00
Jens Johansen 7e792e7a8b [kernel/DDC] Fix failing DDC tests; if finding no scope for offset find for a close previous offset instead
When landing https://dart-review.googlesource.com/c/sdk/+/342400
the ddc-mac builder (but not Linux and Windows) started failing.
I could reproduce on Linux though so I'm not sure why those builders
didn't fail (nor why it wasn't caught by the try bot), either way this
fixes the issues:

* Test update: E.g. a breakpoint at the end of the scope doesn't work
  because it will not be inside the (wanted) scope.
* Test update: Evalating "this" now actually works.
* Scope finding update: DDC adds sourcemapping entries for the *end* of
  things so e.g. the getter "c" will have offset and offset+1 added as
  source mappings. When translating from javascript position to dart
  position we might pick that and thus ask for the scope of offset+1,
  but nothing will be found because no node has that offset.
  Here I add a fall-back saying that if we get no results we ask again
  for the nearest lower offset.

Change-Id: I7e4430d9954466494b514cf51d999358483c9f8c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345501
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
2024-01-12 08:21:00 +00:00
Brian Wilkerson 4532e20ec4 Update the coding_style doc
After lengthy consideration, I believe that this is the best policy for
the team overall. It also corresponds to what I thought we had already
agreed to in the past.

Change-Id: I952297bf966ace0bdb105a5e4539420c3c6b8983
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345748
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2024-01-12 05:27:28 +00:00
Nicholas Shahan 1572bb563f [ddc] Delete typeRep() and legacyTypeRep()
Replaces all uses with the equivalent `TYPE_REF()` and 
`LEGACY_TYPE_REF()` because they are used in the shared dart:_rti 
library and there is no need to support both.

Change-Id: I8c04eb12856cf6933a168f3e63351a45cd5d704e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344608
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2024-01-12 00:45:47 +00:00
Nicholas Shahan 1f35476e63 [ddc] Delete compileTimeFlag()
Replaces all uses with the equivalent `JS_GET_FLAG` because it is
used in the shared dart:_rti library and there is no need to support
both.

Change-Id: I4e347d568444caab63e4217845c14353c429cb10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344607
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2024-01-12 00:12:35 +00:00
Ryan Macnak fa7cadde80 [vm, io] Don't have pending Dart_TypedDataAcquire during I/O operations.
I/O can take arbitrarily long, and open interior pointers prevent all other isolates in the group to reaching safepoints.

TEST=ci
Bug: https://github.com/flutter/flutter/issues/140763
Change-Id: I1fa732d0db31500946aee232dc31f5baf324a55e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345746
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
2024-01-11 23:54:59 +00:00
Vyacheslav Egorov aaca6ce34a [vm] Fix running under WSL 1
On WSL 1 trying to allocate memory close to the binary
by supplying a hint fails with ENOMEM for unclear reason.
Some reports suggest that this might be related to the
alignment of the hint but aligning it by 64Kb does not
make the issue go away in our experiments. Instead
just retry without any hint.

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

TEST=manually under WSL 1

Change-Id: I0adf997fbf76e470a57da00f5ce7a26bb50706f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345802
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2024-01-11 22:24:44 +00:00
pq b990bd213d remove unused performance tracking
Change-Id: I4753c140afbeec9d2859bc6f544f0b916932a290
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345742
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-01-11 22:24:11 +00:00
Parker Lougheed 69dc29bc3e [dartdev] Update package:web usage for 0.4.1 release
Fixes https://github.com/dart-lang/sdk/issues/54591

Change-Id: I2469b28a85988c912fabb254ce774e1f83b01313
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345801
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Auto-Submit: Parker Lougheed <parlough@gmail.com>
2024-01-11 21:49:25 +00:00
Dan Chevalier 1efdc2ba36 Adding Dart Tooling Daemon protocol documentation
Change-Id: Ia95abccf1c400a5e2a595b89b961bc4c43f18ef6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345400
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Dan Chevalier <danchevalier@google.com>
2024-01-11 19:49:36 +00:00
asiva e518b8c3be [VM/Runtime] - Do not try to resolve exec path for default namespace
TEST=new test added
Bug:54516
Change-Id: I67b1fe7ee07db342d328e5272ddca5411fd5df28
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345320
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2024-01-11 19:12:52 +00:00
Zijie He 9c7d3e4152 [Fuchsia] Update test-scripts to include https://crrev.com/c/5177940
ffx will change the way product lookup prints out the download url,
but the original solution is less ideal and using json is definitely
better.

So using the latest test-scripts would be a must-have before updating
the fuchsia-sdk.

A drive-by change is to return proc.returncode from with_envs.py.

Change-Id: Ic4589597006226aa7f5b0e557fe1f084ad3a0a74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345567
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Zijie He <zijiehe@google.com>
2024-01-11 19:05:48 +00:00
Konstantin Shcheglov 0b26a96696 Revert "AnalysisDriver. Produce results for all files of a library."
This reverts commit 89bd370e95.

Reason for revert: causes Flutter roll issues.

Apparently https://github.com/dart-lang/sdk/issues/54577 is more serious.

Original change's description:
> AnalysisDriver. Produce results for all files of a library.
>
> Change-Id: I0118ccdbd4a9059eb3809cb3b6a694731621d809
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345363
> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>

Change-Id: I9d7b98fa18a7d19853b03aeec7094f7769bc13f0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345780
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-01-11 19:04:49 +00:00
Ryan Macnak a6edfb5904 [vm] Add tests for missing write barriers in SuspendState suspend and clone.
Bug: https://github.com/dart-lang/sdk/issues/54410
Change-Id: I86f105fcba7ab95f4d526ab0b468822f50b4e62b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345568
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-01-11 18:57:20 +00:00
Kate Lovett 78e5a3dd92 Revert "Update analyze_flutter_flutter.sh"
This reverts commit 28e0ae59ec.

Reason for revert: There is a typo and the script is failing.

Original change's description:
> Update analyze_flutter_flutter.sh
>
> Closes https://github.com/dart-lang/sdk/pull/54576
>
> GitOrigin-RevId: bd0e192a78ac908ee6e47fccd33f1f5651adb259
> Change-Id: I14f1d25d059e618674d73a27dcf5054aff40fe2b
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345584
> Commit-Queue: Slava Egorov <vegorov@google.com>
> Reviewed-by: Slava Egorov <vegorov@google.com>

Change-Id: I38aba29de70a7bb81444e937644d18645b1a74ea
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345740
Reviewed-by: Slava Egorov <vegorov@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
Auto-Submit: Kate Lovett <katelovett@google.com>
2024-01-11 18:32:28 +00:00
Devon Carew 8379b85eab [docs] move several older dart: web libraries into a 'legacy' category
Change-Id: Ie4c3413191c14976f85614fab11ee94830a25aab
CoreLibraryReviewExempt: documentation only change in the web libraries
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345566
Auto-Submit: Devon Carew <devoncarew@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
2024-01-11 18:18:59 +00:00
Danny Tuppeny 1dbe011f89 [analysis_server] Fix LSP snippet choice escaping
We shouldn't escape $ or } in snippet choices because they are not ambiguous - VS Code would show unwanted backslashes.

LSP spec was clarified here: https://github.com/microsoft/language-server-protocol/pull/1868

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

Change-Id: If1134f067a8a73fe5ae678cadfbd2c284913d6c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345661
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-01-11 18:14:29 +00:00
pq e6bf72a30e add option map awareness to FeatureSetProvider
Change-Id: I639825e54f0469d6fc475f7ab25386da7435fea6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345565
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-01-11 17:22:49 +00:00
Paul Berry a129e0e6a8 Migrate linter test void_checks.dart to null safety.
A few test cases had to be dropped because the stronger type system of
null safe Dart would have caused them to be compile-time errors.

Change-Id: I645309c624217ea924d7c24876137e6f8c402a98
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345581
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-01-11 16:43:38 +00:00
Brian Wilkerson 0a543b7a77 Convert generation of completion suggestions for members of a non-static target
Change-Id: Ide80daaaa9abecaeebe402478aee7dc39a0dedaa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345585
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2024-01-11 16:31:41 +00:00
Johnni Winther a866d22f5e [cfe] Show when syntax was unhandled in the error message
This updates the error reporting on incorrectly applied macro
application to show if an unimplemented for syntax was the cause.

This is to help identify when macro tests fail due to missing
implementation.

The CL includes handling of simple list literals in macro
annotations, an issue brought up this kind of error.

Change-Id: I4b6f9f7140c7bc000cfec54acbc6bbfeaf3429a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345662
Reviewed-by: Morgan :) <davidmorgan@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-01-11 15:02:29 +00:00
Tess Strickland 4f77ee4b88 [pkg/vm] Add GEN_SNAPSHOT_FLAGS to the precompiler2 tool.
Additional flags can be passed to the kernel compilation step via the
DART_VM_FLAGS environment variable, but there's no way to specify
additional flags to be passed to the gen_snapshot step. This CL changes
that by also passing the contents of the GEN_SNAPSHOT_FLAGS environment
variable to that step, so the tool can be invoked like:

DART_CONFIGURATION=ReleaseX64 \
GEN_SNAPSHOT_FLAGS="--redirect-isolate-log-to=tmp/graphs.log \
                    --print-flow-graph-optimized" \
pkg/vm/tool/precompiler2 ...

TEST=manual use

Change-Id: Iadc6a888c60ec306799885e49a39568b124a1c10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345660
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2024-01-11 14:22:22 +00:00
Chloe Stefantsova 5cf844ce12 [cfe] Adjust fallback nullability in DOWN for undetermined operands
This is the DOWN-counterpart of
https://dart-review.googlesource.com/c/sdk/+/333825 that addressed a
similar issue for UP.

Closes https://github.com/dart-lang/sdk/issues/54563

Change-Id: I7aac1e8f1a9ca33f7612694b7ebac4f952cf3c1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345680
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2024-01-11 14:05:50 +00:00
Chloe Stefantsova 1eace401d2 [cfe] Use only field values in equality of record constants
Previously the static type of the record literals was also used, which
is incorrect interpretation of the equality on records.

Closes https://github.com/dart-lang/sdk/issues/54491

Change-Id: I12fad33271e53279a3d9c8bcfd2a842ac31988a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344701
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2024-01-11 13:58:47 +00:00
Kate Lovett 28e0ae59ec Update analyze_flutter_flutter.sh
Closes https://github.com/dart-lang/sdk/pull/54576

GitOrigin-RevId: bd0e192a78ac908ee6e47fccd33f1f5651adb259
Change-Id: I14f1d25d059e618674d73a27dcf5054aff40fe2b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345584
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2024-01-11 13:43:46 +00:00
Parker Lougheed e36cca289f [vm/compiler] Expand inlining and const propagation of double.isNegative
TEST=ci

Cq-Include-Trybots: luci.dart.try:vm-aot-linux-release-arm64-try,vm-aot-linux-product-x64-try,vm-aot-linux-debug-simarm_x64-try,vm-linux-debug-ia32-try,vm-linux-debug-simriscv64-try
Change-Id: I586c678ddd69a3e5c1b8ddf97ae3fc781662d192
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/344080
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Auto-Submit: Parker Lougheed <parlough@gmail.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2024-01-11 12:20:56 +00:00
Aravind 8945d1be75 [io] Changed Minimum Limit for Trimming File or Dir Path in Windows
Closes https://github.com/dart-lang/sdk/pull/54536

GitOrigin-RevId: 9d8b1eafac9a6ff88f5277826dff1e51236b661c
Change-Id: Id65f5778a4173be3d253398c0c030d322c1b42df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345201
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2024-01-11 10:53:09 +00:00
Konstantin Shcheglov 89bd370e95 AnalysisDriver. Produce results for all files of a library.
Change-Id: I0118ccdbd4a9059eb3809cb3b6a694731621d809
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345363
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-01-11 03:53:48 +00:00
Kallen Tu 19546dd720 [analyzer] Update 6.3.0 changelog with removed const evaluator.
The CHANGELOG was missing information on the removal of
`pkg/analyzer/lib/src/generated/constant.dart` in this CL https://dart-review.googlesource.com/c/sdk/+/324342.

This CL adds that change to the change log.

Change-Id: Ib8e7276d033cbd89e8eff447d2d96826cc6c9a96
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345349
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-01-10 21:49:48 +00:00
Alexander Aprelev c8c7f8a2a1 [gardening] Clean up deleted tests from stress test list.
Follow-up to 154cf8c52b

TEST=ci

Change-Id: I27262b41d319297c41092a52b00ee06139945cc9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345563
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2024-01-10 21:43:09 +00:00
osama 9329f7bad7 fix tiny typo in lib/io/file.dart
Closes https://github.com/dart-lang/sdk/pull/54562

GitOrigin-RevId: f3b2502c0124f287f3eccc021c5f1623839ae3d7
Change-Id: I6af749c16a5358e910bc883ef1ddfc65c30a0c3c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345369
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2024-01-10 20:46:38 +00:00
pq c88939d597 clarify "context" feature sets in FileStates
As discussed, the "context" prefix was confusing. I'm not sure "default" adds anything so I went with just `featureSet`.

Let me know what you think!

Change-Id: I3e7ca7ac86c3ab7d96f4d4eee34d58904403d2fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345600
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2024-01-10 20:28:25 +00:00
Alexander Aprelev 15d8187fef [gardening] Fix line numbers in service test.
Follow-up to ffdb0a2e19

TEST=ci

Change-Id: I1f1a05c6576d6913b3808fd20a2a3e21e2f6f2ce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345562
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2024-01-10 20:20:51 +00:00
Nicholas Shahan 154cf8c52b [tests] Cleanup remnants of multi-test migration
- Rename some compile time errors tests to end with "error_test.dart"
- Delete runtime tests that no longer perform the operations they
  claim to be testing. In many cases they do nothing at all.

Change-Id: I49c7b50d6628f56641b878635b32dbc0bc016bbb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345345
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2024-01-10 18:35:50 +00:00
Ryan Macnak 8938a7e499 [vm] Ensure the alignment gap is initialized when writing the minimal array truncation filler object.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/54495
Change-Id: Iaa9c5ea6ba7312c7ded70eb1c938d8cbb2488e94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345362
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-01-10 17:51:35 +00:00