Doesn't change anything in `front_end/*testcases/primary_constructors/`.
(Would have skipped any other file with `test` in its path and
an explicit language version marker, but there weren't any outside
of those `front_end` directories).
Almost no files used as test input were affected, and none testing the actual syntax changed.
The `.../nnbd/required_2.dart` test case was split into a legacy version retaining the `var`/`final` with a language marker, and a new version without the `var`/`final` cases.
The `pkg/analyzer/` tests, and any other tests that have source code
in strings, are not migrated by this CL.
Tested: No change to behavior. One test split into legacy and new.
Change-Id: I7f5aa4cc98001a9adecacd106c0b3be14f96be1c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/480542
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
- Add SSA HArrayFlags{Check,Get,Set} instructions to check for
fixed-length and unmodifiable JSArray and JavaScript typed data
instances.
- Add optimizations to remove redundant checks.
- Added HOutputConstrained interface for instructions that must have
the input and output in the same JavaScript variable. This
generalizes some code generation logic already applied to HCheck.
Bug: #53785
Change-Id: I61750dd03aa3a964eed3bc76e1656c5f60f77109
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372002
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Late fields start out holding a sentinel value and after they are initialized or assigned, never hold a sentinel value again.
This CL implements some removal of checks and loads based on this monotonic behaviour.
On two large Dart Angular apps, this reduces the number of late-instance-field checks by ~25%.
One app is 0.44% smaller, the other is 0.98% smaller.
The optimization_test.dart no longer forces `--disable-inlining` because that prevents the inlining that exposes the optimization opportunities.
Most tests already use `@pragma('dart2js:noInline')` to prevent inlining where relevant.
Change-Id: I2327a96e69191313ed6c07eabe94aa2962fb2648
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/246881
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
The single-entry / single-exit patterns of the CFG prevent inlined
throw statements and throw expressions from having exit edges like a
statement-level throw. If the join block is not reachable on one path
of a diamond, the condition can be substituted as if the join is on
the other path.
Change-Id: I9cc1058b4ca0cab892db7f1197141c5157d2bc5b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180724
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Index bounds checks are now added as part of lowering `[]`, `[]=` and
`removeLast()` rather that being added later in a separate pass.
To know when to add checks, new trust/check annotations have been
added:
@pragma('dart2js:index-bounds:trust')
@pragma('dart2js:index-bounds:check')
These default according to the `--trust-primitives` command-line
option.
In order to consult the annotations, the enclosing context of the
method call is tracked. This allows annotations to be applied correctly
when several methods with different annotations are inlined.
Change-Id: I22e1acf90b85ad0d100766b85a50095ced9815e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171632
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>