It was using class id as a hash for non-primitive values which led to
quadratic behavior on functions with large number of non-primitive
constants.
Instead start using the same hash which is used for canonicalization
of constants.
Fixes https://github.com/flutter/flutter/issues/150182
TEST=ci
R=alexmarkov@google.com
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-x64-try,vm-aot-dwarf-linux-product-x64-try,vm-aot-linux-release-arm64-try
Change-Id: I7ea19edd63b5b7698fda02adccf4fa7e2ebb4b13
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373661
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
wasm-opt doesn't optimize `0 < x || x > y` when y is known to be
positive (e.g. a positive integer constant), so we do it manually.
We also do it in a few places where `y` is not known to be positive in
the Wasm code, but we know it's always positive, for example when it's a
length.
Example improvement in the wasm-opt output:
```
(func $_newArrayLengthCheck (;426;) (param $var0 i64) (result i64)
local.get $var0
i64.const 2147483647
- i64.le_s
- local.get $var0
- i64.const 0
- i64.ge_s
- i32.and
- i32.eqz
+ i64.gt_u
if
i32.const 46
i32.const 0
@@ -19190,13 +19172,8 @@
i64.const 97
i64.sub
local.tee $var3
- i64.const 0
- i64.ge_s
- local.get $var3
i64.const 5
- i64.le_s
- i32.and
- i32.eqz
+ i64.gt_u
if
local.get $var0
local.get $var6
@@ -19810,10 +19787,10 @@
global.get $global4
array.new_fixed $Array<_Type> 2
)
```
Closes#56083.
Change-Id: Idb1dd0d0809b26be8aec3d082aa341c59e1a353d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373663
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
Includes the following commits:
- Rename members when they collide with return/parameter type names
- Update Web IDL to 3.49.0
- Add MAC_FF_META to KeyCode constants
- Account for static members in MDN docs
- Update doc comments, bump version to 1.0.0-wip
Change-Id: I0b87aa845af0ea093782d09a9a52abc09824d24a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373723
Commit-Queue: Kevin Moore <kevmoo@google.com>
Auto-Submit: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
The angled brackets are rendered as HTML.
Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: Id7afcd4f3825b9643ed50c48ad98c1201ba2405f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373760
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Sam Rawlins <srawlins@google.com>
Fixes https://github.com/dart-lang/sdk/issues/56100
Also privatize and inline some code.
Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: Ie9fea09cd719a62d2ef58373deaeb1fd43fa9cef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373601
Commit-Queue: Sam Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
I believe that we're computing the same values as we were before, but
the tests won't prove that. I couldn't think of any way to test this.
If you have any concerns and/or can think of a way to test it, do let me
know.
Change-Id: I489a2642b9b0345ad40fdc4afa9283eba5f65b3a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373581
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
After an instruction like `unreachable` or `throw`, stop generating
instructions until the end of the block.
This doesn't change wasm-opt output, but helps when debugging.
jsc test failures are probably because of
https://dart-review.googlesource.com/c/sdk/+/373240.
Closes#56082.
Change-Id: Iaa86c4eff3e1d5769667d9cdaa6de68f89c099ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373280
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
Work towards https://github.com/dart-lang/sdk/issues/56100
I also add a few other test cases that seemed to be missing.
Cq-Include-Trybots: luci.dart.try:flutter-analyze-try,analyzer-win-release-try,pkg-win-release-try
Change-Id: I6fdf8eae5bc68f51ec2908cbe108f73d56a65ff8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373620
Auto-Submit: Sam Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
In the previous version of this change, if the user had 'dart' on their
PATH and invoked 'dart compile js' (which spawns the VM service after
compilation completes), the VM service would attempt to spawn DDS using
'./dart' as the executable path instead of 'dart'. This would result in
DDS failing to start, causing the VM to print an error and hang.
This updated change checks to see if the parent directory of
`Platform.executable` is '.' and then verifies if './dart' exists or
not. If it doesn't, 'dart' is likely on the user's PATH and should be
used directly as the executable path.
See https://github.com/dart-lang/sdk/issues/56087 for details.
This reverts commit 4b88698e48.
TEST=pkg/dds/test/control_web_server_starts_dds_with_dart_on_path_test.dart
Change-Id: Id0f1dadd01d9202cbf7717f31393b43171cf3968
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373561
Auto-Submit: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
GetBlock has linear time complexity, so calling repetetively
might lead to quadratic complexity in pathological cases.
This avoids `GetBlock` in two places in the compiler:
- In EliminateEnvironments we were asking `current->GetBlock()`
while iterating instructions inside a known `block`. This
can obviously be short-circuited to just use that `block` directly.
- DelayAllocations we were calling `def->GetBlock()` and
`use->GetBlock()`
- `def->GetBlock()` is known because `def` is an instruction
inside the block which were currently iterating, which means we
can just use that block directly;
- `use->GetBlock()` can be computed by `DominantUse(...)` which
computes the `use` by iterating backwards from each use: during
this iteration we will either hit
a. a block entry - thus computing `use->GetBlock()`;
b. `def` - thus establishing that `use` is in the same
block as `def`; or
c. another use - which means this is not dominant use.
R=alexmarkov@google.com
Fixes https://github.com/flutter/flutter/issues/150182
TEST=ci
Cq-Include-Trybots: luci.dart.try:vm-aot-linux-debug-x64-try,vm-aot-dwarf-linux-product-x64-try,vm-aot-linux-release-arm64-try
Change-Id: If7dcd74c01236d3bca9499883b51d273764e739c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373502
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
This code isn't being called anywhere yet, but needs to be available in
order to allow us to convert the handlers over to using
`computeCandidateSuggestions` directly.
I've started wondering whether we want to rename `SuggestionCollector`
to something like `CompletionResult` to reflect the additional
information that it's starting to have and work that it's starting to
do.
Change-Id: Ib989b6649da2228c257fdc0e63f7013769fa2685
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373323
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
assertions
This matches the code pattern used elsewhere in this class as well as
the documentation for RemovingTransformer and brings it more in line
with the VM's unreachable code elimination.
Change-Id: Ica47f717be2bf72d84a7fbb2b78ad9cab1954407
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373440
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Since null safety, all static fields with initializers are implicitly
late. This change cleans up transition_sentinel which was used in
the detection of cyclic initialization of legacy static fields.
TEST=ci
Change-Id: I6a990dc8ba030f5bd40eb0b86706cbfb0f725e33
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373520
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Since `_` fields are binding, I think we want to treat `_`s like any other private field and report `UNUSED_FIELD`s accordingly.
These tests confirm that our current implementation is WAI.
Fixes: https://github.com/dart-lang/sdk/issues/55862
Change-Id: I2c8486a3b9e55d22c53989d74de974334477ec33
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373405
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
The docs are currently broken because the inherited docs contain
references to the parameter, `newLength`, but in the overridden
setters, there is no such parameter:
https://api.dart.dev/stable/3.4.4/dart-svg/NumberList/length.html
CoreLibraryReviewExempt: No-op.
Change-Id: I27388847109adeef66cdc1ef2e4faedeac5390d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372522
Commit-Queue: Sam Rawlins <srawlins@google.com>
Auto-Submit: Sam Rawlins <srawlins@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
The test uses the incremental compiler, and saves the previous one to
avoid compiling more than it has to. If a compile crashes though, the
incremental compiler will be left in a state where it thinks it's
currently compiling, and will have to wait for the previous compile to
finish. As it had crashed it won't, and we'll thus get a timeout on the
bot.
Here it's fixed by only saving it for next time once we're done.
Change-Id: I20a5ab20438a125487a95147e7a092f2129796a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373501
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
This moves SourceCompilationUnit methods only used in the OutlineBuilder
to a separate BuilderFactory interface.
Change-Id: I6bb270404c3c0e19856513674608c5d493f38924
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373500
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Allow comments to ignore some coverage block.
This is a step towards being able to (fake) push everything to 100%
covered, making a regression be nicely marked.
Also running `pkg/front_end/tool/coverage_merger.dart` with `--comment`
will add ignore comments.
Change-Id: I798dc2673eb71247af16356a7bd28d6629285a16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372501
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
These files should be further reorganized but that is for a
future CL.
Part of removing uses of 'fasta'.
Change-Id: I5010789b5901ba51c58d98fe26f13177b13c81b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373080
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>