Commit graph

93046 commits

Author SHA1 Message Date
Konstantin Shcheglov e623e291a7 Add TypeSystemImpl.isValidExtensionTypeSuperinterface()
Change-Id: Ic2d40f1faab9851b3f4f9ee7605dabf197dca433
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316640
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-07-27 19:29:22 +00:00
Ryan Macnak 5b2aa424e5 [vm, gc] Card progress bars also need to be reset on an aborted scavenge.
Cf. cac1319768.

TEST=ci
Change-Id: I3545943071334b7c1114999ce8f4a77fe22718f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316602
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-07-27 19:27:46 +00:00
Stephen Adams 74242b1b6c [js_runtime] Use Array.prototype.sort
Sorting is 2-3x faster for a 1024 element list and simple comparison function.

Change-Id: Iecb4dceb7155e430fcc2c0ddef977003d747ab9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315760
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2023-07-27 19:21:13 +00:00
Sigmund Cherem 0a3ca5a098 [modular_test]: support running modular_test unit tests in shards.
The findRoot method made assumptions that were only true when running the
test in the main shard of our test runners. This caused a few tests to
start failing when sharding was enabled in:
089364baab

Fixes #53059

Change-Id: I32c59d6ae396fba5cbf19491eb17d7b90a7b8cd9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316642
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2023-07-27 19:19:43 +00:00
Devon Carew 97850321ca Move moving forward revisions for: collection, dartdoc, ecosystem, test, vector_math.
Revisions updated by `dart tools/rev_sdk_deps.dart`.

collection (db343da..0a2885a):
  0a2885a  2023-07-25  Devon Carew  prep for publishing 1.18.0 (#299)

dartdoc (a04ac3e..1cf8870):
  1cf88707  2023-07-26  Sam Rawlins  Convert 'p' prefixes to 'path' in tool/ (#3472)
  d44c8056  2023-07-26  Sam Rawlins  Move a few more grinder tasks to package:args commands (#3468)
  f66eb72d  2023-07-26  Sam Rawlins  Use path as import prefix in lib/ and test/ (#3471)
  34441f21  2023-07-25  Sam Rawlins  Move flutter-doc tasks to package:args; remove unused grinder tasks (#3466)

ecosystem (27ff3e9..97fc1a7):
  97fc1a7  2023-07-25  Moritz  Fix comment posting from forks (#144)

test (37e54e3..7f81dee):
  7f81deea  2023-07-24  Nate Bosch  Drop the Condition abstraction (#1956)

vector_math (048777a..88bada3):
  88bada3  2023-07-26  John McCutchan  Revert "Fix rotation around Y axis (#262)" (#300)

Change-Id: Ib7bc8c1bab60450e6b328c3075207adef4cf642b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316621
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-07-27 17:16:53 +00:00
Kallen Tu 13a986db82 [analyzer] Fix broken code generators in g3.
Some part of the code generators trigger the `??` RHS operand when there is an unresolved type on the LHS.

In the previous const evaluator prior to https://dart-review.googlesource.com/c/sdk/+/312347, errors triggered by unresolved types would be ignored. Now that we have specific unresolved constants, we need to short circuit the evaluation in some places.

Anyways, this change makes unresolved types return LHS early (they're represented by a `Null` state) until I can find a better fix for this.

b/293326927

Change-Id: Ifcbff9921e1d4a82dc24153b042eaaa862bcca68
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316490
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-07-27 17:05:19 +00:00
Konstantin Shcheglov 293d32fe76 Share more code using TypeParameterizedElementMixin.
Change-Id: I47bdfac9befe020c1daef72aec299ad752710209
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316487
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-07-27 15:14:50 +00:00
Johnni Winther bf9ea56ff7 [kernel] Remove nodes used for the old 'extension-types' experiment
This removes ExtensionType, ExtensionTypeShowHideClause and
CallSiteAccessKind from package:kernel which where only used by the now
removed 'extension-types' experiment.

A follow-up CL will rename InlineClass/InlineType to
ExtensionTypeDeclaration/ExtensionType to match the names of the
Extension Type feature currently being implemented.

TEST=existing

Change-Id: I58d2e8b0a92ac61329ee161cc6884a2c0e6f87ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316420
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2023-07-27 10:47:08 +00:00
Johnni Winther 74fa24d4c0 [cfe,analyzer] Remove 'extension-types' experimental flag
This is not the flag you're looking for.

The 'extension-types' flag was used for an early experiment that is
not directly related to the Extension Types feature currently being
developed. The current feature uses the 'inline-class' flag.

Change-Id: Icbb6c3828c41e743e726161b17da4c7784a2c677
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316380
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-07-27 09:30:36 +00:00
Konstantin Shcheglov b42c27f2a2 Issue 53029. Include constant dependencies of map patterns.
Bug: https://github.com/dart-lang/sdk/issues/53029
Change-Id: I8d604a153452acee581f291f5806f88b4478fee0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316081
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-07-27 03:22:23 +00:00
Sam Rawlins cb93ac73fd Re-add applyToAnalysisOptions, needed by internal customer
b/293297223

Change-Id: I852bbc5df9c5918b31a37eaebd4bf1d2895f6fb9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316529
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-07-27 02:44:08 +00:00
Sam Rawlins ab8736cf7c [analyzer] Remove all checks for ui-as-code enablement
Dart 3's minimum language version is 2.12. google3's is 2.9.

Change-Id: I8303b14de17b695e835cf9f8018f08731b51ec35
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316526
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-07-27 02:43:38 +00:00
Konstantin Shcheglov 88d84eb6f2 Remove ElementImpl.typeParameterContext, unused.
Change-Id: Idac59ddb6fa013ea1a01ff4cf16cd3df4b2cf672
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316489
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-07-27 02:21:30 +00:00
William Hesse 7d802ca199 Increase maximum sdk version constraint on dart_internal to 3.3.0
The dart_internal has a maximum sdk version constraint so it
can be deprecated and removed once it is no longer used.
Increasing it from <3.2.0 to <3.3.0.
The package is still used internally, and downloaded by Flutter
from pub.

Change-Id: I210ac7453950388544d03d768ad9261d51a7f060
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316540
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: William Hesse <whesse@google.com>
2023-07-27 00:29:42 +00:00
Liam Appelbe edeac698c2 [vm/ffi] Closure callbacks for async callbacks
This change is almost trivial. The closure is stored on the callback's
RawReceivePort, not in the VM. So we can basically just remove the CFE
check and it pretty much works. The only problem is that we can't set
function.FfiCallbackTarget anymore, so most of the CL is dealing with
that.

A few places were deciding whether an FFI trampoline was a call or a
callback based on whether function.FfiCallbackTarget() was null. But
now the target will be null for async callbacks. So instead I've added
a new value to the FfiCallbackKind enum (and renamed it), and changed
those checks.

Sync callback closures will be a separate CL, because they're more
complicated.

Bug: https://github.com/dart-lang/sdk/issues/52689
Change-Id: I8e5dfb557362e679f66195b735c3c382e6792840
TEST=async_void_function_callbacks_test.dart
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316160
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2023-07-26 23:23:26 +00:00
Ryan Macnak f2611b7c8e [vm] Update lingering references to RawObject.
TEST=ci
Change-Id: If01ff0f7a9b10dc4e6f6d3139bd421df9ecc9855
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316528
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-07-26 21:53:49 +00:00
Ryan Macnak 5cf55de409 [vm, reload] Delay enum forwarding until after instance morphing.
Enum forwarding requires evaluating and canonicalizing the new enum instances. If these in turn refer to other instances of classes with shape changes, canonicalization may try to compare instances of the old and new shapes and dereference past the end of an object. By waiting for instance morphing to complete, canonicalization can only see instances with the new shape.

Also, don't attempt to forward Enum.values. When an enum member is added or removed, this has the same merging problem as 40442.

Cf. bad074cc49.

TEST=ci
Bug: https://github.com/flutter/flutter/issues/129177
Bug: https://github.com/dart-lang/sdk/issues/53039
Change-Id: Ib7a54db30c4d16a6ae6e1acd595dc7482134165b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316527
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-07-26 21:14:09 +00:00
Ryan Macnak bb9583bf99 [vm, reload] Fix assertion failure when instance morphing encounters a field value that is an already morphed instance.
TEST=ci
Change-Id: I0d04b92fafc7ccb655e67e1fa3805d00e92a7e4b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316488
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2023-07-26 20:47:25 +00:00
Kallen Tu 946175cbd0 [analyzer] Add tests for the removal of 'A value of type 'Null' can't be assigned to a parameter' overreporting in the const evaluator.
The constant evaluator now handles invalid types better and won't overreport this nonsensical error.

Bug: https://github.com/dart-lang/sdk/issues/47603, https://github.com/dart-lang/sdk/issues/47351, https://github.com/dart-lang/sdk/issues/49389
Change-Id: I63c253d2177c2b8c259c364e83753653eac1cae0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312707
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-07-26 20:36:28 +00:00
Sam Rawlins 05f2b3222a [analyzer] Add extension-naming to our style doc
Change-Id: I454df164b2cede7c4ae7d6fdf541e67fdf7090da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316525
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Kallen Tu <kallentu@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-07-26 20:32:59 +00:00
Konstantin Shcheglov 4787a99ba0 Don't print 'shouldUseTypeForInitializerInference' when no initializer expression.
Change-Id: I73c7bc973d8cdfbcc6d63232a5c8eec0ac43fe76
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316524
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-07-26 19:46:18 +00:00
Stephen Adams 0223d07de4 [js_runtime] Use Function.prototype.bind for convertDartClosureToJS
Change-Id: Ib7142e894959994b296dee7ecc3aaf15feb0af66
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316100
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2023-07-26 19:39:28 +00:00
Konstantin Shcheglov d02097bd1e Test for extension types with type parameters.
Change-Id: Ib0d406cd98116deea20eb402d113f3cd2b97504c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316482
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-07-26 18:45:41 +00:00
Konstantin Shcheglov c36ff43382 Parse and use 'const' keyword for extension types.
Change-Id: I331d57f46507981f8532d504211267316770f86b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316521
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2023-07-26 18:45:12 +00:00
Ryan Macnak f8feb29a69 Revert "[vm, reload] Delay enum forwarding until after instance morphing."
This reverts commit 6ef967fb07.

Reason for revert: https://github.com/dart-lang/sdk/issues/53039

Original change's description:
> [vm, reload] Delay enum forwarding until after instance morphing.
>
> Enum forwarding requires evaluating and canonicalizing the new enum instances. If these in turn refer to other instances of classes with shape changes, canonicalization may try to compare instances of the old and new shapes and dereference past the end of an object. By waiting for instance morphing to complete, canonicalization can only see instances with the new shape.
>
> Also, don't attempt to forward Enum.values. When an enum member is added or removed, this has the same merging problem as 40442.
>
> Cf. bad074cc49.
>
> TEST=ci
> Bug: https://github.com/flutter/flutter/issues/129177
> Change-Id: I19d0508059bade8496000eeea257bb0730f11d17
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316041
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Ryan Macnak <rmacnak@google.com>

Bug: https://github.com/flutter/flutter/issues/129177
Change-Id: I8aa09be5d8fd72460ab26294ed94a5075135d48b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316501
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2023-07-26 18:13:42 +00:00
Sam Rawlins 411cfeef13 Address feedback from cr/316340
Change-Id: I5fecdab01b9a2af385ecae72b00b076821b3a605
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316480
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-07-26 17:27:38 +00:00
Derek Xu 0ba8d4ef77 [VM/Debugger] Fix the behaviour of setting inline breakpoints in uncompiled functions
TEST=pkg/vm_service/test/column_breakpoint_test.dart, other debugger
tests in tryjobs

Fixes: https://github.com/dart-lang/sdk/issues/51563
Change-Id: I87ef7e52cfc7e922904b267b7eb74fc783214b44
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316440
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
2023-07-26 17:15:36 +00:00
Daco Harkes 3915c9cd44 [test/ffi] Fix status file
https://dart-review.googlesource.com/c/sdk/+/302322 didn't match the
behavior and didn't cover aot.

Bug: https://github.com/dart-lang/sdk/issues/39487
Change-Id: Id1bf70ab72d19cd4c1e531362099389eebb46835
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316383
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-07-26 16:50:46 +00:00
Ryan Macnak cac1319768 [vm, gc] Run weak processing in parallel for new-space GCs.
Allow updating weak handles etc to happen in parallel with work-stealing.

Also make LocalBlockWorklist more symmetric with BlockWorklist.

Cf. 4495c2b30a

TEST=ci
Change-Id: Id58fe16be92028b1aa4dd8f097769b4107f2a3f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316043
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-07-26 16:45:01 +00:00
Sam Rawlins a07f57c7a1 Split out 'analysis-options-application' code from verification code
Change-Id: Id3aab1ef4c91c2f4c59ca253acbc51b80d6409ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316340
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-07-26 16:24:37 +00:00
Daco Harkes 2e87f8c95a [tools] Fixes to find_builders.dart
Fixes the Gerrit CL footer.

Denylists some builders which are not available on CQ but only on CI.

Change-Id: Ie0716c52366a8be429c2b6aca030e61769ceca80
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316382
Reviewed-by: William Hesse <whesse@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2023-07-26 16:02:56 +00:00
Kallen Tu 66df28dcc6 [analyzer] Remove unused ConstantEvaluationValidator.
ConstantEvaluationValidator and it's implementation is not used
anywhere in g3 nor in the sdk.

Change-Id: I7490501e2e55ac567a996af658bb09dd7c37c8df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316020
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-07-26 15:21:04 +00:00
Konstantin Shcheglov e6f9e58371 Basic building of ExtensionTypeElement(s).
Change-Id: I0489a5dde5afe244d8c4b58351b3ecac6315a790
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316080
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-07-26 15:10:09 +00:00
Ömer Sinan Ağacan dd712accf4 [dart2wasm] Test with d8 --wasm-final-types --wasm-disable-deprecated
Change-Id: Iba192eb02bb6163e95e55deb4c3912315b8b77ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316201
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
2023-07-26 10:58:09 +00:00
Johnni Winther 53deaf0522 [parser] Support 'extension type const'
This adds parser support for the optional 'const' keyword in extension
type declaration. The token is passed on through the endPrimaryConstructor
listener call since it is used to make the primary constructor constant.

Change-Id: I518a8e397fb62272002c424e7b69affe6123f4af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316221
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-07-26 08:17:49 +00:00
Nate Biggs 4f03bd0c30 [dart2js] Defer loading of codegen results.
This was landed a while ago as https://dart-review.googlesource.com/c/sdk/+/254600. However, this had to be rolled back because at the time this increased memory usage for the emitter phase. This change prevented GC from cleaning up the byte arrays of the codegen serialized files which resulted in an increased max heap.

However, now that we map (rather than copy) files into memory, there is no overhead to keeping a reference to the codegen serialization files.

Thanks to recent improvements in the efficiency of deferred serialization this change seems to improve max memory usage by up to 1.2GB for the emitter phase. Avoiding caching results also helps in this regard, usage of the results is fairly localized.

Change-Id: I4d401a877cb74cbb36b511eb598a759fe300fd5d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316180
Commit-Queue: Nate Biggs <natebiggs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2023-07-26 02:23:40 +00:00
Kallen Tu ba005169c5 [analyzer] Initial refactor of _InstanceCreationEvaluator to return Constant value.
evaluateConstructorCall now returns a Constant, which means evaluation may be cut early in some places if there's an error. However, some code generators rely on _InstanceCreationEvaluator to complete, and so there's no _major_ changes to the design right now (and some small additions to avoid breaking many tests).

This CL is just the framework for the "return Constant" design and will be the base for reporting better errors in constructor invocations.

These changes already show that we cut some amount of over-reporting in our existing language and unit tests, which is a step in the right direction.

Bug: https://github.com/dart-lang/sdk/issues/47603, https://github.com/dart-lang/sdk/issues/47351, https://github.com/dart-lang/sdk/issues/49389

Change-Id: I5ba7f1282658884c18a32d5e98c7804bbfeac0f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312347
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2023-07-25 19:23:02 +00:00
Sam Rawlins 005f7e84c2 Add fix for unreachable_from_main
We have a fix to remove private declarations (classes, other elements, local variables, etc). No reason to not allow this for public elements in entry-point libraries.

Change-Id: Id4c0ef1b14658d701229ea71d25669982e98d6c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313291
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2023-07-25 17:59:02 +00:00
Konstantin Shcheglov 8b6074617a Tests for metadata in ExtensionTypeDeclaration.
Change-Id: Ie474674bfba980ad085620d731540f0018534ae6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316240
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2023-07-25 17:43:08 +00:00
Paul Berry 5a79f8a9f3 Unify "mini-ast" constructs for rest pattern elements.
Previously, in the "mini-ast" pseudo-language for shared flow analysis
and type analysis unit testing, there were two separate functions to
create a rest pattern (`...`):

- `listPatternRestElement` for creating a rest pattern for use in a
  list pattern

- `mapPatternRestElement` for creating a rest pattern for use in a map
  pattern

The latter is not allowed in Dart, but it's supported to allow for
better error recovery.

But having two functions wasn't necessary--the two functions did
exactly the same thing.

This CL simplifies things so that there is just a single function,
`restPattern`. It also renames the underlying representation class
from `RestPatternElement` to `RestPattern`, to match the nomenclature
in the patterns spec document.

Change-Id: Iecfe8c86f49161e0657cdab44f000f47c0e3c212
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315520
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-07-25 16:36:28 +00:00
Ryan Macnak be5c3c123e [vm, gc] Record pending weaklings during minor GC without using next_seen_by_gc_.
Instead use external pointer block lists so that the same weakling can be pending for both minor and major GC at the same time. When we begin marking through new-space in major GCs, this will need to happen for weaklings in new-space. Once the pending lists are independent, it is easy to handle the reverse case. This also improves the promptness with which old-space weaklings with unreachable new-space targets are clear.

TEST=ci
Change-Id: I46a0a78eeae0210caad48a162c8d64a9af79e749
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/314863
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2023-07-25 16:32:15 +00:00
Ryan Macnak 6ef967fb07 [vm, reload] Delay enum forwarding until after instance morphing.
Enum forwarding requires evaluating and canonicalizing the new enum instances. If these in turn refer to other instances of classes with shape changes, canonicalization may try to compare instances of the old and new shapes and dereference past the end of an object. By waiting for instance morphing to complete, canonicalization can only see instances with the new shape.

Also, don't attempt to forward Enum.values. When an enum member is added or removed, this has the same merging problem as 40442.

Cf. bad074cc49.

TEST=ci
Bug: https://github.com/flutter/flutter/issues/129177
Change-Id: I19d0508059bade8496000eeea257bb0730f11d17
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316041
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-07-25 15:40:22 +00:00
Devon Carew d0748c1cc4 [deps] rev http, lints, mockito, package_config, web_socket_channel
Revisions updated by `dart tools/rev_sdk_deps.dart`.

http (b206771..1a42b4a):
  1a42b4a  2023-07-21  Brian Quinlan  Harmonize response header behavior (#993)
  db276f8  2023-07-21  Alex James  Java http send method (#987)

lints (e03dc04..1e0245e):
  1e0245e  2023-07-21  Parker Lougheed  Update tooling to use new `rules.json` location (#140)

mockito (afa20a8..b421775):
  b421775  2023-07-22  Googler  Internal change

package_config (be0c441..981c49d):
  981c49d  2023-07-21  Kevin Moore  Update to team lints, require Dart 3.0 (#139)

web_socket_channel (7ae4d0f..4d1b543):
  4d1b543  2023-07-22  Jithuraj  Correction in Code Snippet (#275)

Change-Id: I0024ad558b128e9e2ba84f992e0d80fbb7bdc4cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315982
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2023-07-25 15:22:49 +00:00
Alexander Thomas a3d48885e7 [release] Bump version on main to 3.2
Tested: CQ
Change-Id: I16210697b47dd85aec8743b457e773b044cab81f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316200
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
2023-07-25 15:12:49 +00:00
Joshua Litt d1660236f1 [wasm_builder] Defer encoding instructions until Module.encode.
This CL lays the foundation for allowing us to emit instructions without finalizing imports, which will in turn enable more flexibility in code generation. For example, we will no longer need to do a pre-code generation pass to collect imports. In addition, it will pave the way for other optimizations as suggested in the `TODO` at the top of `instructions.dart`.

Perhaps counter-intuitively, even without any optimizations, this doesn't seem to be a measurable regression:

Before:
  Completed compilation of dart2wasm-html-engine in 52652ms.
  Completed compilation of dart2wasm-html-html in 51827ms.
  Completed compilation of dart2wasm-html-ui in 20399ms.
  Completed compilation of dart2wasm-canvaskit-canvaskit in 32899ms.
  Completed compilation of dart2wasm-canvaskit-ui in 20695ms.
  Completed compilation of dart2wasm-skwasm-ui in 20319ms.

After:
  Completed compilation of dart2wasm-html-engine in 51476ms.
  Completed compilation of dart2wasm-html-html in 48845ms.
  Completed compilation of dart2wasm-html-ui in 19676ms.
  Completed compilation of dart2wasm-canvaskit-canvaskit in 31933ms.
  Completed compilation of dart2wasm-canvaskit-ui in 19733ms.
  Completed compilation of dart2wasm-skwasm-ui in 19962ms.

Change-Id: Ib3740f88db56070fc3ccdde484675267e4bf40c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315580
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2023-07-25 13:55:10 +00:00
Paul Berry 39e1357288 Add shared analysis testing infrastructure for map literals.
This change adds the functions `mapLiteral` and `mapEntry` to the
"mini-ast" representation used for unit testing shared flow analysis
and type analysis logic. These can be used to model map literals with
explicit type arguments. Set/map literals without explicit type
arguments are not supported yet.

These functions replace the old `inContextMapEntry` method, which was
an alternative way of testing the type analysis behavior of map
literal entries (and was not yet being used). The new approach is
better in that it allows the test cases to follow the structure of
actual Dart code (map entries inside map literals) rather than just
testing map entries in isolation.

Change-Id: I4bfd31b8fb2865f3d0892da0a47ee0bdacaf9250
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315225
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2023-07-25 13:49:06 +00:00
Johnni Winther 5833837622 [cfe] Add test for issue 43400
Closes #43400

Change-Id: Icdd968f1265d2cf0969027752b2cdb3d2f04050b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316220
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-07-25 13:42:59 +00:00
Johnni Winther 4d78361e8f [cfe] Handle absolute part/part-of uri with packages
Closes #52964

Change-Id: I787af659744be45df4221fcaefe2b524beb20776
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315403
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2023-07-25 11:42:58 +00:00
Chloe Stefantsova 2c86500e36 [cfe] Adjust nullability of UP of intersection type and another type
Closes https://github.com/dart-lang/sdk/issues/52993

Change-Id: Id7c18f98d2422264ca69e275505d4977b8b59a99
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315900
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
2023-07-25 10:12:58 +00:00
William Hesse dab8ab7420 [tools] Use pattern matching in find_builders.dart
Minor changes to find_builders.dart script to use pattern
matching, drop duplicate builders, and drop some type casts.

Change-Id: I463ba8352622dc66678aa71627d84130308da9a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315261
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2023-07-25 09:30:16 +00:00