Commit graph

83682 commits

Author SHA1 Message Date
Konstantin Shcheglov
1e66a8a079 Report more hierarchy diagnostics for enums.
Change-Id: If2c4ef3604fadfaa6d3d5af992f61a6a819a5b01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231528
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-02-03 23:39:26 +00:00
Konstantin Shcheglov
ddff5ac88c Tests for completion in NamedExpression.
Change-Id: I5a7ba57a1279797f7e625890a64c42091708f60e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231380
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-02-03 22:24:16 +00:00
Ryan Macnak
33a1117d62 [vm] Add missing opt-out of C instructions to vm/cc/LoadWordUnsigned_0.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/38587
Change-Id: I15460a970522044b50f98922fad559d26c5813ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231524
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-02-03 21:52:56 +00:00
Michael Thomsen
e69217fe28 Add CVE-2022-0451 to changelog
Change-Id: I6fffab997fbd1b63c54cfc883e10280c97a6366a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231560
Auto-Submit: Michael Thomsen <mit@google.com>
Reviewed-by: Brian Quinlan <bquinlan@google.com>
Commit-Queue: Brian Quinlan <bquinlan@google.com>
2022-02-03 21:25:39 +00:00
Joshua Litt
58e577da15 [dart2js] Move common_elements.dart to common/elements.dart.
Change-Id: Idaed02bb747670413f63e7f7b0797eb591e12f57
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231523
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2022-02-03 21:21:39 +00:00
Brian Wilkerson
17422f82b2 Remove an unnecessary shared name from a message
Change-Id: I0569bd99620f2b276f9cc1510a4641bbe0cb7182
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231522
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-02-03 21:18:48 +00:00
Ryan Macnak
ab3aab760e [vm] Remove special cases for canonicalizing doubles and mints.
dart_precompiled_runtime -7k

TEST=ci
Change-Id: I22c8254b08d9f68be02f7210aa60f7cc728f8b9d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231324
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-02-03 21:13:36 +00:00
Ryan Macnak
4faf01a66c [vm] Cleanup workarounds for removed flag --throw_on_javascript_int_overflow.
TEST=ci
Change-Id: I65936b5cd6e5933eadc37f3cd6bba1f0fa1b81a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231328
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-02-03 21:10:46 +00:00
Ryan Macnak
b6ab7350be [test] Inform status files about the new simulated architectures.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/37299
Bug: https://github.com/dart-lang/sdk/issues/38587
Change-Id: I6f1a749690b894b14f465d608f37acf62568cdef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231521
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-02-03 20:32:16 +00:00
Joshua Litt
848e106346 [Dart2js] Remove unnecessary abstract interface on Enqueuer.
Change-Id: Ia9c2e329fb83eeb77f399c43ae5725ccb9b602c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231381
Auto-Submit: Joshua Litt <joshualitt@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2022-02-03 18:55:47 +00:00
Nicholas Shahan
e44af61dd1 [ddc] Update warning message with dwds version
Change-Id: I26b5393256506f4ca1773baea15e71bee4b54683
Issue: https://github.com/dart-lang/sdk/issues/48103
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/226964
Reviewed-by: Anna Gringauze <annagrin@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2022-02-03 18:51:16 +00:00
Daco Harkes
eacd2b3e3e [vm] WeakReference check target type
Closes: https://github.com/dart-lang/sdk/issues/48264

TEST=runtime/tests/vm/dart/finalizer/weak_reference_run_gc_test.dart

Change-Id: I16d9d9768bcef3c832960f0cd33ba54a0b689ed2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231481
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2022-02-03 18:29:46 +00:00
Kenzie Schmoll
a1f0f497a4 Add a script to serve a local DevTools build
Change-Id: I499b45830bacf8899c5db8d776f7a6c3a47e53b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231362
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Kenzie (Schmoll) Davisson <kenzieschmoll@google.com>
2022-02-03 18:03:18 +00:00
Joshua Litt
6a4cb1a3a7 [dart2js] Move native_basic_data.dart into its own library.
Change-Id: I2aa257cb6b53d7e3cbf32efdfd0605df6fe4021e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231382
Auto-Submit: Joshua Litt <joshualitt@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2022-02-03 17:58:06 +00:00
Ryan Macnak
f3996e4e96 [vm] Remove some dead error entry points.
TEST=ci
Change-Id: I78e13654ba4425e07e92a5a879595cae2045ea99
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231360
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-02-03 17:55:16 +00:00
Danny Tuppeny
692f9c28eb [dds] Ensure thread startup is not handled twice in DAP when attaching
Should fix the flakes seen in https://github.com/dart-lang/sdk/issues/48274 caused by Isolate PauseStart events arriving during initialization but being delayed until initialization complete, and then auto-resuming isolates that ere deliberately being left paused.

Change-Id: Iee32731b92fe96b6b41e7e78c01af2f5e843ea92
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231460
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2022-02-03 17:41:46 +00:00
Danny Tuppeny
ddadc8d7e4 [dds] Improve DAP test cleanup by retrying deletes where Windows may still have files locked
Fixes at least part of https://github.com/dart-lang/sdk/issues/48274.

Change-Id: I3a31f8149d00729afe4d3c86ee38892ce90625c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231240
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2022-02-03 17:41:26 +00:00
Johnni Winther
0fda2bfdaa [cfe] Perform precompilation
Initial support for performing precompilations based on the computation
of [NeededPrecompilations].

Currently this requires the caller to supply a `macroSerializer` that
can convert a [Component] into a [Uri] that can be passed to the macro
executor.

Also, the caller needs to supply a `macroTarget` used for the
precompilation. This is done to avoid (for now) a dependency of the VM
target inside the CFE itself.

Change-Id: I50cc25fe6632a25c0c1a8a1ac019e6d9e35ab4f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231443
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-02-03 16:56:36 +00:00
fredbroz
d48a637bf5 [Analyzer] Add fix for use_raw_strings lint
Closes https://github.com/dart-lang/sdk/issues/47955

Bug: https://github.com/dart-lang/sdk/issues/47955
Change-Id: If321097598fcdcd79c246032f64332e91ee7f57c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231302
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-02-03 15:55:56 +00:00
Johnni Winther
bede5c8df3 [cfe] Handle named arguments anywhere in enhanced enums
The arguments synthesized for enhanced enums didn't ensure correct
setup of `ArgumentsImpl.argumentsOriginalOrder` needed for the
named-arguments-anywhere feature.

The CL also handles local initializers as part of constants, as needed
when combining the two features.

Included is a fix in adding synthesized enum arguments to redirecting
initializers. This was accidentally done on all classes (not just enum
classes) when enhanced enums was enabled.

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

Change-Id: If911e57bb338a50f2cee1721b4e43ff343685933
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231440
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-02-03 15:44:36 +00:00
Vyacheslav Egorov
aeb3e1d73b [vm] Avoid creating unnecessary SafepointPosition's
Register allocator does not need to associate always-calls
safepoints with live ranges of constant values because
constant values are never actually spilled and are rematerialized
instead.

@alexmarkov has observed that SafepointPosition objects for
constants account for large chunk of the total memory eaten by
the register allocation pass and this change addresses this issue.

With this change the total memory consumed by the register allocator
decreases from 21 Gb to 8.6 Gb on one of the examples
in https://github.com/flutter/flutter/issues/94461.

TEST=ci

Change-Id: I245f2678bc6f5c1d63fd282812d1df2b2958512f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231442
Auto-Submit: Slava Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
2022-02-03 15:39:06 +00:00
Daco Harkes
33e170ed56 [vm] Map key and value iterator speedup
Duplicates `_CompactIterable` and `_CompactIterator` to
`_CompactIterableImmutable` and `_CompactIteratorImmutable` to prevent
the `_data` field to store both modifiable and unmodifiable lists.

This speeds up iteration by about 20% (more info on the bug).

Does not use mixins for code sharing, because all the fields need to be
in the concrete classes anyway.

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

TEST=existing lib tests

Change-Id: I514d058d02ef3b26b475000daea3afc12f37c566
Cq-Include-Trybots: luci.dart.try:analyzer-nnbd-linux-release-try,app-kernel-linux-debug-x64-try,dart-sdk-linux-try,front-end-nnbd-linux-release-x64-try,pkg-linux-debug-try,vm-canary-linux-debug-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-checked-linux-release-x64-try,vm-kernel-linux-debug-x64c-try,vm-kernel-linux-debug-x64-try,vm-kernel-nnbd-linux-release-simarm-try,vm-kernel-optcounter-threshold-linux-release-x64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64c-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-tsan-linux-release-x64-try,vm-kernel-tsan-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231243
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2022-02-03 14:35:56 +00:00
Johnni Winther
9df38b50da [cfe] Add support for all declarations in macro applications
This CL adds support for macro application on all library
and class members.

Change-Id: I792837be5c73a5353f565528b8a6dcff3e28a3d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231244
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2022-02-03 08:14:56 +00:00
Nate Bosch
5e8e68c2c8 Remove more reference to .packages
Towards #48275

Change-Id: Idfe1de48b7f292b6c89e5b904f74c37232380c6b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231065
Auto-Submit: Nate Bosch <nbosch@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
2022-02-03 01:08:34 +00:00
Ryan Macnak
08164f88c9 [vm] Add missing safepoint transition when updating or deleting API handles.
TEST=tsan, iso-stress
Change-Id: I82f8fb8ef3bbedf510e34488fdaa7d8af5902830
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231332
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-02-03 00:41:07 +00:00
Alexander Markov
3d977bc191 [vm/test] Fix memory leak in ffi/regress_flutter97301_test
TEST=ci
Fixes https://github.com/dart-lang/sdk/issues/48283

Change-Id: I22d9ebac3240e9ca84fec833340d71b58d01119d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231335
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2022-02-03 00:28:55 +00:00
Konstantin Shcheglov
8f2a27f940 Report ENUM_MIXIN_WITH_INSTANCE_VARIABLE
Change-Id: Idc15ea010fc0b7d7f4b551a2a4b8731bcfc74ad7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231325
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-02-03 00:03:49 +00:00
Nate Bosch
bc40873f98 Use package_config.json over .packages in DDC
Towards #48275

Change-Id: Ie4fe50d0d5afb04d4d3e7dde55c441e952218cc4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231184
Auto-Submit: Nate Bosch <nbosch@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2022-02-02 23:56:45 +00:00
Devon Carew
cc019ea118 [dartdev] have the 'doc' command default to documenting the cwd
Change-Id: Id1d0394f6ecc300d100d0269a8df4d1a519422cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230820
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2022-02-02 23:55:46 +00:00
Ryan Macnak
3d2371180f [infra] Add missing out directories to vm-kernel fileset.
Change-Id: I41e34cd88084b057225fac33baf1e7160e0a8afa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231281
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-02-02 23:00:16 +00:00
Srujan Gaddam
f392f31a13 [dart:html] Add Element.scrollIntoViewIfNeeded to CHANGELOG
Change-Id: Ic7c2b3cffa62b66d5c66713958e3626fa67e1945
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231331
Auto-Submit: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
2022-02-02 22:08:35 +00:00
Srujan Gaddam
0ec4c3a1b5 [dart:html] Expose scrollIntoViewIfNeeded
`scrollIntoViewIfNeeded` is nested within `scrollIntoView`. The latter
method is outdated and the way to access the different ways to call
`scrollIntoViewIfNeeded`. Instead of using that method, this CL
directly exposes `scrollIntoViewIfNeeded`.

Change-Id: I38d7876a7923768ae165c29a98e514e90182b77e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231047
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Riley Porter <rileyporter@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2022-02-02 20:46:59 +00:00
Konstantin Shcheglov
33b3c1d6c6 Report ILLEGAL_LANGUAGE_VERSION_OVERRIDE, when 'sourceLanguageConstraint' is set.
Change-Id: Ibbd786090a5a1a61da11f1e9de754202bdc454d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231322
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-02-02 20:20:39 +00:00
Konstantin Shcheglov
f2740bd3b6 Create an implicit enum constructor even if there is a named factory constructor.
Change-Id: Iace1d803c5330b32c2856edfb3c1da14f461cff3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231283
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-02-02 19:27:30 +00:00
Paul Berry
9fa75965e3 In FunctionExpressionImpl, keep track of whether a function type was supplied via context.
This avoids the need to refer to context types after resolution is
complete.

This is part of a larger effort to elimiate the use of
InferenceContext.getContext and InferenceContext.setType entirely.

Change-Id: Ia3f15080ad8b6f90525577694fefc172faa93286
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231320
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-02-02 18:59:09 +00:00
Konstantin Shcheglov
80230eedcd Support for 'sound_null_safety' in BazelWorkspacePackage.
Change-Id: I22e5b9ea64b52922394be892663acff0e7def016
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231188
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-02-02 18:29:10 +00:00
Konstantin Shcheglov
f5acc570e8 Fix CompletionDriver tests on Windows.
Change-Id: I43bf2c80b244906c2568e05fd24d4dd49953feb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231321
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-02-02 18:28:25 +00:00
Danny Tuppeny
0a5da6814d [dds] Enable verbose output in DAP integration tests
See https://github.com/dart-lang/sdk/issues/48274.

Change-Id: Ia2c0bed90e9f31b99a7074f397fc508abcf49071
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231301
Reviewed-by: Ben Konyi <bkonyi@google.com>
2022-02-02 17:54:10 +00:00
Sam Rawlins
b9b1252752 For existing fixes, add super-parameter and named-args-anywhere tests
Bug: https://github.com/dart-lang/sdk/issues/48067, https://github.com/dart-lang/sdk/issues/47578
Change-Id: Iaef317459c7e6901296475163959ad92a6c880b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231070
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2022-02-02 17:47:49 +00:00
Konstantin Shcheglov
64001abe3e Add ConstructorElement.isGenerative and ClassElement.isDartCoreEnum
Change-Id: I0d7391fe02e450cb3ac33fd6abbe33a3561243ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231280
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-02-02 17:32:19 +00:00
Danny Tuppeny
4a5b0b3030 [analysis_server] Fix slash direction in auto-import details for LSP completions
Fixes some failing tests on the Windows bots that were getting backslashes but expecting forward.

Change-Id: Idd89a45d7be87385d497e221a1941e4c48d597af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231300
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-02-02 17:26:09 +00:00
Ryan Macnak
e32d98cd06 [tools] Replace the Chromium binary size tool, which no longer works.
Change-Id: Id84717e21a129a392d3bc4e9b4cce84dfb4771e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231066
Reviewed-by: Ben Konyi <bkonyi@google.com>
2022-02-02 17:22:38 +00:00
Paul Berry
bf51e35c46 Consolidate remaining calls to InferenceContext.setType.
Now that we only use InferenceContext.setType for expressions, this
change consolidates all the call sites to just two places:

- The method ResolverVisitor.analyzeExpression, which is used when
  recursively analyzing subexpressions inside expressions and
  statements.

- The method InferenceContext.setTypeFromNode, which is used during
  AST rewrites to transfer context information from the original node
  to the rewritten node.

This is part of a larger effort to elimiate the use of
InferenceContext.getContext and InferenceContext.setType entirely.

Change-Id: Id236bcb1247c09b740bbbad41cb74ecda301cc86
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231181
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-02-02 16:54:00 +00:00
Paul Berry
541b9a86e9 Clean up handling of for-statement and for-element bodies.
Change-Id: I10f3545a84a3b128e6c3587ff04d4d069383dd04
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231183
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-02-02 16:34:49 +00:00
Alexander Markov
45f42d0be8 [vm] Refactor duplicated slots and rename offsets
This change removes distinct Slots for the same field:

PointerBase_data_field -> PointerBase_data
Pointer_data_field -> PointerBase_data
TypedDataBase_data_field -> PointerBase_data

Also, the following slot is renamed to match field name:

TypedDataView_data -> TypedDataView_typed_data

The following offsets are renamed to match field names /
declarations in Untagged* classes:

PointerBase::data_field_offset -> PointerBase::data_offset
TypedData::data_offset -> TypedData::payload_offset
TypedDataView::data_offset -> TypedDataView::typed_data_offset


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

Change-Id: I602545fc43018494bcb24d8692292fdbc6a8f3e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231160
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2022-02-02 16:30:50 +00:00
Paul Berry
58a42b5cfc Stop storing contextual information on FunctionBody nodes.
Instead of using InferenceContext.getContext and
InferenceContext.setType to associate type inference information with
VariableDeclaration nodes, we pass the information on the stack using
a new FunctionBodyImpl.resolve method.  This should be more efficient
for two reasons: it avoids a map lookup, and it avoids the double
dispatch traditionally associated with calling a visitor.  It should
also make the code easier to reason about (since it makes the flow of
data in the type inference process more explicit).

This is part of a larger effort to elimiate the use of
InferenceContext.getContext and InferenceContext.setType entirely.

Change-Id: I8a3f3be940acdcd0a2c4ad8ec37b41bafe25c952
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230948
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-02-02 16:04:39 +00:00
Paul Berry
e1e3bcce17 Stop storing contextual information on VariableDeclaration nodes.
Instead of using InferenceContext.getContext and
InferenceContext.setType to associate type inference information with
VariableDeclaration nodes, we directly look up the variable type when
we need it.  This should be more efficient (since it avoids a map
lookup), and it should make the code easier to reason about (since it
makes the flow of data in the type inference process more explicit).

This is part of a larger effort to elimiate the use of
InferenceContext.getContext and InferenceContext.setType entirely.

Change-Id: I01262fb3c3e6789ee9da924e731d86d99ce3f4de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230946
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-02-02 14:59:49 +00:00
Jens Johansen
1044d83ab7 [kernel] Spell check kernel/bin
Change-Id: I1433d7940f9a20b70793c8e0ea801d16aa3f9eb4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231201
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2022-02-02 12:20:46 +00:00
Jens Johansen
0794821969 [kernel] Add tool for comparing class hierarchies of two dills
This CL adds a tool that can compare the class hierarchies of two dill files.
Currently it only checks for public classes and their public supertypes.
We could extend the tool later if needed.

Currently it gives this for flutter:

```
$ out/ReleaseX64/dart pkg/kernel/bin/compare_hierarchies.dart /path/to/flutter/bin/cache/flutter_web_sdk/kernel/flutter_ddc_sdk_sound.dill /path/to/flutter/bin/cache/artifacts/engine/common/flutter_patched_sdk/platform_strong.dill "dart:nativewrappers#NativeFieldWrapperClass1"
(1): /path/to/flutter/bin/cache/flutter_web_sdk/kernel/flutter_ddc_sdk_sound.dill
(2): /path/to/flutter/bin/cache/artifacts/engine/common/flutter_patched_sdk/platform_strong.dill

Missing classes in lib dart:_internal
In (2) but not in (1): [VMLibraryHooks, Lists, VMInternalsForTesting, ClassID]

Missing classes in lib dart:ui
In (1) but not in (2): [PlatformViewRegistry]

Class(ColorFilter) in dart.ui from (2) has these extra supertypes: [ImageFilter (dart:ui)]
```

where the last line is https://github.com/dart-lang/sdk/issues/48245

It gives this for the dart sdk:
```
$ out/ReleaseX64/dart pkg/kernel/bin/compare_hierarchies.dart out/ReleaseX64/vm_platform_strong.dill out/ReleaseX64/ddc_platform_sound.dill "dart:nativewrappers#NativeFieldWrapperClass1"
(1): out/ReleaseX64/vm_platform_strong.dill
(2): out/ReleaseX64/ddc_platform_sound.dill

Missing classes in lib dart:_internal
In (1) but not in (2): [VMLibraryHooks, Lists, VMInternalsForTesting, ClassID]
```

which seems fine (dart:_internal after all)

Change-Id: I03c0dbcc3e5058a0c7d6a996b511cf6d449dd4f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231100
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2022-02-02 10:47:25 +00:00
Jens Johansen
fe84fc08e4 [CFE] Add 'fuzz' option to expression suite; run on weekly bot
In the future we might just run this as a regular thing. It doesn't take
that long.

Change-Id: I88794b37d914ba3f84b5e408009a477ec433f897
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231104
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2022-02-02 10:41:46 +00:00