Commit graph

90403 commits

Author SHA1 Message Date
Konstantin Shcheglov 814eda8edc Add PatternField.effectiveName
Change-Id: Icbeb5bfa8ee96fbed8f60f8b89ff7bf436579239
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286064
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-03-01 16:59:00 +00:00
Stephen Adams cfa6d0f735 [dart2js] Fix #51558 - skip abstract getters
Improve 'enum switch' optimization to not be confused by abstract
getters.

Bug: 51558
Change-Id: Iac4e5238c1884df6afd1611aecc9f158b1a8b167
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286102
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2023-03-01 16:41:38 +00:00
Alexander Markov ed277908ae [vm/compiler] Unify reading and writing of MoveOperands in IL serialization
TEST=ci

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-nnbd-linux-release-x64-try,vm-kernel-precomp-linux-release-x64-try
Change-Id: I2a0ad11e1264dbef4e23fc7acf9ff9df885b83a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285941
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
2023-03-01 16:09:49 +00:00
Robert Nystrom bbba3c9788 Roll the latest dart_style into the SDK.
This includes support for records, patterns, sealed classes, and class
modifiers. It also includes a fairly small number of style changes. The
one that will be most noticeable is more compact switch statements.

Change-Id: I9e89ba82d52bfa451fc54f9dd59048d72db48377
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285460
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2023-03-01 16:08:40 +00:00
Robert Nystrom 7ca5ad46ce Set tests that have mixin errors as 2.19.
Mark tests that contain errors about using a class as a mixin to use
language version 2.19 where that's not an error.

This may not fix all of the tests because it's the language version of
the library where the class is declared that matters, not where the
class is used as a mixin. But most tests have all of their declarations
in the same library, so this should fix most.

Change-Id: I910439ebd2f10f731418dc588b7e4619a0841c16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285923
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2023-03-01 15:03:39 +00:00
William Hesse ec53fdd0bf Revert "[build, vm] Access TLS with less code."
This reverts commit aa79cf2708.

Reason for revert: -fPIC is needed in more places than the CL adds it to, see CI builds at https://ci.chromium.org/ui/p/dart-internal/builders/ci/dart-sdk-linux-riscv64-dev/405/overview

Original change's description:
> [build, vm] Access TLS with less code.
>
> - Avoid TLS initialization checks by using inline initialization.
> - Avoid global offset table indirection by reducing -fPIC to -fPIE.
>
> out/ReleaseXARM64/exe.stripped/dart_precompiled_runtime
> 11137992 -> 11274776 (-1.21%)
>
> We still need -fPIC in some places because we build a few shared libraries for FFI, so copy some of Fuchsia's GN setup to use -fPIE or -fPIC as appropriate.
>
> TEST=ci
> Change-Id: I6402fce3366a9c4b2741ffb4811562292b8ecb71
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285704
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Daco Harkes <dacoharkes@google.com>

Change-Id: Idacb7869e9fa9ad0f7ed7b0caa2bae19deece7d0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286144
Reviewed-by: Martin Kustermann <kustermann@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: William Hesse <whesse@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2023-03-01 12:19:07 +00:00
Daco Harkes 08b57e0457 [test/ffi] Fix test use RTLD_GLOBAL on Android
Android arm has a different const for `RTLD_GLOBAL` which we take care
of in the helper function `dlopenGlobalPlatformSpecific`. So use that
instead.

Change-Id: Icb5d0b84f7d76ec1f6e24d43a644cffe8f46fd42
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286140
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2023-03-01 10:24:24 +00:00
Daco Harkes cb1b6905ac [vm/ffi] Fix @Natives with VarArgs
This CL fixes the processing of `@Native` annotations to take into
account the native types nested in `VarArgs`.

TEST=tests/ffi/regress_51504_test.dart
TEST=tests/ffi/function_varargs_generated_native_leaf_test.dart
TEST=tests/ffi/function_varargs_generated_native_test.dart

Closes: https://github.com/dart-lang/sdk/issues/51504
Change-Id: Ifb0a08e1e52c9b51cb5143e7ac487a91da4a0e0c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285623
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2023-03-01 09:08:31 +00:00
Vyacheslav Egorov a62f91e5fc [vm] Fix RISC-V build
TEST=dart-sdk-linux-riscv64-try

Cq-Include-Trybots: luci.dart.try:dart-sdk-linux-riscv64-try
Change-Id: I7016b731ca3cb17a3ec260a73d0e399b30a7551b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285907
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2023-03-01 08:38:50 +00:00
Ryan Macnak aa79cf2708 [build, vm] Access TLS with less code.
- Avoid TLS initialization checks by using inline initialization.
- Avoid global offset table indirection by reducing -fPIC to -fPIE.

out/ReleaseXARM64/exe.stripped/dart_precompiled_runtime
11137992 -> 11274776 (-1.21%)

We still need -fPIC in some places because we build a few shared libraries for FFI, so copy some of Fuchsia's GN setup to use -fPIE or -fPIC as appropriate.

TEST=ci
Change-Id: I6402fce3366a9c4b2741ffb4811562292b8ecb71
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285704
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2023-03-01 01:21:55 +00:00
Elliott Brooks 4ac70a3696 Add 'cache-control: no-store' header to DevTools server
Bug: https://github.com/flutter/devtools/issues/3896
Change-Id: I5cfc2e92716517a044a848339426feb827bb64cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286100
Commit-Queue: Elliott Brooks <elliottbrooks@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-03-01 01:13:40 +00:00
Jason Simmons 9c50105dab [js_runtime. js_dev_runtime] Remove redundant copyright notices
Change-Id: Id6d4c334420220a7008441e6cba139ad9674f9cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286023
Commit-Queue: Jason Simmons <jsimmons@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2023-03-01 00:28:48 +00:00
Ryan Macnak c6181a003d Fix building Debian packages for not-x64.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/26953
Bug: https://github.com/dart-lang/sdk/issues/39280
Change-Id: I74f018928b05699335bc19318df2b70eb0ce3282
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280880
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2023-02-28 23:18:07 +00:00
Jake Macdonald 4947481ff6 convert class M to mixin in observatory test
TEST= only test changes

Change-Id: If372c032ed2e84dc4c442c7cae9897b3c8ecc37e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285801
Commit-Queue: Jake Macdonald <jakemac@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-02-28 22:45:14 +00:00
eliasyishak 99658458d8 Updating version for tools package
Change-Id: I4d9b467f4ee7a3c1318ba0fa725dd5e22cde564f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286041
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Elias Yishak <eliasyishak@google.com>
2023-02-28 22:08:43 +00:00
Ryan Macnak 818509b775 [vm] Fix GCC and MSVC builds.
TEST=ci
Change-Id: I0d74db69e044b7a97526d4b8c9ce392a5f69e9d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286040
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2023-02-28 22:06:22 +00:00
Alexander Markov 4de07617b1 [vm] Fix vm/cc/CodeRelocator tests
There is no need to adjust instruction address by Page::AliasOffset()
when copying them to the image, as instructions are still readable
even if dual-mapped. The adjustment can be harmfull if Code is not
properly finalized and instructions in the Code are not replaced
with executable version.

TEST=ci
Fixes https://github.com/dart-lang/sdk/issues/51525

Cq-Include-Trybots: luci.dart.try:vm-linux-debug-x64c-try,vm-win-debug-x64c-try
Change-Id: I4af0ded149f27f6a68d2962805748d1eef6625e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286022
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2023-02-28 21:49:33 +00:00
pq b05cc9442a new test for failing super param comment resolution
See: https://github.com/dart-lang/sdk/issues/51578

Change-Id: Icf000e008f5e04f6ab948b2d226877efa19bfd1a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286080
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-02-28 21:24:35 +00:00
Polina Cherkasova 7491995fd6 Bump DevTools DEP to 2.22.2
Change-Id: If77008721a0182977b44ae699b93405819295ce8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286063
Reviewed-by: Dan Chevalier <danchevalier@google.com>
Commit-Queue: Polina Cherkasova <polinach@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2023-02-28 21:20:27 +00:00
Brian Quinlan 987a45da4a [io] Add a benchmark for the IOSink returned by File.openWrite
Change-Id: Ic27d24633a305d0567c19f3694b1a477b3a1eef2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285706
Commit-Queue: Brian Quinlan <bquinlan@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2023-02-28 20:40:40 +00:00
Danny Tuppeny e231f12420 [analysis_server] Don't endlessly rebuild analysis contexts on PathNotFound errors
Fixes https://github.com/Dart-Code/Dart-Code/issues/4280.

Change-Id: I8f36672dfd5fcca2e4be87408d385219b0a81d9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284660
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-02-28 20:27:43 +00:00
Alexander Aprelev b4fd9ac97f [vm/regex] Ensure CharacterRanges are canonicalized before QuickCheck decision is made.
First, canonicalized CharacterRanges allow for QuickCheck code to be generated, rather than skipped. Second, CharacterRanges could become canonicalized later leading to incompatible instructions generated on a second compilation run, leading to a crash.

Fixes https://github.com/flutter/flutter/issues/121270
TEST=flutter_regress_121270_test

Change-Id: I075986b86b810ede96471bbe5fbe0b337714d215
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286021
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2023-02-28 20:26:58 +00:00
Nicholas Shahan 6c0ab515f2 [ddc] Make references to classes explicit
Avoids conflating the type representation with the actual class
in JavaScript. Here the classes are being used.

Change-Id: I6b84d47b6fbc375aac3fa25746505d71ef208fcb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285885
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-02-28 20:19:39 +00:00
pq c85eecfe9d improve REMOVE_INVOCATION message
Change-Id: Icafeba7b651aef532fe5d3f768a5cc69c5eda99b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286062
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-02-28 20:09:07 +00:00
Konstantin Shcheglov 7b583f2052 Don't report CONST_EVAL_TYPE_BOOL_NUM_STRING for the right operand.
It is not required by the specification.

Change-Id: I65863df55194d441885436b8a811858815a3d957
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286060
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-02-28 20:01:47 +00:00
Nicholas Shahan f0fb9db6c8 [ddc] Remove unused configurations and builders
Cleanup unused `xcodebuild/ReleaseX64/` paths from file sets.

Change-Id: I6c109d693a1dc2bf7b7e095703fdeab7113d89df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/282484
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2023-02-28 20:01:02 +00:00
Konstantin Shcheglov 3091e0d926 Use findElement in Search.classMembers() tests.
It is a bit cleaner than diving into `methods` by index.

Change-Id: I4439d45608612508f96f5abc68c9ac5741531e72
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286061
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-02-28 19:24:52 +00:00
pq 47a524afeb + quickfix for noop_primitive_operations
Change-Id: I458cbe9213c090b8f4c34d9d81c0f1251fa10f03
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285882
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2023-02-28 18:45:30 +00:00
Danny Tuppeny 2d1373bc56 Add missing changelog entry for breakpoint changes
Change-Id: I6fd6683c728226c8885256ba0e2511858931adc4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285910
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-02-28 17:16:49 +00:00
Danny Tuppeny 6bce1b1e7c [dds/dap] Add global variables to scopes/variables requests
Fixes https://github.com/Dart-Code/Dart-Code/issues/4408.

Change-Id: I8a6f7e15f1db247424db23518e53c821d519f1e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285904
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2023-02-28 17:16:49 +00:00
Konstantin Shcheglov bdc1e8bc1f Use textual dumps for FindDeclarations() tests.
Change-Id: I638abde262ce09bb2088197f89188778f945c64f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285960
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-02-28 17:08:59 +00:00
Konstantin Shcheglov fa95f287cd Move two functions into PatternConverter.
Change-Id: I454d66d684e31709ec391c30d1bc344d6d31416a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285707
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-02-28 17:08:47 +00:00
Johnni Winther 032996f45c [_fe_analyzer_shared] Exclude patterns with when clauses from exhaustiveness
Change-Id: I6cc552854139d9476c9b33d93a6d7fdc55e845a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285903
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-02-28 16:55:29 +00:00
Kallen Tu efc9ebb215 [cfe] Change location of mixin class constructor errors.
Change-Id: Ic9484ca8ccadba8f13588e4e7f5fa781344c27b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285881
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-02-28 16:46:29 +00:00
Danny Tuppeny 55cb3ce24b [dds/dap] Add support for breakpoint resolution
Previously we just always sent verified:true for all breakpoints and never handled resolution. This meant breakpoints always appeared verified in VS Code, and did not update to their correct locations when resolved.

This change sends verified:false initially, and then uses the BreakpointAdded/BreakpointResolved events to send verified:true and an updated location as the events arrive.

Fixes https://github.com/Dart-Code/Dart-Code/issues/764.

Change-Id: I5b008bef802bb1c31219175a03498f5015ec4a04
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285909
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-02-28 15:52:31 +00:00
Oleh Prypin 2e01df50e9 Revert "[VM] Begin supporting Perfetto file recorder"
This reverts commit 7424295ce9.

Reason for revert: Causes VM crash in internal tests - b/271081079

Original change's description:
> [VM] Begin supporting Perfetto file recorder
>
> This CL adds the `TimelineEventPerfettoFileRecorder` class, which is a
> timeline recorder that writes a trace to file in Perfetto's proto
> format. This CL supports the recording of all types of timeline events
> except flow events. Support for flow events will be added in a future
> CL.
>
> TEST=Recorded traces with the Perfetto file recorder and explored them
> in Perfetto's trace viewer, CI
>
> Change-Id: Iaa2051e536589a473c5e15f9de9bb9c251f13d38
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278942
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Derek Xu <derekx@google.com>

Change-Id: I1c4b0b78be3748b525b82ea66079dd95d412d82e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285906
Auto-Submit: Oleh Prypin <oprypin@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-02-28 12:41:00 +00:00
Vyacheslav Egorov 27230ae008 [vm/compiler] Split ParallelMove codegen into scheduling and emission
This CL does not contain any changes to behaviour, but simply moves
ParallelMoveResolver to a separate file. Additionally instead of
immediately generating code we produce a move schedule which is
attached to the ParallelMoveInstr and later converted to the
native code.

This refactoring prepares the code for subsequent improvements, e.g.
we want to rework how temporaries used by move resolution are
allocated: instead of pushing/poping them around every move that needs
them we will allocate space for them in spill area.

Having ParallelMove scheduling separated from code emission also
allows to unit test it.

TEST=ci

Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-x64c-try,vm-aot-linux-product-x64-try,vm-aot-android-release-arm64c-try,vm-aot-android-release-arm_x64-try,vm-aot-asan-linux-release-x64-try
Change-Id: Ifeb17940f4cfb3c0cc004cb3f74895f0d3c2b7bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285840
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2023-02-28 12:21:41 +00:00
dependabot[bot] 8f95f78524 Bump github/codeql-action from 2.2.4 to 2.2.5
Closes https://github.com/dart-lang/sdk/pull/51545

GitOrigin-RevId: 9ad66b3e2f0b16470d8e8200ac5ef841b884b933
Change-Id: I6d4a544cb169fb3a2859451c58b358c8366193d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285640
Reviewed-by: Alexander Thomas <athom@google.com>
2023-02-28 12:08:29 +00:00
Johnni Winther c83e7c2229 [cfe] Handle hoisting on invocations on this
Change-Id: I4892e333744c36b04803f0661888f83d58b89e40
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285901
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-02-28 09:44:47 +00:00
Johnni Winther 0b943c8d5e [cfe] Don't use ' in synthesized names
Change-Id: Ie90e1d2d1fea6507f5271e2c2c06975901163ad6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285900
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-02-28 07:49:57 +00:00
Stephen Adams e3c3415436 [js_runtime. js_dev_runtime] Move BigInt to its own file.
Patch files now support part files.  Take advantage of this by moving
the large BigInt implementation to its own file.

Change-Id: Icf21bcaae3c3b8a89b8b5dd1835d1afe5806423a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/277200
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2023-02-28 05:36:58 +00:00
Stephen Adams c768f80a96 [dart2js] Implement @pragma('dart2js:resource-identifier')
Calls to methods annotated with `@pragma('dart2js:resource-identifier')` are tracked, with their primitive constant arguments, through to the `.js` file which contains the call.

- JavaScript annotations are attached to the JavaScript AST node for
  the call.

- At the time of `.js` file printing, the JavaScript annotations are
  collected and attributed to the file. This allows the construction
  of a map from `.js` files to the 'resource identifiers' contained in
  the file.

- Alongside the `main.js` file the resource identifiers are emitted in
  a file called `main.js.resources.json`. This is controlled by the
  `--write-resources` command line option.

- Serialization of JavaScript ASTs now serializes the attached
  JavaScript annotations.

- The internal method used to implement deferred library loading is
  annotated, to allow analysis of which deferred library parts load
  other libraries.
 pkg/js_ast was tweaked to make the pkg/js_ast was tweaked to make the
- pkg/js_ast was tweaked to make propagating the JavaScript annotations through the async transforms easier.


TODO:

- Annotate const constructors
- Add golden-style tests

Change-Id: Iea77550e22ee98f81dca61dfd713c09f734583d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284492
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2023-02-28 03:00:18 +00:00
Konstantin Shcheglov d1559a99b6 CONSTANT_PATTERN_NEVER_MATCHES_VALUE_TYPE: allow int vs int, expand checks for generic types.
Change-Id: If360cdcba68b934d84fab816ef280598f8038624
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285081
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-02-28 02:53:11 +00:00
pq 8041daf7b0 + pubspec diagnostic doc
This doc lives internally (@ go/analyzer-pub-diagnostics) but Jonas suggested it might better serve in the analyzer docs, so here it is! :)



Change-Id: Iec50c263c6621fe15d05282cfcac2eafea5a420e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285884
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2023-02-28 02:45:08 +00:00
Konstantin Shcheglov ffdd04f7e4 Use extual dumps to test Search.unresolvedMemberReferences().
Change-Id: I29288108c0fa95680ad346ab87b22f9bd74932fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285703
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-02-28 01:41:48 +00:00
Robert Nystrom 51bc545135 Switch cases are no longer const contexts with patterns.
But there is a new "const expression" pattern syntax that does
introduce a const context, so test that here instead.

Change-Id: Iaf615093c3d2fb32065fa8647bf3663118b0c274
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285761
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2023-02-28 01:34:26 +00:00
Stephen Adams 3af33c1ffb [dart2js] Avoid treatAsRawType for constant collections
dart2js incorrectly canonicalized `const <dynamic>[]` and
`const <Object?>[]` to the same const object.

The incorrect canonicalization showed up in tests for the Patterns
feature.

This is not a complete fix for problems with `treatAsRawType`. See
http://dartbug.com/51534 for more details.

Bug: 49754
Bug: 51534
Change-Id: Ib4bb8529320ed240ab16ae35d4161834dd32b28a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285540
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2023-02-28 01:13:17 +00:00
Jake Macdonald 89e9f1ea9b opt out static interop inheritance test until classes can be marked as mixin classes
Change-Id: I006f7ea206da64c30acd070e2ed83ec786def1fa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285802
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
2023-02-28 00:25:49 +00:00
Alexander Markov e7af7ea88f [vm/compiler] Avoid undefined evaluation order in IL deserialization
IL deserialization should not read 2 components of pair Location
via 2 sub-expressions as they can be swapped due to a different
evaluation order.

TEST=language/records/simple/constants_and_field_access_test/1
(on Windows)

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

Change-Id: I7f97dbb5ed10b700d4cdcea6fa5ebb873ca789c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285860
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2023-02-28 00:24:39 +00:00
Mark Zhou 36ee2f3adb [ddc] Using fully qualified import URIs for deferred load caching
Change-Id: Ibd4b9e1d37aeb9b2df3414eb52a01400e86c0f42
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/281562
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2023-02-28 00:12:33 +00:00