This class is used during summary linking to do some basic resolution
of ASTs reconstituted from summaries. To prepare for some resolution
work I have in the pipeline, I need to ensure that resolution always
has access to a properly initialized FlowAnalysis object; this rework
makes that possible.
Previously, the lifetime of the AstResolver class was inconsistent;
some callers created one for each AST node to be resolved, and others
shared a single instance for resolving many loosely related nodes.
Now we consistently allocate a fresh AstResolver each time resolution
is needed; this allows AstResolver to use late fields to lazily create
the visitors it needs for resolution.
Also, previously the API for AstResolver was a single resolve() method
with a complex set of behaviors to allow it to handle all the use
cases. Now there are three simpler methods to handle the three use
cases (resolveAnnotation, resolveConstructorNode, and
resolveExpression).
Change-Id: I891ae621d4a188d906332cb05b6b7f9a50d59dcd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198860
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
* FunctionInvocation and LocalFunctionInvocation nodes are now supported.
* Handling of List getters is added to InstanceGet.
* Removed incorrect constant evaluation of .hashCode and .runtimeType
for List constants.
Issue: https://github.com/dart-lang/sdk/issues/45340
Change-Id: I73f3e64e805c0753325463b3e777a6c1b7d0b5fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198181
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
There was a rare mismatch between arguments and parameters when
inlining a constructor body.
The full arguments at the call site of a constructor body (always in a
generative constructor factory) and the parameters at inlining would
not agree on needing a 'box' for the constructor's closed-over mutated
variables (parameters and locals) when the box was needed only for
locals closed over in an assertion.
The fix is to make the condition for accepting a box match the test
for generating the box in the caller.
Bug: 45943
Change-Id: I3b056cb710ffac72bec6943809e04472a838e5bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198741
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
This change is a pure refactoring. It extracts 3 duplicated code
snippets into helper methods. This is needed to reduce number of
places where PropertyGet and MethodInvocation nodes are created, as
these nodes are going to be replaced with InstanceGet and
InstanceInvocation nodes soon.
Issue: https://github.com/dart-lang/sdk/issues/45340
Change-Id: I694805a3761fd389ac8ee005d12ffb9bb9543ea7
TEST=ci
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198581
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This CL just converts one checker_test case into the modern test cases in
resolution/type_inference. Many more of the tests in checker_test deal with
method inference and overrides, which I think should be its own separate test
class in its own CL.
Change-Id: I7ff6787f6a0c343e7948bd6152acc7d579af4afb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198742
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Change-Id: If3a0e3ea3f0f0e4465bf8f875071c92c674600c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197167
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Michael Thomsen <mit@google.com>
I noticed that in the Flutter framework, `@protected` members are called from outside of instance methods. @Hixie responded:
> protected allows access from the same file
I think this should be documented.
Closes https://github.com/dart-lang/sdk/pull/45937https://github.com/dart-lang/sdk/pull/45937
GitOrigin-RevId: c1a86d4039aeaa5a2126b505cad28e10fe361b0a
Change-Id: If0be693897abe10197516bdf854ec45fcb1be7fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198480
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Safari has a bug that makes it a syntax error for a function name
to overlap with names of parameters in functions with default
parameter values.
This CL changes DDC to generates code to circumvent this issue
when emitting top-level methods. Fortunately, the Safari bug
doesn't trigger with ES6 methods, so we don't need to do anything
for Dart instance methods.
The only other occurrence of named functions in DDC are
`function*` generators that we emit. Those take no arguments,
so we don't need any additional renaming there.
Fixes#43520
Change-Id: I2e4588701a294a8f3c5b47956826ada4ed973e6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198200
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
The compounds transformation converting fields into getters and setters
now retains the annotations on the getters so that they can be read
during recompilation.
This splits up `_replaceFields` into `_findFields` and `_replaceFields`.
`_findFields` works for both transformed and non-transformed compounds.
This splits up `_compoundClassDependencies` out from
`_checkFieldAnnotations`. The former is run on all compounds
transitively reached from the compounds being compiled, the latter only
on the compounds being (re)compiled.
`manualVisitInTopologicalOrder` now visits compounds from all libraries,
not just the ones in the libraries being (re)compiled. It is responsible
for filling the `compoundCache` in topological order. And, this CL
introduces the `InvalidNativeTypeCfe` to support processing compounds
with invalid fields, which might be nested later in other compounds.
Bug: https://github.com/dart-lang/sdk/issues/45899
TEST=pkg/front_end/testcases/incremental/crash_05.yaml
TEST=tests/ffi(_2)/*
Change-Id: I07a2214fd460f4d5e6a84df81e8b140dd80401dc
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm64-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
Fixed: 45899
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198281
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
This is a reland of 4e34ea06a9TBR=athom@google.com
Original change's description:
> [pkg/test_runner] Write experiments to results.json
>
> Change-Id: I32423ddf665a24443de1ad60ca8f323f5c6d3aca
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196489
> Reviewed-by: Alexander Thomas <athom@google.com>
> Commit-Queue: Karl Klose <karlklose@google.com>
Change-Id: I894616f77cb47df25c8da46d2bf6ddb87734db41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198404
Reviewed-by: Karl Klose <karlklose@google.com>
Commit-Queue: Karl Klose <karlklose@google.com>
This reverts commit 4e34ea06a9.
Reason for revert: The data does not show up in bigquery
Original change's description:
> [pkg/test_runner] Write experiments to results.json
>
> Change-Id: I32423ddf665a24443de1ad60ca8f323f5c6d3aca
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196489
> Reviewed-by: Alexander Thomas <athom@google.com>
> Commit-Queue: Karl Klose <karlklose@google.com>
TBR=karlklose@google.com,athom@google.com
Change-Id: Ifccdf3a6031dd55bebfe5d282bcce21c5ab5632a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198403
Reviewed-by: Karl Klose <karlklose@google.com>
Commit-Queue: Karl Klose <karlklose@google.com>
Change-Id: I32423ddf665a24443de1ad60ca8f323f5c6d3aca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196489
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Karl Klose <karlklose@google.com>
This reverts commit ef0e4ea107.
Reason for revert: Flutter HHH and golem builds are red. Rolls to Flutter are failing.
TEST=N/A
Original change's description:
> [ VM / DDS / CLI ] Add DevTools support to the standalone VM
>
> Example output on stdout when DevTools is enabled:
>
> Observatory listening on http://127.0.0.1:8181/CzkZzZaONW4=/
> The Dart DevTools debugger and profiler is available at: http://127.0.0.1:8181/devtools/#/?uri=ws%3A%2F%2F127.0.0.1%3A8181%2FCzkZzZaONW4%3D%2Fws
> hello world!
>
> vm-service: isolate(1674461414267555) 'main' has no debugger attached and is paused at exit. Connect to Observatory at http://127.0.0.1:8181/CzkZzZaONW4=/ to debug.
>
> TEST=pkg/dartdev/test/commands/run_test.dart
>
> Change-Id: Icd1afda87ad4a46f228125d53094d10adf8056ec
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188361
> Commit-Queue: Ben Konyi <bkonyi@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I50e8dc4e592e13b44c2fb980b2029d5c5cc3ad2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198381
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Added user tags for profiling and started tracking the distribution of
completion times.
Change-Id: I57153aa550787535ee955359a810cabbdee1941b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198360
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
A multitest section marked "dynamic type error" or "checked mode
compile time error" didn't actually do anything. It was silently treated
as "ok", which makes for a very confusing looking test.
Fixed the only remaining four tests that used "dynamic type error".
The other outcome was not used by any test.
Change-Id: I9727b3b524cf1effb0dd899bf206aa65dbd60803
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198180
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Because FFI inlindes contained Structs, changing for instance the
ordering of one class can change the size and position data in another
class. We thus have to disable experimental invalidation when the
changed class is an FFI class (e.g. a Struct).
At least for now that's done crudely by bailing if a changed library
explicitly or implicitly (via imports of libraries that export)
dart:ffi.
http://dartbug.com/45899
Bug: #45899
Change-Id: I2a72df6dace025511f3bbe3a816a8728b713a5e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198045
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
This CL creates a new test suite running through *.equivalence_info
(yaml) files where one specifies a number of files that are supposed to
parse 'the same' in the sense that it gives 'the same' listener events
modulo whatever the yaml file specifies is ok is not the same.
This could for instance - and is in the tests added here - be to not
include data after the parenthesis (as it often includes tokens),
ignoring `handleParenthesizedExpression` (as for instance `a < b` and
`(a < b)` should probably parse the same and ignoring
`handleRecoverableError`.
This might be a bit basic, but as future needs come up we can make this
fit our needs.
Change-Id: I4f5dfde9e916a95742f49e104fb5c751a8a9b921
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197381
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
In 3c83032c60
(https://dart-review.googlesource.com/c/sdk/+/195517)
a change inadvertently made it in that changed readAnnotationList from
always returning a constant empty list when the size was 0, to only
returning an (almost) constant list if the size was 0 and a non-default
setting was enabled.
In practise that meant that for normal runs we went from returning
a constant list when the size was 0 to returning a new empty list,
and the benchmarking system said
AstFromBinaryLazy (Intel Xeon): +33.2%
AstFromBinaryLazyP90 (Intel Core i5): +87.2%
AstFromBinaryLazyP90 (Intel Xeon): +117%
(i.e. generally much slower).
This CL restore the status quo and my local benchmarks says:
AstFromBinaryLazy(RunTimeRaw): -22.98% +/- 3.91%
AstFromBinaryLazyP50(RunTimeRaw): -6.20% +/- 5.03%
AstFromBinaryLazyP90(RunTimeRaw): -54.25% +/- 3.78%
Change-Id: Ia198cbbb0b2739f49a085435d98efb04740fa593
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198280
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Allows the method to be called in other places to get the normalized
type without emitting any code.
Change-Id: Ib05c27560f565a04cf48920f6a1eb392cfc5c82c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197901
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
This change extends VM-specific kernel transformations to handle
new AST invocation nodes. The transformations may still generate
old nodes, but they should accept and handle new nodes coming from
the front-end.
TEST=Manual testing with new invocation nodes enabled.
Issue: https://github.com/dart-lang/sdk/issues/45340
Change-Id: I2de9f0eb00fcf844ba62fdc93b15a907c2d6b69d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/197443
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>