Commit graph

86859 commits

Author SHA1 Message Date
Daco Harkes 713d226875 [misc] Generalize .gitignore for sysroots
Change-Id: I62601b0e458250da3a94764d2577d586ab8e5e1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255249
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2022-08-17 07:22:12 +00:00
Konstantin Shcheglov 8bd17aaacd Implement UP for RecordType(s).
Original: https://dart-review.googlesource.com/c/sdk/+/255143
Revert: https://dart-review.googlesource.com/c/sdk/+/255241
Change-Id: I28186cd023b853bb7265d94a3dad92b4a603b7cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255380
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-08-17 04:52:43 +00:00
Nate Biggs e833510bc5 [dart2js] Enable flag (canary -> shipping) to intern dart type values.
Change-Id: Iebac3a7c57665eccd100146f892b891a4591f554
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255201
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2022-08-17 02:50:42 +00:00
Joshua Litt 2c4ee2895f [dart2wasm] Implement toString methods on double using JS interop.
Change-Id: I5843e9cae59b8f152b922a01796eaf05494808a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/250681
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-08-17 00:23:52 +00:00
Sam Rawlins 4fcbbb107a Add CAST_FROM_NULL_ALWAYS_FAILS check
Fixes https://github.com/dart-lang/linter/issues/3605

Change-Id: I5f9a2b127173aa9f2cc6f8fcee9c93e96cb63663
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255149
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2022-08-16 23:41:02 +00:00
Joshua Litt 591ef06a29 [dart2wasm] Implement unimplemented Uri methods.
Change-Id: I54b8633d39df64d1760a7face5dda38c3aa95d5c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251592
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2022-08-16 22:38:02 +00:00
Nate Biggs 094ba2cdb3 [dart2js] Add inline measurement via new SsaMetrics.
Measures inlines (and skipped opportunities) during SSA and records them within the metric framework.

This can hopefully be used as a signal into the effectiveness of changes to the global analysis phase.

Change-Id: I9da5bad5792db8b089dbfc8725664ec13d32ab1b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255200
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-08-16 21:18:03 +00:00
Brian Wilkerson 6f92ce778a Implement AstBuilder support for record literals
Change-Id: I54f7a04d240f613185d5b114802fb1da4f974269
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255260
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-08-16 21:03:12 +00:00
Michael Thomsen c626cb8346 Make package arg to analyzer absolute
Bug: https://github.com/dart-lang/sdk/issues/49646

Change-Id: Ie653b2372ba12992457c25972294c261cb8ea40e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254901
Commit-Queue: Michael Thomsen <mit@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2022-08-16 20:54:32 +00:00
Michael Richards 89528710ac [frontend_server] These changes ensure that only 1 resident_frontend_server is running when multiple entities request to start the compilation server. Only 1 server is allowed to exist per server information file. Multiple resident_frontend_servers may exist if the user passes in different files each time a server is spawned.
Change-Id: I5cd0eceb391f6a289318c17e74069b63ff37126c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254800
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Michael Richards <msrichards@google.com>
2022-08-16 20:44:42 +00:00
Joshua Litt 3923013b81 [dart2wasm] Implement some missing members on String.
Change-Id: I37db0a4fa2ebdd0101832e0e4025cb5a38434dc1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251720
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-08-16 20:34:54 +00:00
Brian Wilkerson df7dcea631 Add support for documentation for lints
Change-Id: I5ed032891d276307e0a3ae663b7fa3101bd22442
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255280
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2022-08-16 20:32:27 +00:00
Nate Biggs 7f00006975 Handle nullable metrics on compiler tasks.
Some tasks have nullable metrics (e.g. https://github.com/dart-lang/sdk/blob/main/pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart#L61) and so we should just skip processing those tasks.

Change-Id: Ie1f4e1042ef4b5d4a95a76085c37da088e885369
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255160
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-08-16 20:26:52 +00:00
Devon Carew 52279a183f [deps] rev http, vector_math, webdev, webkit_inspection_protocol
Change-Id: I7fcece0dbe3fe694af6f4e535affec7a9450d497
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255262
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2022-08-16 20:24:22 +00:00
Konstantin Shcheglov ba633b92c0 Extract AbstractTypeSystemTest into type_system_base.dart
Change-Id: I9b98dab72de5c97923bbcf361c9482129700aefd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255320
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-08-16 18:26:22 +00:00
Ryan Macnak 8e2766c285 [vm] Provide more detailed errors when message deserialization cannot find a program element serialized by name.
TEST=local
Bug: https://github.com/flutter/flutter/issues/109248
Change-Id: Ifda7c08cf88c37a9895839858a18badf994bf72c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255220
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-08-16 16:46:47 +00:00
Ilya Yanok d3f30dc3c6 Revert "Reapply "Avoid computing the URI scanner tables at runtime.""
This reverts commit 4c7110332e.

Reason for revert: Still breaks the same tests, see b/242715525

Original change's description:
> Reapply "Avoid computing the URI scanner tables at runtime."
>
> This reverts commit 855e1cd975.
>
> The blocking issue in internal test code is assumed fixed.
>
> Change-Id: I74e0be130d149a45f77dc90c354916308b76b741
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255248
> Commit-Queue: Lasse Nielsen <lrn@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Auto-Submit: Lasse Nielsen <lrn@google.com>

TBR=lrn@google.com,kustermann@google.com

Change-Id: I391d2eb6dd9ae7367f656eaaaa7f9aeb1c31e0f7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255254
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Ilya Yanok <yanok@google.com>
Reviewed-by: Ilya Yanok <yanok@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2022-08-16 16:46:28 +00:00
Aske Simon Christensen 26053f4d51 [dart2wasm] Fix nullable downcast from types above dataref
When casting down from `anyref` or `eqref`, an intermediate
`ref.as_data` instruction is needed. However, this instruction traps on
`null`, so for nullable casts, explicit null handling is required.

Change-Id: I835f1b59d291f848a008c855843f286f0d11d5fb
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255242
Reviewed-by: Joshua Litt <joshualitt@google.com>
Auto-Submit: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-08-16 16:29:07 +00:00
Ryan Macnak 234128e8d3 Revert "[vm] Allocate old in object-graph-copy's slow path."
This reverts commit d0a60d67c9.

Reason for revert: Slow path transition seems to occur earlier than I expected

Original change's description:
> [vm] Allocate old in object-graph-copy's slow path.
>
> If we have reached the slow path, the message's subgraph is very likely to be large.
>
> TEST=ci
> Change-Id: Ie8a18c78936ae8a53f30dd61da3650e684c09dfa
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249081
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

TBR=kustermann@google.com,rmacnak@google.com

Change-Id: I61faddd37e424a742427ae7c270cdb8b0a13c418
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255300
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-08-16 16:23:47 +00:00
Ryan Macnak a8a94dcc4d [vm] Fix leak of forwarding tables when isolate message sending fails.
TEST=ci
Change-Id: I644834dcb49f197390dd71468b42b74c68a3cdb7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255180
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-08-16 16:19:07 +00:00
Nate Biggs 4d5ac43514 [dart2js] Change default values for dependencies in js_backend/runtime_type_resolution.dart
Default value of `dependencies` should be `const {}` (and narrow field type) so that VM can devirtualize calls to the `_CompactLinkedHashSet` when iterating.

Change-Id: I112d9cd9a3cd060a38e292bc1a3c54a8a2847dfe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252301
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
2022-08-16 15:54:48 +00:00
Lasse R.H. Nielsen 4c7110332e Reapply "Avoid computing the URI scanner tables at runtime."
This reverts commit 855e1cd975.

The blocking issue in internal test code is assumed fixed.

Change-Id: I74e0be130d149a45f77dc90c354916308b76b741
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255248
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Auto-Submit: Lasse Nielsen <lrn@google.com>
2022-08-16 14:53:07 +00:00
Martin Kustermann 91c88ab067 [Analyzer] Remove a few unused fields / functions
This results in 2+ MB savings when running analyzer in JIT mode on
flutter.

TEST=ci

Change-Id: I4c110846c0fd64476538605f4ccf195781f72c55
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255251
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2022-08-16 14:22:37 +00:00
Daco Harkes 1ae40d5ebf [vm/ffi] Add Fuchsia ABI unit tests
Adds the Fuchsia ABI to the ABI unit tests.

Adds an ABI test for the FFI callback on who's return the stack is/gets
corrupted from bug:
https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=105336

TEST=tools/test.py ffi_unit

Change-Id: I3c9bb9941e4883384dfba787bb6dacb4c8cdc141
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255122
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2022-08-16 12:17:26 +00:00
Daco Harkes 34c11de808 [vm/ffi] Don't tree-shake Finalizable members.
This CL prevents treeshaking of members that have type `Finalizable`, `Future<Finalizable>` or `FutureOr<Finalizable>`.

All `Finalizable` members are kept. Even the ones which are not
members of `Finalizable`s. This is in line with the logic to keep
all `Finalizable` arguments/variables alive.

Moreover, this CL adds AOT tests to the FFI transformer tests so that
we catch differences between AOT/JIT in the future.

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

TEST=pkg/vm/test/transformations/ffi_test.dart
TEST=pkg/vm/testcases/transformations/ffi/finalizable_member.dart

Change-Id: I14003314b9f23692fee30d1c3eef1bdcd27ed1ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254904
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2022-08-16 09:07:40 +00:00
Ilya Yanok c3a13edc31 Revert "Implement UP for RecordType(s)."
This reverts commit cccc959dd4.

Reason for revert: Breaks Google3 (blaze doesn't support circular dependencies, see b/242614028).

Original change's description:
> Implement UP for RecordType(s).
>
> Change-Id: I9960fbdc5cadbd600ad2ae5c9991b83852c428d9
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255143
> Reviewed-by: Samuel Rawlins <srawlins@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>

TBR=scheglov@google.com,brianwilkerson@google.com,srawlins@google.com

Change-Id: Id573d10446c8d966ba96fa1c47d6134388139816
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255241
Reviewed-by: Alexander Thomas <athom@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Ilya Yanok <yanok@google.com>
Commit-Queue: Ilya Yanok <yanok@google.com>
2022-08-16 08:41:47 +00:00
Aske Simon Christensen 5ea5e3f0b2 [dart2wasm] Remove RTT support and emit isorecursive types
Relatedly, remove the --nominal-types and --runtime-types options and
eliminate the instruction and type wrappers that abstracted over these
options.

Rename instructions to the names in the latest WasmGC working draft.

Change-Id: Icd0e4bbcf444d5a3cea1f88f4e3bf8dd2926f70f
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254902
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-08-16 08:31:57 +00:00
Jens Johansen 8a1dbb160f [parser] Parse record literals
This is the first stab at implementing the record expressions from
https://github.com/dart-lang/language/blob/master/working/0546-patterns/records-feature-specification.md

Change-Id: I2adb6cb3cd50d4ee45e144e86ec7011d046f6170
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253783
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Michael Thomsen <mit@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-08-16 06:36:36 +00:00
Sigmund Cherem fead8b897e [dart2js] remove support for reading sources from http (tech-debt)
Long ago the compiler had logic for reading sources via an http
connection. This is not a supported use case and there is no need to
keep this around anymore.

Change-Id: Ic59c154def264a52d9310133f76b153c9972899c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251701
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-08-16 00:01:26 +00:00
Konstantin Shcheglov cccc959dd4 Implement UP for RecordType(s).
Change-Id: I9960fbdc5cadbd600ad2ae5c9991b83852c428d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255143
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-08-15 22:59:27 +00:00
DEPS Autoroller 72bea4eade Roll Dart Documentation Generator from 446e0fd1f26b to b3d4aa002d36 (1 revision)
https://dart.googlesource.com/dartdoc/+log/446e0fd1f26b..b3d4aa002d36

2022-08-14 49699333+dependabot[bot]@users.noreply.github.com Bump markdown from 5.0.0 to 6.0.0 (#3121)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dart-doc-dart-sdk
Please CC dart-ecosystem-gardener@grotations.appspotmail.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Dart Documentation Generator: https://github.com/dart-lang/dartdoc/issues
To file a bug in Dart SDK: https://github.com/dart-lang/sdk/issues

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Tbr: dart-ecosystem-gardener@grotations.appspotmail.com
Change-Id: I129ff938e51e865fa384601b5a339ad53bd29acf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255004
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2022-08-15 22:44:57 +00:00
Konstantin Shcheglov b9f0b2ed8b Implementations for RecordTypeAnnotation nodes.
Change-Id: Ice4425e70b62fc68d4ad3aa97faf6e56f4076781
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255144
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-08-15 22:35:26 +00:00
Alexander Aprelev 0914835773 [vm/inliner] Tweak inlining heuristic, improve List.of inlining.
Builds on top of https://dart-review.googlesource.com/c/sdk/+/228660, introduces vm:vm:always-consider-inlining that tell inliner not to give up inlining of a function.

HashMap constructor got prefer-inline pragma to accommodate shift in inlining away from where it used to be inlined due to large size of inlined HashMap, greater than FLAG_inline_getters_setters_smaller_than heuristic.

Notable performance changes:

JIT (x64)
===
ListCopy.List.of.fixed.100 27.37%
ListCopy.List.of.fixed.2 16.31%

AOT (x64)
===
Empty  -9.978%
InstantiateTypeArgs.Instantiate1  -8.262%
...
ListCopy.List.of.fixed.2 13.73%
ListCopy.spread.num.2 15.51%
ListCopy.List.of.2 15.08%
MapCopy.Map.String.of.Map.100 55.62%
MapCopy.Map.Thing.of.Map.100 56.06%

flutter release
===
flutter_gallery_apk_size (Pixel 2)
-0.0074% (1.0 noise)41809568.00 41812676.00


Addresses https://github.com/dart-lang/sdk/issues/49408

TEST=Inliner_always_consider_inlining, Inliner_List_of_inlined
Change-Id: I7f8fc7cb0ac4a69310c108cf519518c384dc0164
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253740
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2022-08-15 21:14:36 +00:00
Ben Konyi eff8c305d9 [ Service / Timeline ] Enable Compiler, Dart, and GC timeline streams when --observe is provided
TEST=pkg/vm_service/test_timeline_default_streams_test.dart

Fixes https://github.com/flutter/devtools/issues/3444

Change-Id: I3f772a54a512eb836e3e7279ee8d4d3437473393
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255181
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2022-08-15 21:02:36 +00:00
Ryan Macnak d0a60d67c9 [vm] Allocate old in object-graph-copy's slow path.
If we have reached the slow path, the message's subgraph is very likely to be large.

TEST=ci
Change-Id: Ie8a18c78936ae8a53f30dd61da3650e684c09dfa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/249081
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2022-08-15 20:32:56 +00:00
Brian Wilkerson 65058f87e1 Add visitor support for record literals
Change-Id: I8f5aff11786a75ce02a8f3483585dc0513ae2c86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255142
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-08-15 20:00:46 +00:00
Konstantin Shcheglov 4eb511da43 Replace more Bazel with Blaze, some simplifications.
Change-Id: I096860e17ce56c2f602718f11706f24989c1f65b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255141
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-08-15 19:50:46 +00:00
Konstantin Shcheglov c66faf9f3a RecordElement.instantiate(), substitution, type alias.
Change-Id: Icd0e234e57d17a1c86140ed58fc9732da31bf1b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254942
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-08-15 17:31:36 +00:00
Martin Kustermann 9a3bcbcdb0 [CFE] Improve [StringCanonicalizer] implementation
The current [StringCanonicalizer] implementation has some issues:

  * It hangs on to large [Uint8List]/[String] objects in it's cache
    => This requires users (such as analyzer) to clear the cache
       frequently

  * Has api that works on dynamic input (which is assumed to be String
    or List<int> / Uint8List)
    => Call sites have typing information we loose when doing the call

  * It uses dynamic [] calls to compare input bytes with cached bytes /
    input strings with cached strings
    => Dynamic calls come with overhead
    => Will cause substring generation for every character comparison
    => Will compare bytes with strings (which doesn't make sense)

To address these issues we

  * Use the canonicalized [String] to compare against instead of the
    (much larger) source strings, thereby no longer hanging on to large
    strings in the canonicalizer cache (it's still an issue with
    [Uint8List]s though)

  * Make seperate API for canonicalization of strings, sub-strings or
    sub-utf8-bytes and use it from the token implementation.

  * For canonicalization of strings use String.== (instead of
    char-by-char comparison)

  * For canonicalization of sub-strings use String.charCodeAt instead of
    [] (which creates substrings)

  * Seperate out cache node entries into two classes and reduce memory
    consumption of the nodes that represent strings by 16 bytes (it
    does an additional `is` check on lookups in the cache, but that is
    better than paying for dynamic calls on the payload - which
    causes the compiler to do implicit checks)

=> This CL reduces RAM consumption and makes CFE scan/scan_bytes benchmarks a little faster.

TEST=ci

Change-Id: I157c298d26d25ac5da82c32eedfa270a590156f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255121
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2022-08-15 17:06:58 +00:00
Brian Wilkerson d353323510 Initial AST structure for record literals
Change-Id: I225365b90d2e006116b3a91307479839df07ec10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255140
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-08-15 17:01:26 +00:00
Paul Berry 05eb57b0d1 Migration: add assemble_resources.dart script.
This script does the same job as `generate_resources.dart`, but it
doesn't search the filesystem for the input files to use, nor invoke
the compiler to create the `migration.js` file.  Instead, it simply
accepts a list of input files on the command line, and outputs their
contents in an appropriate form to be stored in `resources.g.dart`.

This script will allow us to integrate more cleanly with the internal
build system.

Change-Id: I4b5445d1f5fd7eccbb5fb36f6ee4fa97d2cea87e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254421
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-08-15 16:40:46 +00:00
Nate Biggs a547cfc096 [dart2js] Defer deserialized CodegenResults by members.
For large applications only ~60% of these objects are used. This defers their deserializtion until they're accessed in the codegen member map.

In local testing on large applications this saved ~200MB of memory usage in the linker phase.

Change-Id: I8ff87803fc23ef2d3f954646687e3fc67b68a4f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254600
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2022-08-15 16:13:46 +00:00
Daco Harkes a304e5b156 [cfe/ffi] Test Finalizables in extension methods
`Finalizable`s with extension methods work by virtue of being
desugared into static methods and the `Finalizable`s being normal
arguments.

If we ever change the representation of extension methods,
`Finalizable`s would need to be treated specially. This test will
catch that.

TEST=pkg/vm/test/transformations/ffi_test.dart

Bug: https://github.com/dart-lang/sdk/issues/49643#issuecomment-1214847853

Change-Id: I68cfbc098386a88495d37417c6eb7295b89bfb95
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255123
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2022-08-15 13:29:37 +00:00
Martin Kustermann bc090dc469 [CFE] Adjust benchmarking script to support scanning based on Utf8BytesScanner
The CFE itself uses [Utf8BytesScanner] in it's normal operation. The
analyzer instead uses [StringScanner].

The performance script used today only measures scanning performance
based on [StringScanner].

=> This CL adds a `scan_bytes` subcommand that will measure scanner
   performance based on bytes (the CFE default mode).

The performance script discovers the files to scan for the benchmark by
using the analyzer to transitively scan/parse files and looking at the
imports. Doing so will - as a side effect- fill
[StringCanonicalizer] with values.

=> This CL cleans the [StringCanonicalizer] cache before doing the
   actual benchmarking.

TEST=ci

Change-Id: I996efe6b3551983df19ed5aad4fc4220c07336cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255120
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2022-08-15 09:07:37 +00:00
Johnni Winther b928fd3083 [frontend_server] Add FrontendServer wrapper in test
This adds a FrontendServer class that wraps steam communication,
reducing the amount of boilerplate code needed to write frontend
server tests.

Change-Id: I9ff0fe6e04a83503e00eea9fc764231e50d6207a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/253666
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-08-15 06:57:46 +00:00
Brian Wilkerson 61af13bf29 Use var more consistently in the documentation generator
Change-Id: I44fedefa38c34ea6813cc845aab9a0ba29abd0e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254944
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-08-15 03:50:16 +00:00
Konstantin Shcheglov fff672f417 Implement isSubtypeOf() for RecordType.
Change-Id: I42003fb5ce7bb374a37cc704a85f9eb16ca3aa42
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254841
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2022-08-13 17:12:25 +00:00
Konstantin Shcheglov 293c39cfce Add RecordElement, RecordTypeImpl, implement basic subtyping.
Change-Id: I54ac91dfc5a4e01b6f960b865d3d73d11bd0cd84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255040
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-08-13 00:56:51 +00:00
Konstantin Shcheglov cc49399c65 Add all nodes to NodeLintRegistry.
Change-Id: I185bcad6cc749b4ee6b78779db162d0632154585
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254983
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-08-13 00:06:34 +00:00
DEPS Autoroller 4c5b412a4a Roll Dart Documentation Generator from ed09195c559c to 446e0fd1f26b (3 revisions)
https://dart.googlesource.com/dartdoc/+log/ed09195c559c..446e0fd1f26b

2022-08-12 srawlins@google.com Tidy potentially applicable extensions (#3117)
2022-08-12 49699333+dependabot[bot]@users.noreply.github.com Bump github/codeql-action from 2.1.17 to 2.1.18 (#3109)
2022-08-12 srawlins@google.com Accept theirs in merge conflicts of generated files (#3118)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dart-doc-dart-sdk
Please CC dart-ecosystem-gardener@grotations.appspotmail.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Dart Documentation Generator: https://github.com/dart-lang/dartdoc/issues
To file a bug in Dart SDK: https://github.com/dart-lang/sdk/issues

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Tbr: dart-ecosystem-gardener@grotations.appspotmail.com
Change-Id: I5ba63e0e8eaa9a2e400d5777f359f164ffb5b184
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/255002
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: DEPS Autoroller <dart-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2022-08-12 21:33:35 +00:00