Commit graph

99911 commits

Author SHA1 Message Date
Konstantin Shcheglov 81cfa19be6 Update TestCode, change 'rawCode' to 'markedCode'.
In my head "raw" means without markers.
So, the previous naming was confusing.

Change-Id: I54d366cb406f7ba5487ae0bb2a7f800b2fccea84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352985
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-02-22 18:25:09 +00:00
David Morgan 8101536125 [macros] Fix test expectation.
Should have been updated in https://dart-review.googlesource.com/c/sdk/+/352361.

R=jakemac@google.com

Change-Id: Ia49f806a2bd94fb390d652248b970d484f243594
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353760
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Auto-Submit: Morgan :) <davidmorgan@google.com>
2024-02-22 17:22:37 +00:00
Konstantin Shcheglov e0e72c9d3d Macro. Use empty function body, not empty block body for constructors.
Change-Id: I5bda2e1462fbfea97d2b6f7cd9f666373a88d1fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353585
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2024-02-22 17:20:59 +00:00
William Hesse a8b8948288 [io] Move new Windows dependency to libdart_builtin targets
The new library dependency added to File io on Windows should be
added to the libdart_builtin targets, not the downstream
executables, so that Flutter builds that use libdart_builtin
will inherit the dependency.

Follow-up to https://dart-review.googlesource.com/c/sdk/+/335940

TEST=monorepo_build,dart_ci,flutter_engine_ci

Bug: https://github.com/dart-lang/sdk/issues/45981
Bug: https://github.com/dart-lang/sdk/issues/53848
Change-Id: I90407a0d702683cadb4f2d2c57bb6c598b6e052d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353680
Commit-Queue: William Hesse <whesse@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2024-02-22 15:33:45 +00:00
Jonas Termansen c70591b036 Roll benchmarks-internal 3e58fcfa1464..175974d2b43d
175974d2b43dae39c380fc5f7f583a377cd3c11d https://dart-internal-review.googlesource.com/c/benchmarks-internal/+/6560

R=athom@google.com

Change-Id: Ia9ba8c45f71041ead0d85ed256ba24afcda77003
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353720
Auto-Submit: Jonas Termansen <sortie@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
2024-02-22 15:31:47 +00:00
Jake Macdonald e00db2dca2 Add package:macros
- Also adds the public exception APIs to dart:_macros which were missing.

Change-Id: If08bcb8bc60b91eaf08a02140c6d310e7c2e51f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353540
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2024-02-22 15:20:52 +00:00
Jonas Termansen b6aa2976dc [benchmarks] Fix benchmarks warming up incorrectly.
The benchmarks were using a range of antipatterns that did not do what
the authors thought they did. It seems that the authors thought the
warmup method has to run for a while and do the full warmup, but the
truth is that the harness will do that for you by running the warmup
function in a timed loop. Instead these patterns just wasted time by
making the warmup more expensive and complex than needed.

This change just removes the warmup overrides since none of them do
anything positive. This change prepares us for future improvements to
the benchmark harness.

Fixes: b/324874055
Change-Id: Ib7c282123a2151614bc95a105a30e67221f11315
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352022
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2024-02-22 14:38:19 +00:00
David Morgan e680eb4c4f [macros] Tweak diagnostic for unexpected macro implementation exception.
The only expected exceptions at this point are DiagnosticException and MacroException subtypes; everything else is a bug in the implementation.

Tweak the diagnostic to explain that it's due to a bug in the macro. Add the exception message and stack trace as a context message, and a fix hint to contact the author.

Add a language test.

Retry landing with updates to `pkg/analyzer/test/summary/macro_test`.

R=jensj@google.com, scheglov@google.com, sigmund@google.com

Change-Id: Iebc3df784922dcb6ef112ba8d023d5388516373b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352361
Reviewed-by: Jake Macdonald <jakemac@google.com>
Auto-Submit: Morgan :) <davidmorgan@google.com>
Commit-Queue: Morgan :) <davidmorgan@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-02-22 13:53:20 +00:00
Johnni Winther 6ce7ec657e [cfe] Recognize indirect use of macros
When a macro declaration is supplied as dill, the macro api library
is not directly needed by the source libraries. Therefore, in order
to determine whether macro declarations are available, we need to also
look up the macro api library in the dill loader.

Closes #54560

Change-Id: I131d3881f557566871d9e8c9f38c19029637c534
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346000
Reviewed-by: Morgan :) <davidmorgan@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2024-02-22 10:30:31 +00:00
Ömer Sinan Ağacan 8dcedd9edb [dart2wasm] Refactor _Closure.operator == to use the new intrinsics
Change-Id: I6f43b41dea7b5d037193deb095ffee3238b5fcb2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353265
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2024-02-22 09:15:33 +00:00
Johnni Winther dc71c1ee4e [cfe] Support library macro applications
Change-Id: Ia2de239e56072e4fca22964b53dc8e7adcb415a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353264
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-02-22 09:10:38 +00:00
Devon Carew 42f7af2cb9 Bump tar to 6150a0c88d9bd17e3e961593a9a7a9564866e8b4
Changes:
```
> git log --format="%C(auto) %h %s" 0fc831c..6150a0c
 https://dart.googlesource.com/external/github.com/simolus3/tar.git/+/6150a0c Fix analysis on Dart dev
 https://dart.googlesource.com/external/github.com/simolus3/tar.git/+/20f9d03 Update actions automatically
 https://dart.googlesource.com/external/github.com/simolus3/tar.git/+/bca4c64 Update actions dependencies
 https://dart.googlesource.com/external/github.com/simolus3/tar.git/+/545727f Use new web interop for node in tests
 https://dart.googlesource.com/external/github.com/simolus3/tar.git/+/b0679f3 Fix two crashes when reading invalid pax headers

```

Diff: 0fc831c6e9..6150a0c88d/
Change-Id: I68be7cc72ebbd1b25ce440a781f47cd89a7e03d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353501
Auto-Submit: Devon Carew <devoncarew@google.com>
Reviewed-by: Sigurd Meldgaard <sigurdm@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
2024-02-22 08:59:17 +00:00
asiva 58098d3414 [VM/Service] - Launch dds from vmservice code instead of dartdev code
Currently the dds process is being launched from dartdev and
this causes problems when the dartdev commands 'run' and 'test'
are implemented by spawning child processes (this is needed
to make dartdev an AOT snapshot).
This CL attempts to lauch dds from the service isolate code.

TEST=ci

Change-Id: Iad00a17473a630659f15a5c73be0f5385ea35bdd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350688
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2024-02-22 06:22:12 +00:00
Jake Macdonald af17bedd44 optimize Edit.applyList to use a StringBuffer
This is about 30% faster in my tests even on a small library, and ultimately makes it linear instead of n*m or so.

Change-Id: Ia368766a1ee9b06cc7a1b93f0f130e2356a3d7d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353542
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2024-02-21 23:59:26 +00:00
Konstantin Shcheglov 551922e39a Macro. Add a few flag tests after API changes.
After https://dart-review.googlesource.com/c/sdk/+/352540

Change-Id: Ibc56bdb3e4f7129df1c55fcf5a696d570582c02d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353620
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-02-21 23:31:35 +00:00
Ryan Macnak b44cb37f8f [vm] Fix shutdown race with SampleBlockProcessor.
TEST=tsan
Bug: https://github.com/dart-lang/sdk/issues/54963
Change-Id: Ib91488908aa9f751e6759437468c39d1cdb68976
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353502
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-02-21 23:21:51 +00:00
Nicholas Shahan 0231b2ae1f [ddc] Remove more unnecessary code
After the switch to the new type system more code is unnecessary.
- Clean up logic for deferring classes because the new type system
  allows us to flatten the search to just the immediate superclass.
- Delete more `emit<xxx>Type` helper methods.
- Further differentiate emitting a Type vs a reference to a Class.

Fixes: https://github.com/dart-lang/sdk/issues/54745
Change-Id: Ia6e1accb4c9c993967cd5444c18c65938954f7d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348766
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
2024-02-21 23:04:43 +00:00
Nate Biggs 5f02eda731 [dart2js] Clean up modular impacts serialization.
Impact analysis is no longer supported as a standalone phase. All this serialization logic for impacts is therefore no longer needed and is fact unreachable code.

Change-Id: Ifca8b907c5b8b6ad65cdc35b809aef0a8d4975e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353560
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2024-02-21 22:47:17 +00:00
eliasyishak 247c3e147a Reland "Add parameter for analytics instance"
This is a reland of commit 0e5542211c

Original change's description:
> Add parameter for analytics instance
>
> R=sstrickl@google.com
>
> Change-Id: I8ef2fe2c757a7625c2e3aa7eba48513e4c2f4e88
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352561
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
> Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>

Change-Id: Ia4b84fe72e235138c81ca58c32a78859804fafae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353320
Reviewed-by: Kenzie Davisson <kenzieschmoll@google.com>
Auto-Submit: Elias Yishak <eliasyishak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2024-02-21 22:38:50 +00:00
Ryan Macnak 78ff04c098 [vm] Shrink FinalizeBuiltinClasses.
gcc notes it exceeds the default variable tracking limit.

TEST=ci
Change-Id: If96455b91d2ab44a77e458701e5a615feae918a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352984
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-02-21 22:27:47 +00:00
Ryan Macnak 5d5df3009d [vm, gc] Create ordering between the concurrent marker and new page allocation.
TEST=tsan
Bug: https://github.com/dart-lang/sdk/issues/54918
Change-Id: Id5a16f7b86ca675a2cec4c0546b2fd4a0cbd90a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353340
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-02-21 22:21:12 +00:00
Konstantin Shcheglov 1516e87996 Macro. Code optimizer. Update default values, metadata for formal parameters.
Change-Id: Icca6d5c34007512f3265c752aaa8d4e03fb210e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353584
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-02-21 22:19:44 +00:00
Ryan Macnak 639f6735a8 [vm] Don't rely on UB in OSThread::GetCurrentStackPointer.
TEST=ci
Change-Id: Ic0fd502148ed4666140849f9d6e2af3006818b03
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350694
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-02-21 22:13:09 +00:00
Brian Wilkerson 1dba9e917c Deprecate some of the lookUp* methods
Change-Id: Ib26cc923321f8cef3912f5cc4cc01d9d8927666c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353583
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-02-21 22:11:42 +00:00
Danny Tuppeny 3c460923f9 [analysis_server] Bump yaml_edit, remove ignore_diagnostic workaround
This bumps yaml_edit to get a fix from https://github.com/dart-lang/yaml_edit/pull/66 that corrects line endings on Windows.

It removes the workaround that was in the server normalizing these itself.

It also updates the tests to use normalized content to ensure consistent line endings on both platforms.

Change-Id: I096978500b30ca41d38bc9e78dc9bdf3e44474d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353521
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2024-02-21 21:32:32 +00:00
Brian Quinlan b4574904f9 [io] Fix a bug where relative symlinks to directories did not work on Windows.
Also modified `File::GetType` on Windows to correctly report the type of broken links as notFound.

Windows fixes:
co19/LibTest/io/Link/createSync_A04_t08
co19/LibTest/io/Link/createSync_A04_t10
co19/LibTest/io/Link/createSync_A04_t12
co19/LibTest/io/Link/createSync_A04_t14
co19/LibTest/io/Link/createSync_A04_t16
co19/LibTest/io/Link/createSync_A06_t01
co19/LibTest/io/Link/createSync_A06_t03
co19/LibTest/io/Link/createSync_A06_t06
co19/LibTest/io/Link/createSync_A06_t08
co19/LibTest/io/Link/create_A04_t08
co19/LibTest/io/Link/create_A04_t10
co19/LibTest/io/Link/create_A04_t12
co19/LibTest/io/Link/create_A04_t14
co19/LibTest/io/Link/create_A04_t16
co19/LibTest/io/Link/create_A06_t01
co19/LibTest/io/Link/create_A06_t03
co19/LibTest/io/Link/create_A06_t06
co19/LibTest/io/Link/create_A06_t08
co19/LibTest/io/Link/resolveSymbolicLinksSync_A01_t01
co19/LibTest/io/Link/resolveSymbolicLinks_A01_t01


Bug:https://github.com/dart-lang/sdk/issues/53848
Bug:https://github.com/dart-lang/sdk/issues/45981
Change-Id: I3d156f38540089d8adb12dbb79d0477330d9eb07
Tested: updated unit tests plus fixes existing tests
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335940
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2024-02-21 20:20:02 +00:00
Ryan Macnak d67f159332 [vm] Fix using GCC with the sanitizers.
TEST=local
Change-Id: Icb47e2c68e55ae14f806cb421b8d860cda4d1f1c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/350647
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2024-02-21 20:15:15 +00:00
Keerti Parthasarathy 233de26ab4 Add test for augmentations to Type Hierarchy legacy protocol
Change-Id: Ib76f9ec23b0d2270aef5c0b85b7ac72d8cc528e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353580
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-02-21 20:11:59 +00:00
Devon Carew 7c223d8312 [deps] rev async, browser_launcher, dartdoc, http, markdown, protobuf, sse, stream_channel, tools, vector_math, web, webdev, yaml_edit
Revisions updated by `dart tools/rev_sdk_deps.dart`.

async (24266ca..6cdbc41):
  6cdbc41  2024-02-15  Kevin Moore  Update to latest lints, require Dart 3.2 (dart-lang/async#267)

browser_launcher (74a0efe..7956230):
  7956230  2024-02-16  sigmundch  Add extra flags to disable throttling behavior. (dart-lang/browser_launcher#55)

dartdoc (7e171fc..7a9df65):
  7a9df65f  2024-02-20  Parker Lougheed  Add fallback text for sidebar failing to load (dart-lang/dartdoc#3643)
  9bcabb50  2024-02-20  Parker Lougheed  Fix missing left sidebar on extension type pages (dart-lang/dartdoc#3662)
  e8b8faa2  2024-02-16  Sam Rawlins  Include extension types in 'implementers' list (dart-lang/dartdoc#3658)

http (6d9f9ef..ce0de37):
  ce0de37  2024-02-21  Derek Xu  Populate package:http_profile (dart-lang/http#1046)
  75e01f4  2024-02-20  Brian Quinlan  Create a simple WebSocket interface (dart-lang/http#1128)

markdown (c2b8429..d735b0b):
  d735b0b  2024-02-21  Tom Yeh  Fix `#578`: list with checkbox mixed with empty lines (dart-lang/markdown#583)
  6efe141  2024-02-14  Kevin Moore  Migrate example to pkg:web, update minimum required Dart version (dart-lang/markdown#582)

protobuf (a293fb9..f085bfd):
  f085bfd  2024-02-20  Ömer Sinan Ağacan  Fix message_set.dart copyright year (dart-lang/protobuf#912)

sse (af7d8d0..13ec752):
  13ec752  2024-02-20  Kevin Moore  blast_repo fixes (dart-lang/sse#104)
  2830dc9  2024-02-16  Kevin Moore  Support the latest pkg:web, require Dart 3.3 (dart-lang/sse#103)

stream_channel (851336f..e02a5dd):
  e02a5dd  2024-02-16  Kevin Moore  Require Dart 3.3, update and fix lints (dart-lang/stream_channel#100)
  e62706e  2024-02-16  Kevin Moore  blast_repo fixes (dart-lang/stream_channel#101)

tools (2ef7673..9f4e6a4):
  9f4e6a4  2024-02-16  Elias Yishak  Helper to resolve dart version for clients of analytics (dart-lang/tools#233)
  8323b21  2024-02-13  Elias Yishak  New event added for sending analytics within package on errors (dart-lang/tools#229)

vector_math (cb976c7..3706feb):
  3706feb  2024-02-18  dependabot[bot]  Bump dart-lang/setup-dart from 1.6.0 to 1.6.2 (google/vector_math.dart#313)

web (a54a1f0..975e55c):
  975e55c  2024-02-15  Kevin Moore  Add TrustedTypes (dart-lang/web#173)
  0447807  2024-02-15  Srujan Gaddam  Add info on generation conventions (dart-lang/web#171)

webdev (629c632..51b5484):
  51b54843  2024-02-14  Elliott Brooks  Implement `setFlag` for 'pause_isolates_on_start' (dart-lang/webdev#2373)

yaml_edit (2a9a11b..82ab64d):
  82ab64d  2024-02-21  Danny Tuppeny  Fix line endings for inserted maps on Windows (dart-lang/yaml_edit#66)
  6906ac4  2024-02-20  Devon Carew  update the publish workflow (dart-lang/yaml_edit#67)

Change-Id: I246c393586e3d6239925ac3cf3a6a245d86a2bf5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353581
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2024-02-21 20:04:59 +00:00
Konstantin Shcheglov e0c0cab514 Macro. Code optimizer. Update initializers of final fields, when has const constructor.
Change-Id: I7a0097e240c2e54c47e6a24cb07054f656950ea8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353582
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-02-21 19:55:37 +00:00
Alexander Aprelev 35c6cc6234 Reapply "[vm/win] Use wide-character api for local hostname on Windows."
This relands a fix for looking up hostname on Windows in utf8-aware fashion.
Previously this was reverted because the API was only introduced in Windows 8,
making this use of Windows API fail on Windows 7.
With Windows 7 no longer being a target, original fix can be relanded.

BUG=https://github.com/dart-lang/sdk/issues/52701
TEST=manually

Change-Id: I330048c8b92ce805b7bb7e3fa05c88fefe3a30b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353500
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2024-02-21 19:31:58 +00:00
Dan Chevalier ec4dd93848 Fix DTD examples and add specs to ensure their continued function.
Change-Id: Iade096c5d1c619a903a6bca44750e9c0264b74dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352920
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Dan Chevalier <danchevalier@google.com>
2024-02-21 19:05:36 +00:00
Sam Rawlins 692fd4ebb8 linter: Remove unused ConditionScopeVisitor
Change-Id: Ie002ffb6bdaffd8ec3b6332c692b4304bc39cfe6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353060
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-02-21 18:43:17 +00:00
Ryan Macnak eb62be49a6 [vm, io] Assume ProcThreadAttrList functions are available on Windows.
The VM has required Vista since at least cb522bfcd2.

TEST=ci
Change-Id: I6b6d293f1e2821c441482745fef38a07aacf528c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353231
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2024-02-21 18:27:41 +00:00
Konstantin Shcheglov d5cf9dfa99 Augment. Create ConstFieldElementImpl for any 'final' instance fields in classes.
We don't know if there is a 'const' constructor, so we do it for all fields.
If there is no 'const' constructor, we clear 'constantInitializer's.

Change-Id: I123fe318497f074a449dae4e857889989a2563ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353230
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-02-21 17:34:50 +00:00
Sergey G. Grekhov 5e83b53f97 [co19] Roll co19 to 867d139b3169fc131488e893ec1133dc98cc3aa0
2024-02-20 sgrekhov22@gmail.com dart-lang/co19#2496. Add missing part file (dart-lang/co19#2552)
2024-02-20 sgrekhov22@gmail.com dart-lang/co19#2549. Update built-in identifier tests. Add missing ones. Part 2 (dart-lang/co19#2551)
2024-02-20 sgrekhov22@gmail.com dart-lang/co19#2549. Update built-in identifier tests. Add missing ones. Part 1 (dart-lang/co19#2550)
2024-02-19 sgrekhov22@gmail.com Fix dart-lang/co19#2546. Add constant context tests (dart-lang/co19#2547)
2024-02-15 sgrekhov22@gmail.com Fixes dart-lang/co19#2496. Fix co19 tests that became failing after test runner update (dart-lang/co19#2497)
2024-02-14 sgrekhov22@gmail.com dart-lang/co19#1400. Add cascade operator test and more constants tests (dart-lang/co19#2545)
2024-02-14 sgrekhov22@gmail.com dart-lang/co19#2350. Add more factory constructor tests (dart-lang/co19#2543)
2024-02-14 sgrekhov22@gmail.com dart-lang/co19#1400. Add representation variable initialization test (dart-lang/co19#2544)
2024-02-13 sgrekhov22@gmail.com dart-lang/co19#2119. Remove unsupported element from Stream.first/lastWhere tests description (dart-lang/co19#2540)
2024-02-13 sgrekhov22@gmail.com dart-lang/co19#2119. Remove unsupported element from ReceivePort.first/lastWhere tests description (dart-lang/co19#2541)
2024-02-13 sgrekhov22@gmail.com dart-lang/co19#2339. Add more tests for the extension method with the name `type` (dart-lang/co19#2542)
2024-02-12 sgrekhov22@gmail.com Fix dart-lang/co19#2535. Add patterns constants tests for extension types (dart-lang/co19#2539)
2024-02-12 sgrekhov22@gmail.com Fix dart-lang/co19#2485. Update`as` and `is` expressions tests with a function type (dart-lang/co19#2538)
2024-02-12 sgrekhov22@gmail.com Fix dart-lang/co19#2536. Fix use of HINT.UNREACHABLE_SWITCH_CASE (dart-lang/co19#2537)
2024-02-09 sgrekhov22@gmail.com dart-lang/co19#2119. Remove unused code, add issues numbers (dart-lang/co19#2534)
2024-02-09 sgrekhov22@gmail.com dart-lang/co19#2529. Fix failing API core tests (dart-lang/co19#2533)
2024-02-09 sgrekhov22@gmail.com dart-lang/co19#2529. Delete API tests with compile-time errors (dart-lang/co19#2531)
2024-02-09 sgrekhov22@gmail.com dart-lang/co19#2529. Fix and enable Iterable/forEach_A03_t01 (dart-lang/co19#2532)

Change-Id: I03e721d3871d5bf2b9773fbf7ebadb2a1804a111
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353260
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2024-02-21 15:56:27 +00:00
Chloe Stefantsova ec597188e5 [cfe] Address more cases of declaredNullability being overridden
This is a follow-up to https://dart-review.googlesource.com/c/sdk/+/350323

This CL addresses more of the cases where the `declaredNullability` of a type
object is overridden by the overall `nullability`, introducing unexpected
values to the field.

TEST=existing

Change-Id: I4830cd8113604dcc38a01ff09a9c1b2f50e091ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351141
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2024-02-21 15:37:11 +00:00
Paul Berry 4d1c8b09cb Fix context for the RHS of the invocation of an extension setter to match analyzer.
This looks like it was an oversight--previous to this change, there
was zero test coverage for this case.

Change-Id: I4301a3ba90aedce3b0fcd901649c370cba522f4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353280
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2024-02-21 15:10:18 +00:00
Ömer Sinan Ağacan 2da70a8d9e [dart2wasm] Improve closure hash codes
Currently hash code for a closure is the hash code of it's runtime type.

This causes a lot hash collisions in some apps and cause performance
issues.

With this patch we now use captured objects in closures when calculating
hash codes.

The hash codes are now:

- For tear-offs:

    mix(receiver hash, closure runtime type hash)

- For instantiations:

    mix(instantiated closure hash,
        hashes of captured types)

  Note that an instantiation can be of a tear-off, in which case
  "instantiated closure hash" will calculate the tear-off hash as above.

- For others (function literals, static functions), the hash is the
  identity hash.

Fixes #54912.

CoreLibraryReviewExempt: Mark private corelib function as entry-point in Wasm
Change-Id: I6a123fdc690237f543bb8bf832f0f8119d013a55
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353162
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
2024-02-21 14:44:20 +00:00
Sergey G. Grekhov 3b52517bca [test] Add support of dart2wasm.status in co19 tests
Fixes: #54971

Change-Id: I033c8ba78e6cdcf26dce9cae8998308a595a37e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353262
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2024-02-21 14:03:23 +00:00
Johnni Winther d7c868f6a7 [DEPS] Update checked-in SDK
This update the checked-in SDK to a version that includes
fe52b9bfe5
which adds support for `dart:_macros` and `package:macros`.
This is needed in order to move shared macro code from to
pkg/_fe_analyzer_shared/ (a temporary location) to `dart:_macros` and
used from the CFE and analyzer through `package:macros`.

Change-Id: Icba4e19ff654b8a664269c12ac555912eccf42bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353401
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-02-21 13:29:20 +00:00
Paul Berry fa38f392fa Fix context for null-aware extension method invocations to match analyzer.
This looks like it was an oversight--previous to this change, there
was zero test coverage for this case.

Change-Id: Icba1381c389af37ab4fe38f345cc78fe6c01d7f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353226
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2024-02-21 13:13:07 +00:00
Lasse R.H. Nielsen e86b08e5bb Forwards ignore bit to chained-to _Future.
If a target `_Future` is chained to another source `_Future`,
then it's because the target will complete with the same
result as the source future. Instead of keeping both
alive with a listener on the source which completes the target,
instead the target moves all its listeners to be directly on
the source, and keeps a link to the source in case more listeners
are added later.
The idea is that most futures are unreferenced after they have
had their first listener, so the target future has a chance
to be GC'ed.

If the target future has `.ignore()` called, and has no listener,
then the source completing with an error should not cause the
error to be uncaught. Without the optimization, the source would
have had a listener, and the target would ignore the error.

To simulate that, the source now gets a copy of the target's
`_ignoreUnhandledErrors` flag.

This is still not precisely the same as it would be without the
optimization. If *two* target futures are chained to the same source,
and only one of targes has `.ignore()` called, then this
implementation will make the uncaught error not be reported,
where it technically should.

(An alternative would be to *not* use chaining for futures
with `ignore()` called on them. But those are precisely futures
that are likely to be GC'able, because someone has already said
that they don't care if the future complete with errors.)

Fixes #54943

Bug: https://github.com/dart-lang/sdk/issues/54943
Change-Id: I0dbb4919ce2ea612d66539862fa0eb188aab8287
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352908
Reviewed-by: Slava Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2024-02-21 13:05:56 +00:00
Jens Johansen 8a6b48f596 [CFE] First pass at coverage tool
* Added tests for compiling the platform with coverage information
* Patched all CFE suites to be able to capture coverage information
  (e.g. via
  `out/ReleaseX64/dart pkg/front_end/test/fasta/strong_suite.dart \
  --coverage=coverage/` and then merging and showing via
  `out/ReleaseX64/dart pkg/front_end/tool/coverage_merger.dart \
  --coverage=coverage/`)
* Added "meta test" that runs all of the cfe et al tests and captures
  coverage information at the end.
* Patched the bulk compiler to be able to capture coverage information
  (likely only works in non-Windows as it has to hook into signaling to
  be able to capture data as the process is being killed by the test.py
  script).
* Tool for combining the dumped coverage information.
* Meta test that executes everything and combines the result
  (run via e.g. `out/ReleaseX64/dart-sdk/bin/dart \
  pkg/front_end/test/run_all_coverage.dart`)

Initially I wanted to (for language tests) have per-test coverage,
changed the test.py scripts to run the tests through a special tool that
then captured coverage information for the kernel_service isolate which
worked well for tests that compiles without error, but doesn't work when
there are compile time errors (because dart terminates before coverage
can be captured). So the solution - at least for now - was to hook into
the batch compilation.

The "visualization" of the result currently isn't very good -- mostly
just a list of not covered positions -- but the hope is that everything
that should be covered (eventually) will be covered, so maybe it's not a
big deal.

Also still to do is being able to - probably via comments in the covered
code - say "this isn't expected to be covered", so we can work towards
expecting all (or certain) files to be 100% covered (modulo those
comments), e.g. when running the thing on the weekly bot.

Change-Id: I6f885f4a9c04fb52a65797a9de790e1e5eacecf1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353103
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-02-21 12:40:01 +00:00
Jake Macdonald 123e680534 update public macro apis in dart:_macros
Change-Id: Ic27669dee0bbaa96a362e5ecc5fecdd9bb86b693
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353321
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-02-21 12:06:09 +00:00
Chloe Stefantsova 91c54ff06a [analyzer,cfe] Share classes representing type constraints
Part of https://github.com/dart-lang/sdk/issues/54902

Change-Id: Ic441a582bcc43fb5d909ca70f101160512f11afe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352222
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2024-02-21 12:03:14 +00:00
Chloe Stefantsova 1f299666e9 [cfe] Use argument original order for downcasts from dynamic
Closes https://github.com/dart-lang/sdk/issues/54935

Change-Id: Id9e579ba015d19a5fab709e60dfbae77b0980dd5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353402
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-02-21 11:27:23 +00:00
David Morgan cccde729eb [test_runner] Fix static_error_test on Windows.
The path separator in the expect makes it fail; shorten the path, there
is no need for a separator in the test case.

R=whesse@google.com

Change-Id: Ief6078828daa18e1bf552e62ea0d3d4dee70ec84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353400
Reviewed-by: Jonas Termansen <sortie@google.com>
Auto-Submit: Morgan :) <davidmorgan@google.com>
Commit-Queue: Jonas Termansen <sortie@google.com>
2024-02-21 09:46:42 +00:00
Johnni Winther 460e003cac [cfe] Use generateKernelInternal in fasta compile
Change-Id: I578406cd8878778f15f77c33e0d17784f62ea841
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353180
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2024-02-21 09:14:39 +00:00
Sam Rawlins 967d13fb95 frontend: prepare for curly_braces lint change
This aligns this code better with Effective Dart and prepares for the
upcoming lint rule change at https://dart-review.googlesource.com/c/sdk/+/353140.

Change-Id: I4a419c50b851680150d4f17941bc0f94a98cb148
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/353221
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
2024-02-21 07:28:59 +00:00