This includes extension declarations in the checking of constructors and field initialization. The method names were directly mentioning constructors which likely caused the omission of extensions. The method names and doc comments have been updated to reflect their broader applicability.
Closes#62843
Change-Id: Icce59caf27f6dd2aa51bcad0baaf0b4427d3afad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/488480
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
The CL does a few things:
* Rename "forwarder" to "dispatcher" to disambiguate them from actual
dynamic forwarders:
- "dynamic dispatcher": A function that takes all arguments of a
dynamic call & dispatches them to the right target (which is a
dynamic forwarder).
- "dynamic forwarder": A function that takes arguments, type checks
them, unboxes them (if applicable), calls the real function, boxes
the result (if applicable).
* Make dynamic setter dispatchers & forwarders have `void` return type.
Setters in Dart don't produce values, the call sites turn `a.b = c`
into something like this: `let tmp = c in (let a.b=(tmp) in tmp)`
* Make `CallShape` remember not just the argument shape but also whether
it was a getter, setter or method.
Issue https://github.com/dart-lang/sdk/issues/62639
Change-Id: Ia616f504a3ed3e9fa86a93d274af794b9437e5ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/488081
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Add `ClassBody.members` and `EnumBody.constants`/`members` so callers
can access class and enum contents through the common body interfaces
instead of pattern matching on `BlockClassBody` and `BlockEnumBody`.
Implement empty node lists for empty class and enum bodies, update the
public API, and migrate analyzer, analysis_server, analyzer_plugin, and
linter code to use the new accessors directly. This removes the ad hoc
`members2` helper extensions and a large amount of repeated `tryCast`
and `switch` logic, making body traversal more uniform.
Change-Id: I51d75f2253c7e6f75efecae84bf0443ff5eb6788
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/488263
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
We need to think about utilities we can add to `ChangeBuilder` to make
this kind of edit easier. I thought about an `addInitializer` utility,
but wasn't sure it would have other uses. I also thought about an
`addMember`, which would probably be good, but not for this use case.
More thinking is probably needed.
Change-Id: Ie30d9f4a47007b03b22a290e2ba6c72f3c5423bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/488361
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Work towards https://github.com/dart-lang/sdk/issues/61868
This adds a new notification type, 'PluginPrint'. There are several
fields and variables then named 'pluginPrint' or 'print', and I am
definitely open to changing these names, but this is the best one that
I thought of.
PluginPrint has three fields: The name of the plugin that printed, the
message that was printed, and the timestamp.
We wrap each plugin's AnalysisRule invocations with a zone, so that
the `print` handler can know the name of the plugin. The prints are
caught and sent to the server isolate as Notifications. The
PluginIsolate then stores the collected prints. The Plugins Insights
page can then retrieve them and display them.
Manual testing, with 1000 libraries that get new lint reported once per
file, I did not observe a negative performance impact.
Change-Id: Id800ae41781c15ce89d06b563878c2b0edae43d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/486827
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
The code in `generateNoSuchMethodCall` is calling the `noSuchMethod`
instance method. Doing so required duplication of logic from
normal instance invocations.
Instead we call a static method in core libraries that will perform the
instance invocation. Compiling that static method will then use the
normal logic we have for instance invocations (instead of duplicating
that logic in the code generator).
Part of https://github.com/dart-lang/sdk/issues/62639
Change-Id: Ic6a5e5bc7a87baa2039af551bd7a01b1557017a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/488160
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Teach ResolutionVisitor to resolve labeled and unlabeled break and
continue targets directly. It now tracks label scopes, the current
unlabeled jump context, and the enclosing local closure while walking
loops, switches, and labeled statements, and assigns jump targets during
the main resolution pass.
Remove the separate ScopeResolverVisitor traversal from library analysis
and AstResolver, and keep the supporting scope machinery with
ResolutionVisitor. This consolidates early resolution logic, avoids an
extra AST walk.
Change-Id: I4527b7cfc70e873b99508659c923e6737c0b45be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/488040
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
This CL is part of an effort to bump the SDK requirement to `3.12.0-0`
for all the packages in `pkg` that are not published to `pub`, so that
we can get better testing of the "private named parameters" feature.
(Packages that *are* published to `pub` can't be safely bumped yet,
because SDK 3.12 hasn't been released, and I don't want to block those
packages' ability to publish useful updates to customers.)
This change covers the following packages, which are owned by
OWNERS_INFRA:
- pkg/smith
- pkg/status_file
- pkg/test_runner
Changes to `pubspec.yaml` files were made manually.
Changes to `.dart` files were made automatically (with some
exceptions), using `dart fix` to migrate to using private named
parameters where it is possible to do so without changing
semantics. Note that this migration is conservative; see
https://github.com/dart-lang/sdk/issues/58607 for details.
The exceptions are:
- pkg/test_runner/lib/src/compiler_configuration.dart
- pkg/test_runner/lib/src/path.dart
These files contained code that triggered the
`use_null_aware_elements` lint, so I manually fixed the instances of
the lint. (The lint didn't previously fire because the test runner
used to be on language version 3.5.0, which was before the "null aware
elements" feature existed.)
Change-Id: Ia5d99ba5fc2d5aacbec5b091348be1d26a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/487882
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
This CL is part of an effort to bump the SDK requirement to `3.12.0-0`
for all the packages in `pkg` that are not published to `pub`, so that
we can get better testing of the "private named parameters" feature.
(Packages that *are* published to `pub` can't be safely bumped yet,
because SDK 3.12 hasn't been released, and I don't want to block those
packages' ability to publish useful updates to customers.)
This change covers the following packages, which are owned by
OWNERS_WEB:
- pkg/_js_interop_checks/pubspec.yaml
- pkg/compiler/pubspec.yaml
- pkg/dart2js_info/pubspec.yaml
- pkg/dart2js_runtime_metrics/pubspec.yaml
- pkg/dart2js_tools/pubspec.yaml
- pkg/dev_compiler/pubspec.yaml
- pkg/js_ast/pubspec.yaml
- pkg/js_runtime/pubspec.yaml
- pkg/js_shared/pubspec.yaml
- pkg/modular_test/pubspec.yaml
- pkg/node_preamble/pubspec.yaml
- pkg/reload_test/pubspec.yaml
- pkg/sourcemap_testing/pubspec.yaml
Changes to `pubspec.yaml` files were made manually.
Changes to `.dart` files were made automatically (with a few
exceptions), using `dart fix` to migrate to using private named
parameters where it is possible to do so without changing
semantics. Note that this migration is conservative; see
https://github.com/dart-lang/sdk/issues/58607 for details.
The exceptions are:
- pkg/compiler/test/codesize/swarm/DataSource.dart
- pkg/compiler/test/codesize/swarm/Views.dart
- pkg/compiler/test/codesize/swarm/swarm_ui_lib/layout/GridLayout.dart
- pkg/compiler/test/codesize/swarm/swarm_ui_lib/touch/ClickBuster.dart
- pkg/compiler/test/codesize/swarm/swarm_ui_lib/touch/Scrollbar.dart
- pkg/compiler/test/codesize/swarm/swarm_ui_lib/touch/Scroller.dart
- pkg/dev_compiler/test/sourcemap/testfiles/next_through_is_and_as_test.dart
For these files, there was no need to migrate to using private named
parameters, however the language version bump caused flow analysis to
improve, so some additional dead code was detected that hadn't been
detected previously. I reasoned that it's better to minimize changes
to testcases, so rather than deleting the dead code, I just added
`ignore` comments to prevent the bots from failing.
Change-Id: I04f5280d7cedef0a6f0ef718133a03d06a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/487945
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
This CL is part of an effort to bump the SDK requirement to `3.12.0-0`
for all the packages in `pkg` that are not published to `pub`, so that
we can get better testing of the "private named parameters" feature.
(Packages that *are* published to `pub` can't be safely bumped yet,
because SDK 3.12 hasn't been released, and I don't want to block those
packages' ability to publish useful updates to customers.)
This change covers the following packages, which are owned by
OWNERS_VM:
- pkg/dart2bytecode
- pkg/dart2native
- pkg/dtd_impl (jointly owned with OWNERS_DEVTOOLS)
- pkg/mmap
- pkg/observatory
- pkg/vm
Changes to `pubspec.yaml` files were made manually.
Changes to `.dart` files were made automatically, using `dart
fix`. Two kinds of changes were made:
- Migrate to using private named parameters where it is possible to do
so without changing semantics. Note that this migration is
conservative; see https://github.com/dart-lang/sdk/issues/58607 for
details.
- Migrate to using null aware elements.
Tested: Standard trybots
Change-Id: I1666e5771a34ef3c30ceeadced3d505d6a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/487942
Auto-Submit: Paul Berry <paulberry@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
This CL is part of an effort to bump the SDK requirement to `3.12.0-0`
for all the packages in `pkg` that are not published to `pub`, so that
we can get better testing of the "private named parameters" feature.
(Packages that *are* published to `pub` can't be safely bumped yet,
because SDK 3.12 hasn't been released, and I don't want to block those
packages' ability to publish useful updates to customers.)
This change covers the dynamic_modules package, which is jointly owned
by OWNERS_VM and OWNERS_WEB.
Change-Id: If43d006208865287c127f5ad1f3bb4386a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/487943
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This CL is part of an effort to bump the SDK requirement to `3.12.0-0`
for all the packages in `pkg` that are not published to `pub`, so that
we can get better testing of the "private named parameters" feature.
(Packages that *are* published to `pub` can't be safely bumped yet,
because SDK 3.12 hasn't been released, and I don't want to block those
packages' ability to publish useful updates to customers.)
This change covers the following packages, which are owned by
OWNERS_WASM:
- pkg/dart2wasm
- pkg/wasm_builder
Changes to `pubspec.yaml` files were made manually.
Changes to `.dart` files were made automatically, using `dart fix` to
fix failures in the unnecessary_underscores lint.
Change-Id: Ia83ba9109dcd3d488755d2df990dd2496a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/487944
Auto-Submit: Paul Berry <paulberry@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
In the new variable encoding, variables exist either in the internal
form (InternalLocalVariable, InternalSyntheticVariable, etc) or in the
output form, which is passed to the backends. Normally, type inference
is the mechanism that consumes the variables in the internal forma and
produces the variables in the output form. However, some expressions are
produced before type inference (in the BodyBuilder) and will never be
processed by type inference. Synthetic assignments in for-in loops is an
example of such expressions.
This CL modifies the expression generators used by the BodyBuilder, so
that the synthetic assignments are produced directly in the output form,
since they will not be touched by type inference.
This change makes the `loop.dart`, `switch.dart`,
`instance_creation.dart`, `asserts.dart`, `field_initializers.dart`,
`optional_params.dart`, `bootstrapping.dart`, `ffi.dart`, and
`invisible.dart` tests of the bytecode generator to pass, so it can be
removed from the excluded tests when the closure-context-lowering
experiment is enabled.
Part of https://github.com/dart-lang/sdk/issues/61572
Change-Id: I8d828b7da8e33c6e9fa6bfdda1f201bcdfad9ac4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/487840
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
This CL is part of an effort to bump the SDK requirement to `3.12.0-0`
for all the packages in `pkg` that are not published to `pub`, so that
we can get better testing of the "private named parameters" feature.
(Packages that *are* published to `pub` can't be safely bumped yet,
because SDK 3.12 hasn't been released, and I don't want to block those
packages' ability to publish useful updates to customers.)
This change covers the following packages, which are owned by OWNERS_ENG:
- pkg/async_helper
- pkg/bisect_dart
- pkg/dartdev
- pkg/expect
Changes to `pubspec.yaml` files were made manually.
Changes to `.dart` files were made automatically, using `dart fix` to
migrate to using private named parameters where it is possible to do
so without changing semantics. Note that this migration is
conservative; see https://github.com/dart-lang/sdk/issues/58607 for
details.
Change-Id: I56bdd1f2665b0a0b79ebb8484e49ce176a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/487940
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
The main piece to this CL is to add more links in the diagnostics pages.
We add links to pubspec files in a context, and to the generated package
config files for plugins.
I also rename `writeOption` to `formatOption` as it doesn't actually
write (it just returns a String).
I also fix a few small UX issues:
* Contents page titles should break on slashes, so I just updated all
page titles to break on slashes.
* A small bug where a context with zero library cycles of size > 1
display the text "They contain" and then no more text.
Change-Id: I7c505b006872e70884bf4c59a34e0625c7663a6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/487946
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This CL is part of an effort to bump the SDK requirement to `3.12.0-0`
for all the packages in `pkg` that are not published to `pub`, so that
we can get better testing of the "private named parameters" feature.
(Packages that *are* published to `pub` can't be safely bumped yet,
because SDK 3.12 hasn't been released, and I don't want to block those
packages' ability to publish useful updates to customers.)
This change covers the following packages, which are owned by
OWNERS_MODEL:
- pkg/analyzer_cli
- pkg/frontend_server
- pkg/testing
Changes to `pubspec.yaml` files were made manually.
Changes to `.dart` files were made automatically, using `dart fix` to
fix failures in the unnecessary_underscores lint.
Change-Id: Ie444a97b2aed3f9eabfde4963c19cfb26a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/487883
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
This allows the formatter to be both ahead or behind the SDK version and still format correctly. We should not use a newer language version than the SDK is using, and we cannot use a newer version than the formatter supports.
Change-Id: I5ef27363d213f570b2eb0d3b428752aef8e76af1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/487580
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Kallen Tu <kallentu@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This CL is part of an effort to bump the SDK requirement to `3.12.0-0`
for all the packages in `pkg` that are not published to `pub`, so that
we can get better testing of the "private named parameters" feature.
(Packages that *are* published to `pub` can't be safely bumped yet,
because SDK 3.12 hasn't been released, and I don't want to block those
packages' ability to publish useful updates to customers.)
This change covers the following packages, which are owned by
alexmarkov, sra, and vegorov:
- pkg/cfg
- pkg/native_compiler
Changes to `pubspec.yaml` files were made manually.
Change-Id: I39c86badeeeeae558bbf079e6a1df6686a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/484225
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
This CL is part of an effort to bump the SDK requirement to `3.12.0-0`
for all the packages in `pkg` that are not published to `pub`, so that
we can get better testing of the "private named parameters" feature.
(Packages that *are* published to `pub` can't be safely bumped yet,
because SDK 3.12 hasn't been released, and I don't want to block those
packages' ability to publish useful updates to customers.)
This change covers the server_plugin package, which is owned by
OWNERS_DEVELOPER_EXPERIENCE. (I meant to include this as part of
https://dart-review.googlesource.com/c/sdk/+/487621 but I got my wires
crossed and included a different package instead).
Change-Id: I0d56d15e80554e056e1968ce35ce394b6a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/487888
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Prior to the introduction of the "anonymous methods" experiment, a
`return` statement and a `throw` expression behaved identically from
the point of view of flow analysis, since both had the effect of
causing control flow to jump outside the function that flow analysis
is analyzing*. So they were both implemented using a single flow
analysis method called `handleExit`.
(*Technically a `return` from an inner function could lead to a point
in an enclosing function, and a `throw` could lead to a `catch`, but
flow analysis handles both of these possibilities using a conservative
approximation (see the `FlowModel.conservativeJoin` method), rather
than modeling them as direct jumps.
But a `return` statement inside a block-bodied anonymous method is
known to jump directly to the code that follows the anonymous method
invocation, so `handleExit` is not the correct way to model it.
Prior to this CL, this was handled in the analyzer's resolver (the
corresponding CFE logic hasn't been written yet) by treating anonymous
methods as a kind of loop construct. When visiting a return statement,
the resolver would find the innermost enclosing function expression,
local function, or block-bodied anonymous method; if it was a
block-bodied anonymous method, then it would achieve the desired
effect by calling `FlowAnalysis.handleBreak` rather than
`FlowAnalysis.handleExit`. This was an abstraction leak, because in
effect it put some of the business logic of flow analysis in its
client (namely, the knowledge that return statements in block-bodied
anonymous methods have a different flow analysis behavior than return
statements elsewhere).
This CL moves this business logic into flow analysis through the
addition of a `FlowAnalysis.handleReturn` method.
Flow analysis keeps track of whether the current point in the code
being analyzed is inside a block-bodied anonymous method using the new
field `FlowAnalysis._anonymousBlockContext`, which points to either
`null` or an instance of a new type, `_AnonymousBlockContext`. This
field is updated in proper nesting fashion by the methods:
- `anonymousBlockBody_begin`
- `anonymousBlockBody_end`
- `_functionExpression_begin`
- `_functionExpression_end`
Finally, some aspects of
https://dart-review.googlesource.com/c/sdk/+/482786 that are no longer
necessary are rolled back:
- A node no longer needs to be passed to `anonymousBlockBody_begin`.
- The mapping from nodes to branch targets is changed back to a
mapping from statements to branch targets, since it no longer needs
to accept an anonymous method invocation as a key.
Change-Id: I8b0f35cab016fc5bd609cfa1581ecaa36a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/485020
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This CL is part of an effort to bump the SDK requirement to `3.12.0-0`
for all the packages in `pkg` that are not published to `pub`, so that
we can get better testing of the "private named parameters" feature.
(Packages that *are* published to `pub` can't be safely bumped yet,
because SDK 3.12 hasn't been released, and I don't want to block those
packages' ability to publish useful updates to customers.)
This change covers the following packages, which are owned by the
developer experience team:
- pkg/analysis_server_client
- pkg/linter
- pkg/server_plugin
- pkg/telemetry
Changes to `pubspec.yaml` files were made manually.
Changes to `.dart` files were made automatically (with a few
exceptions; see below), using `dart fix` to migrate to using private
named parameters where it is possible to do so without changing
semantics. Note that this migration is conservative; see
https://github.com/dart-lang/sdk/issues/58607 for details.
The exceptions are:
- pkg/analysis_server_client/lib/handler/notification_handler.dart
- pkg/analysis_server_client/lib/src/protocol/protocol_common.dart
- pkg/analysis_server_client/lib/src/protocol/protocol_generated.dart
These are code-generated files are checked by the trybots to make sure
they are correct. The code generator runs the formatter, and the
formatter's behavior depends on the current language version. To
minimize the risk of accidental behavioral changes, I addressed this
by manually running these files through `dart format` and then
verifying that the result matches what the code generator would
produce.
Change-Id: I5a0baa28904890a0b7e4234b12f587f66a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/487621
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This CL is part of an effort to bump the SDK requirement to `3.12.0-0`
for all the packages in `pkg` that are not published to `pub`, so that
we can get better testing of the "private named parameters" feature.
(Packages that *are* published to `pub` can't be safely bumped yet,
because SDK 3.12 hasn't been released, and I don't want to block those
packages' ability to publish useful updates to customers.)
This change covers the following packages, which are owned by
OWNERS_FOUNDATION:
- pkg/build_integration
- pkg/scrape
Changes to `pubspec.yaml` files were made manually.
Change-Id: Ib38f7648f1d170756e1e18c0177ce5d76a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/487881
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Update library invalidation so `LibraryContext.remove()` can identify
removed library cycles directly from the removed files.
Previously file eviction cleared `file._kind` before
`LibraryContext.remove()` ran. Once that happened, the library cycle for
a removed file was no longer available, so removal had to scan all
loaded bundles and check whether any cycle contained one of the removed
files.
Run bundle removal while file kinds are still intact and have
`LibraryContext.remove()` derive the affected cycles directly from the
removed files. This lets it remove those cycles from `loadedBundles` and
collect their linked keys without scanning unrelated bundles.
To support this ordering, file-state pruning now exposes a hook that
runs before disposal begins, and file change handling collects affected
files before evicting them. This keeps library invalidation targeted and
avoids extra work during cache cleanup.
Bug: https://github.com/dart-lang/sdk/issues/62760
Change-Id: I5055606eead4dce2f65a0fcaf52acf0d53a93c61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/487701
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This CL adds support for anonymous block bodies (as in `e.{...}`) by
generalizing the flow analysis to handle begin/end of anonymous block
bodies and treating them similarly to labeled statements (and treating
`return` statements using `handleBreak`). It generalizes `handleBreak`
and the internal make `_StatementToContext` to handle `Node` keys rather
than just `Statement` keys, such that an anonymous block body can be the
context. It adds a `bodyContext` instance variable to
`AnonymousBodyImpl` to be used during flow analysis of anonymous block
bodies. `BodyInferenceContext` gets a new factory constructor in order
to allow an anonymous block body to be the context. Finally,
`ErrorVerifier` is generalized to handle the case where a return
statement is returning from an anonymous block body.
Change-Id: I04bc3c852611dbefb885afce655dc00054709fb7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/482786
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
This CL is part of an effort to bump the SDK requirement to `3.12.0-0`
for all the packages in `pkg` that are not published to `pub`, so that
we can get better testing of the "private named parameters" feature.
(Packages that *are* published to `pub` can't be safely bumped yet,
because SDK 3.12 hasn't been released, and I don't want to block those
packages' ability to publish useful updates to customers.)
This change covers the following packages, which have empty OWNERS
files:
- pkg/heap_snapshot
- pkg/perf_witness
- pkg/shell_arg_splitter
Changes to `pubspec.yaml` files were made manually.
Change-Id: Ie5c9dbd116be3537e84b1df4ca93d8d06a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/487920
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
The RegEx engine in the VM was updated in
e443b89f23 which caused the analyzer
analyzing the CFE to use ~150 mio instructions more.
Part of this was an increased cost in ignore comment processing which
relied on regex. Using regex before the updated engine made
`processPrecedingComments` have a cost of ~240 mio instructions,
updating the regex engine took that to ~264 mio instructions.
This CL gets rid of the regex and takes the cost of
`processPrecedingComments` to ~74.4 mio instructions a saving of about
189 mio instructions (all then analyzing the CFE and looking at output
from `valgrind --tool=callgrind`).
Benchmarking with `perf stat` with normal GC gives:
```
task-clock:u: -2.1760% +/- 1.6063% (-265608341.80 +/- 196062087.98) (12206056036.20 -> 11940447694.40)
page-faults:u: 0.2301% +/- 0.0313% (448.20 +/- 60.88) (194764.60 -> 195212.80)
cycles:u: -2.2906% +/- 1.6090% (-1180119481.60 +/- 828994273.75) (51521138476.00 -> 50341018994.40)
instructions:u: -0.3325% +/- 0.0032% (-196547942.60 +/- 1874215.18) (59120651337.60 -> 58924103395.00)
seconds time elapsed: -2.1715% +/- 1.6011% (-0.27 +/- 0.20) (12.21 -> 11.95)
seconds user: -2.2487% +/- 1.7816% (-0.27 +/- 0.21) (11.87 -> 11.60)
Comparing GC data:
'No' GC change.
```
Note that it must push the GC - the savings isn't really 2% in time.
And with GC disabled:
```
instructions:u: -0.4562% +/- 0.0029% (-185499444.00 +/- 1189012.77) (40663084597.80 -> 40477585153.80)
```
So here a saving of ~185 mio which fits okay with the data from
valgrind.
Change-Id: Ib203baeac6a93f5e37c737080fed342dbd0740a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/487021
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>