1
0
mirror of https://github.com/dart-lang/sdk synced 2024-07-03 08:19:13 +00:00
Commit Graph

101744 Commits

Author SHA1 Message Date
Jonny Wang
09e87e6d7b [fuchsia] Update Fuchsia API version to 19
Bug: b/347292659
Change-Id: I16422488566c91b2efc1c06192583eb3937dd4b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372185
Auto-Submit: Jonny Wang <jonnywang@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
2024-06-19 14:50:30 +00:00
Brian Wilkerson
5fc437e6f2 Use shared mock packages in linter
I believe that this removes the last of the mock packages from the
linter. I went ahead and created shared mock packages for everything
supported in 'analyzer' even though the linter doesn't use all of them.

Change-Id: I83a9f83a9c9cca7c6969ffade3d0b11c1ec54fd1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372220
Reviewed-by: Sam Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-06-19 14:07:19 +00:00
Johnni Winther
7ed610de1d [analyzer/cfe] Replace StackListener.importUri with isDartLibrary
The [StackListener.importUri] property is problematic because it assumes
or implies that when a compilation unit is being parsed, the import URI
for the containing library is known. This might not be the case if a part file is read before the main library file.

Currently the [StackListener.importUri] is only used to detect whether
the current file is part of a `dart:` library, so the property is replace with [isDartLibrary] which does just that.

Change-Id: I2d2baf2fe20bb62fd1922864c0e5af95e8fd1ca7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372084
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-06-19 12:47:21 +00:00
Daco Harkes
4f8e65318d [test] isVmAotConfiguration in custom configurations
https://dart-review.googlesource.com/c/sdk/+/352863 standardized AOT
detection in tests. However, this didn't work for custom configs.
This wasn't caught on our CI, as the CI only uses predefined configs.

For custom configurations, fall back on the executable name to
determine the runtime. (Which is what the failing tests in the linked
issue used before the the referred CL.)

TEST=Manually tested.

Closes: https://github.com/dart-lang/sdk/issues/56041
Change-Id: I17ac731d2137020880defd254c3d006b55f7cf29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372260
Reviewed-by: Moritz Sümmermann <mosum@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-06-19 08:49:29 +00:00
Daco Harkes
1a614b1d86 [vm] Move ResolveUri to bin
This CL removes the native assets fallback from the VM.

TEST=pkg/dartdev/test/native_assets/build_test.dart
TEST=tests/ffi/native_assets/asset_relative_test.dart

Closes: https://github.com/dart-lang/sdk/issues/55523
Closes: https://github.com/dart-lang/sdk/issues/55925
Change-Id: Ifc7e491300ae1b65bb5a9e5279cbcb45ad91e165
Cq-Include-Trybots: dart/try:vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-optimization-level-linux-release-x64-try,vm-aot-win-debug-arm64-try,vm-aot-win-debug-x64-try,vm-aot-win-debug-x64c-try,pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-mac-release-try,pkg-mac-release-arm64-try,pkg-win-release-try,pkg-win-release-arm64-try,vm-aot-asan-linux-release-x64-try,vm-asan-linux-release-x64-try,vm-aot-msan-linux-release-x64-try,vm-msan-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370740
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2024-06-19 06:43:33 +00:00
Jens Johansen
5d352e6627 [parser] Add begin and/or end to endElseStatement, endIfStatement, endThenStatement, endTryStatement
Change-Id: I27b7241665042a7fae6dc4c7d4192da9ce141b3e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372081
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-06-19 06:12:00 +00:00
Stephen Adams
0db3b1215c [dart2js] Use patterns for HIndex simplifications
Change-Id: I8a1e888da1d976ae80effc220a41243ff85ee4f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372001
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2024-06-18 23:19:28 +00:00
Alexander Markov
b48008ebd0 [vm] Remove unused dart:math and Double native methods
Flow graph builder implementation of certain dart:math and Double
methods is now used unconditionally, so corresponding native
methods are never used and can be removed.

This is a follow-up to
https://dart-review.googlesource.com/c/sdk/+/371980.

TEST=ci

Change-Id: Ibca2729f70f39af26a899d99724ce62efc3c8dae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372180
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2024-06-18 21:51:16 +00:00
Paul Berry
40661a5876 Use analyzeExpression for recusion in ResolverVisitor.visitAugmentedInvocation.
This change restores the property that the only caller to
`ExpressionImpl.resolveExpression` is
`ResolverVisitor.dispatchExpression`. This is a useful property
because it means that if there's special logic related to type
contexts that we want to be executed every time the resolver recurses
into an expression, we can safely put that logic in
`ResolverVisitor.dispatchExpression`*.

(*Exception: sometimes the resolver recurses into expressions using
`AstNode.visitChildren`, in which case
`ResolverVisitor.dispatchExpression` is bypassed, but fortunately when
this happens, the context is guaranteed to be `_`, so most
context-related logic is irrelevant.)

Change-Id: Ia39c8564014815551266d6b91d0cc102b5768ba8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371181
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2024-06-18 20:54:19 +00:00
Brian Wilkerson
c47df4ce20 Move linter to use shared mock packages for some packages
In particular, this makes it use the mock versions of 'flutter' and
'meta'. The other mock packages it uses aren't yet in the shared
support. I'll add support for them and move the linter over in a future
CL, then in later CLs I'll look at moving the analyzer and
analysis_server packages to the shared versions.

Change-Id: Ib0e272b48332278acf9dcfd4e4d0fc59ba9d29b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371947
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Sam Rawlins <srawlins@google.com>
Commit-Queue: Sam Rawlins <srawlins@google.com>
2024-06-18 20:31:30 +00:00
Konstantin Shcheglov
3b462a3ab9 Augment. Invalid augmentation does not own the name.
Change-Id: I9ae987215256d500f3d6f3bb467fbc69552be7d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372102
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-06-18 19:52:02 +00:00
Devon Carew
3279b0f67d [deps] rev async, dartdoc, http_parser, shelf
Revisions updated by `dart tools/rev_sdk_deps.dart`.

async (a004370..d7c0cd5):
  d7c0cd5  2024-06-17  Kevin Moore  Drop use of pkg:collection whereNotNull() (dart-lang/async#278)

dartdoc (14d33d3..818d1f5):
  818d1f52  2024-06-17  Sam Rawlins  Minor improvement to the 'documentedWhere' comment (dart-lang/dartdoc#3789)
  39591df5  2024-06-17  Sam Rawlins  Pipe the '--stats' flag through for the 'doc sdk' task (dart-lang/dartdoc#3791)
  6b2ee570  2024-06-17  Sam Rawlins  Use 'named' extension in tests (dart-lang/dartdoc#3790)
  fabc394b  2024-06-17  Sam Rawlins  Add more information to various asserts. (dart-lang/dartdoc#3787)
  64982f89  2024-06-17  Parker Lougheed  Update to package:lints v4 (dart-lang/dartdoc#3785)

http_parser (71b4c2c..9bf7bd9):
  9bf7bd9  2024-06-17  Kevin Moore  Prepare release v4.1.0 (dart-lang/http_parser#100)

shelf (4c54af6..2536c15):
  2536c15  2024-06-17  Graciliano Monteiro Passos  `Headers.fromEntries`: using `CaseInsensitiveMap.fromEntries` (dart-lang/shelf#437)

Change-Id: Iff49c7356534f950147b2c0c087e59414a6fc393
Tested: pkg/vm changes are updating test expectations
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372101
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
2024-06-18 19:48:38 +00:00
Alexander Markov
7bd8b3130a [vm/compiler] Make flow graph construction independent of --target_unknown_cpu
Move optimized handling of Double.truncateToDouble, floorToDouble,
ceilToDouble, floor and ceil from flow graph construction to
the canonicalization pass.

This is needed in order to maintain stable flow graphs between
app-jit snapshot training (which is performed with --target_unknown_cpu)
and running from app-jit snapshot without --target_unknown_cpu.

TEST=ci (vm-appjit-*)
Fixes https://github.com/dart-lang/sdk/issues/56018

Change-Id: I7e3e4ce917984f52db239506ea3de0c55af00567
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372140
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2024-06-18 18:53:18 +00:00
Mayank Patke
d430e7ab55 [dart2js] Remove memberContext from getConstantValue.
Change-Id: I3ed4343c7cd2880414a8e99361d8017ca9f756a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372160
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Nate Biggs <natebiggs@google.com>
2024-06-18 18:31:58 +00:00
Sam Rawlins
4f5dc5603f analyzer: Deprecate dead properties on Comment
Work towards https://github.com/dart-lang/sdk/issues/56038

Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: If7ae2738fec598f16756c524b6bd6c258ee5609e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372100
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Sam Rawlins <srawlins@google.com>
2024-06-18 18:27:25 +00:00
Kallen Tu
48cadec309 [cfe] Top level function wildcard parameters are non-binding.
This CL prevents function wildcard parameter collisions and avoids adding function wildcard parameters to scope.

Bug: https://github.com/dart-lang/sdk/issues/55655
Change-Id: I5a8b85ceef15b355f6a36a1d1d19df038980331d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371941
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2024-06-18 18:23:55 +00:00
Konstantin Shcheglov
ddce8d50c4 Macro. Add more details for performance.
Bug: https://github.com/dart-lang/sdk/issues/55784
Change-Id: I2e633eae9f28a6ed053eca762068e8fac7e56c6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372121
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-06-18 18:19:22 +00:00
Sam Rawlins
88e62a23cf Expose CommentToken as analyzer public API
CommentToken is the static type of `Token.precedingComments`:
https://pub.dev/documentation/analyzer/5.13.0/dart_ast_token/Token/precedingComments.html
and so should be exposed as public API.

Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: I06e3e897bf310b9bc0e5067ab0f44db3a3e459c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371946
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Sam Rawlins <srawlins@google.com>
2024-06-18 17:34:27 +00:00
Danny Tuppeny
c001d5116a [analyzer] Prioritize errors in analysis_options/pubspec errors when running "dart analyze"
This changes the (non-machine/json) output of "dart analyze" when there are errors in pubspec.yaml/analysis_options.

Before:

```
Analyzing myapp...

  error • analysis_options.yaml:3:1 • Expected ':'. Parse errors in analysis_options.yaml may result in other incorrect diagnostics. • parse_error
  error • lib\main.dart:1:16 • A value of type 'Null' can't be returned from the function 'foo' because it has a return type of 'int'. • return_of_invalid_type

2 issues found.
```

After:

```
Analyzing myapp...

Errors were found in pubspec.yaml or analysis_options.yaml which may result in other incorrect errors.

  error • analysis_options.yaml:3:1 • Expected ':'. Parse errors in analysis_options.yaml may result in other incorrect diagnostics. • parse_error

Errors in other files that might be caused by those above.

  error • lib\main.dart:1:16 • A value of type 'Null' can't be returned from the function 'foo' because it has a return type of 'int'. • return_of_invalid_type

2 issues found.
```

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

Change-Id: I25ae7b200463f2cd3f2046ea9f5f8ddc5c62cc60
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372080
Reviewed-by: Sam Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-06-18 17:29:16 +00:00
Alexander Markov
0c9067c626 [vm,aot] Preliminary support for dynamic interface in AOT
TEST=runtime/tests/vm/dart/dynamic_module_pragmas_il_test.dart

Change-Id: I6efd24f55726db858711d5f77beabf5659e288a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371563
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2024-06-18 14:31:24 +00:00
Brian Wilkerson
1e5f96514c Remove type cast in completion to prevent exception
Change-Id: If97adc54523894a3b9df241ffb0308ee1299d03d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372020
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-06-18 14:14:19 +00:00
Ömer Sinan Ağacan
3b5065b49e [dart2wasm] Implement unmodifiable JS byte data
18994e6e46 removed unmodifiable view classes in the standard library
that can make any implementation of `ByteData` and other typed_data
types unmodifiable.

Add a `_immutable` field to `JSDataViewImpl`, implement
`asUnmodifiableView`.

An alternative implementation would be adding a subcalss with overridden
setters. However I think a simple boolean flag check should be better,
as adding a subtype can make call sites polymorphic and prevent direct
calls and inlining.

(We can't do the same in native typed_data types because we allocate
Wasm arrays with different element types for the fastest possible
implementation in the common cases, so we need different `ByteData`
implementations for different Wasm array types.)

Bug: #56014
Change-Id: I674121cff14559128bc2a9deb318a3bc6adf316d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372082
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2024-06-18 13:35:50 +00:00
Ömer Sinan Ağacan
baa5aa826a [dart2wasm] Remove a duplicated loop in dart:convert
This removes the outer check in `List<int>` element check:

```
if (allowMalformed) {
   ... check code units in `List<int>`, write 0xFF for invalid bytes ...
} else {
   ... check code units in `List<int>`, throw for invalid bytes ...
}
```

and moves the `allowMalformed` check to the inside of the loop, when the
`int` value is negative or more then 255.

`allowMalformed` in UTF8 is used for two things:

1. To allow invalid bytes in `List<int>` argument.
2. To allow invalid UTF-8 encodings.

Both of these will happen rarely, but (1) will almost never happen as
any code that cares about performance will pass a `Uint8List`. So it
makes sense to assume that (1) will hold very rarely, and optimize based
on that.

Change-Id: I3ecec24d29d1cc2ec8f986a87ac3e7d609002d89
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372060
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2024-06-18 12:35:53 +00:00
Jens Johansen
9b67562b4d Add 'coverage' flag, defaulting to true, but let the gn application_snapshot default it to false
Automatic set coverage when loading snapshot

TEST=Existing tests, manual inspection of reduction in sdk snapshot sizes (see data in comments in https://dart-review.googlesource.com/c/sdk/+/370501)

Change-Id: I044616144c2defeed252a6715eba1abcabffc86d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371700
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2024-06-18 09:10:00 +00:00
Ömer Sinan Ağacan
08ca631673 [dart2wasm] Remove unsafe casts in wasm:_simd
Change-Id: Ie864f441de5a441157c52efeb0e75164bdcf03b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371541
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2024-06-18 08:29:19 +00:00
Danny Tuppeny
d4c2b91a14 [analyzer]/[analysis_server] Handle parse errors in analysis_options.yaml better + tweak unhandled exception text
Fixes the main issues at https://github.com/dart-lang/sdk/issues/55987

Change-Id: I5b86f7c0df4017c02b96e67d8d8d03b71933b318
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371861
Reviewed-by: Sam Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-06-17 23:15:51 +00:00
Stephen Adams
3a91bcb39e [dart2js] SSA - pre-assign variable to reduce phi assignments
Introducing a partial redundancy with a variable with a longer
live-range can reduce the size of the emitted code.

Flute.complex (-O4): -0.377%
cm_shell (-O4): -0.029%

Change-Id: I0d03119b17f4b58d61f277bf8bb0e57d8e7c47c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360360
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2024-06-17 22:47:57 +00:00
Alexander Markov
4d3689138e [vm] Remove obsolete --[no-]unbox_doubles flag
All our target platforms support unboxed doubles and this obsolete
option is no longer used.

TEST=ci

Change-Id: I1d9214b49e875bc52e4f25650dacf8446a2e40a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371980
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2024-06-17 22:45:59 +00:00
Ryan Macnak
6226568fa5 [vm, gc] Separate marking stack by generation.
Allows the scavenger to avoid pruning work, which can be significant if the marking stack becomes very deep.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/55713
Change-Id: Icb6c15d07034bc79573af1bf30f31cbf30c59717
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/369123
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-06-17 21:43:32 +00:00
Kallen Tu
3d42eb5308 [cfe] Change wildcard tests to not use main().
Change main() to test() so we don't need an entry in the status file.

Bug: https://github.com/dart-lang/sdk/issues/55655
Change-Id: I41e6a70ce486279389e4d613f52e9ceb62c8e792
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371783
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2024-06-17 20:22:46 +00:00
Stephen Adams
77496338dc [dart2js] Constant-fold const record accesses
I noticed that dart2js generated poor code for `(a, b) = (1, 2)`.
This is due to an oversight in not constant-folding record field loads.

Change-Id: Iac110d8c3373d7673c21494fc467f7fcb400de1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371505
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2024-06-17 19:47:34 +00:00
Sam Rawlins
8c918ffda3 analyzer: Fix resolution of private extension members
Fixes https://github.com/dart-lang/sdk/issues/45240

Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: Idc054d968c5884dcf6bc876d996c741e8300cab0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371760
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Sam Rawlins <srawlins@google.com>
2024-06-17 18:28:21 +00:00
Devon Carew
334aede0d6 [deps] rev ecosystem, vector_math
Revisions updated by `dart tools/rev_sdk_deps.dart`.

ecosystem (b2b045f..8ada2ee):
  8ada2ee  2024-06-14  Devon Carew  cosmetic updates to the triage bot's github comment (dart-lang/ecosystem#272)

vector_math (3c03ac3..e7b11a2):
  e7b11a2  2024-06-16  dependabot[bot]  Bump dart-lang/setup-dart from 1.6.2 to 1.6.4 (google/vector_math.dart#322)
  4fecc69  2024-06-17  nadaabdelkhalik  fix(typo): correct 'third' to 'fourth' in  quad.dart (google/vector_math.dart#326)

Change-Id: Ie59e0cd4b8b4d3e6bf74ba8d018e3e1b21788539
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371920
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2024-06-17 18:11:29 +00:00
Stephen Adams
26c5de8e96 [wasm] Fix regression in removing Unmodifiable classes
Bug: #56014
Change-Id: I5f9d3e1cb6c123ce50315fdccb90cd9ba4b12761
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371743
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2024-06-17 17:55:14 +00:00
Srujan Gaddam
7a94b5d9a6 [dart:js_interop] Remove unnecessary casts in patch files
In theory, such casts should be optimized out, but in some
cases, they might not be (DDC or lower optimization flags).
Instead, we should use the primary constructor and
representation field to go between the representation type
and the JS type. Similarly, we do unnecessary casts in
dart2wasm to convert JSValue to the right JS type. We can
avoid those by directly calling the primary constructor.

Change-Id: I8fdac18f6d634b379e70951fe5d3a1ed7ad4bf15
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371423
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2024-06-17 17:30:25 +00:00
Brian Wilkerson
dc5954c394 Improve the wording of an error message
Fixes: #43180
Change-Id: Ib8b17e156b81811af4144b54a483f43db1e84771
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371741
Reviewed-by: Sam Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-06-17 15:31:03 +00:00
Brian Wilkerson
a01d45ce82 Improve highlight range for some ffi diagnostics
Fixes: #54181
Change-Id: Ia1e3f5e121fc961bb8cf34cf83827125f4a3e5a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371782
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-06-17 15:25:06 +00:00
Parker Lougheed
041d4ffd6a [analysis_server] Disallow construction/extension of namespaced enumerations
Change-Id: Ic4279ed0c29649b7ad7ece1e190606fe04f2778f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371504
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Sam Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-06-17 15:23:00 +00:00
Danny Tuppeny
d209ea9333 [dtd] Allow passing an explicit port to DTD
Removes the port from `startService()` (which as far as I can see is unused) and parses it from `args` instead.

I had to add support for "options" in the argument classes and switched from a bool flag `isFlag` to an enum to be a bit more descriptive (and be easier to support multi-options in future if required).

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

Change-Id: Ib08513139f58e8845a7c2cbbeeea06787dbc2df1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371840
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Dan Chevalier <danchevalier@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2024-06-17 14:58:19 +00:00
Parker Lougheed
91254e4064 [analyzer/linter] Surface links to available lint diagnostic messages
Dependent on https://github.com/dart-lang/site-www/pull/5914 landing first.

Bug: https://github.com/dart-lang/site-www/issues/4498
Change-Id: I378debd5d484e17f18d59c49173a5d010f05b6df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371785
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Sam Rawlins <srawlins@google.com>
2024-06-17 14:51:31 +00:00
Ben Konyi
56416078a0 [ DDS ] Remove extra stderr.close()
Change-Id: Ice61586e2a60d039987b1e3b5f5f328cc46fb41e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371880
Commit-Queue: Dan Chevalier <danchevalier@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Dan Chevalier <danchevalier@google.com>
2024-06-17 14:44:22 +00:00
Sigurd Meldgaard
f187195224 Bump pub to ddc1c2fd2e2a7cd94a0b92ea033961a25f4ad517
Changes:
```
> git log --format="%C(auto) %h %s" 9ab905a..ddc1c2f
 https://dart.googlesource.com/pub.git/+/ddc1c2fd Bump tar from 1.0.5 to 2.0.0 (4307)
 https://dart.googlesource.com/pub.git/+/3f11cfc2 Fix deprecations (4309)

```

Diff: https://dart.googlesource.com/pub.git/+/9ab905a24e36ef339c99f73bfb6683874feed8ce..ddc1c2fd2e2a7cd94a0b92ea033961a25f4ad517/
Change-Id: I737802583ef189ba4767120b0185acd49aa26b80
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371860
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2024-06-17 13:41:02 +00:00
Johnni Winther
194f076bd5 [cfe] Process imports/exports separately
Since the addition of the OffsetMap, imports and exports no longer
need to be processed by offsets, simplifying their handling.

Change-Id: I98698bf1d8f287046147d2f8ebfb005c5fae4d0e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371403
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-06-17 12:43:51 +00:00
Jens Johansen
b28b49b537 [CFE] Update coverage expect file after VM coverage fix
After VM fix (856139bfc3) the coverage
should be stable.
This CL updates the coverage "expect" file.

Change-Id: Icfcb4e0869ea97232b985f985a79754da3832ebc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371820
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-06-17 11:50:39 +00:00
Jens Johansen
856139bfc3 [VM] Add RecordCoverage to InstanceCall and StaticCall
Before this CL, becase of optimizations, coverage of some of these goes
away, making coverage unreliable.

I believe this fixes the issues for "regular" runs (at least it seems to
be stable on the CFE coverage tests).

If setting `--optimization-counter-threshold=-1` there'll still be
trouble though and we would have to also insert these calls in the start
of FunctionBody and the start of FieldInitializer for it to produce the
same results.

TEST=pkg/vm_service/test/coverage_instance_call_after_optimization_test.dart,pkg/vm_service/test/coverage_static_call_after_optimization_test.dart

Bug: https://github.com/dart-lang/sdk/issues/42061
Bug: https://github.com/dart-lang/sdk/issues/55959
Bug: https://github.com/dart-lang/sdk/issues/56018

Change-Id: I34947f0d4b123e52ce67b71a195782d31e4bda16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370501
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2024-06-17 10:47:58 +00:00
Johnni Winther
47a69d9db6 [cfe] Move SourceLibraryBuilder.parts to SourceCompilationUnitImpl
Change-Id: Id3f4ec4bb107169c8a95b9cc6b8bf8032545c360
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371687
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-06-17 08:26:10 +00:00
Devon Carew
17af09ff47 Bump tar to 552a49d7595e444184d4f91e9afd533aa253a31d
Changes:
```
> git log --format="%C(auto) %h %s" b62573f..552a49d
 https://dart.googlesource.com/external/github.com/simolus3/tar.git/+/552a49d Make `mode` required

```

Diff: b62573f39a..552a49d759/
Change-Id: Ifc9c5ab12a8dd718f47b8cc318a78028784f1225
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371601
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Sigurd Meldgaard <sigurdm@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
2024-06-17 08:03:18 +00:00
Konstantin Shcheglov
51ecf21356 Prepare to publish analyzer 6.7.0 and _fe_analyzer_shared 72.0.0
Change-Id: Idfac92660bac987a6e0576ef6418a5eadee3a98a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371800
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-06-16 17:51:49 +00:00
Keerti Parthasarathy
627cd3047d Hide nonVirtual elements in override completions.
Fixes https://github.com/dart-lang/sdk/issues/55628

Change-Id: I70dcf5b47dae2faef30a47a4e3f811e735a1eeec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/371742
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2024-06-14 23:45:19 +00:00
Alexander Aprelev
4138277ee6 [vm/shared] Introduce 'vm:shared' pragma.
Decorating a field with 'vm:shared' pragma makes values in this field accessible to all isolates in an isolate group.

Introduce `channel` to the `Version` class so that the pragma can only be enabled on main and dev channels.

TEST=shared_test, shared_fail_without_flag_test
BUG=https://github.com/dart-lang/sdk/issues/55991

Change-Id: I843c9f0d2ffc9f2ced7ddc4006bb6f9ca4e2ddf4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/370064
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2024-06-14 23:24:19 +00:00