This add the Expression-, Binary-, Cast-, NullAssert-, NullCheck-, List-
and RelationalMatcher and creates these during body building. The
IfCaseStatement is added to support propagation of these to the
inference visitor.
Change-Id: Ia9add15e504cb06af711efc1697a00b8e235e1a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263128
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
The benchmark reports per-element times for summing the elements of a typed-data List.
----
The VM implementation is quite good but it looks like there is still a little room for improvement since the views are 2x slower than a simple array.
dart compile exe:
TypedDataPoly.mono.array.2(RunTime): 1.9670880036279512 ns.
TypedDataPoly.A_V.array.2(RunTime): 4.392355 ns.
TypedDataPoly.A_V.view.2(RunTime): 5.730097499999999 ns.
TypedDataPoly.A_UV.array.2(RunTime): 4.455393750000001 ns.
TypedDataPoly.A_UV.view.2(RunTime): 5.811122500000001 ns.
TypedDataPoly.A_VUV.array.2(RunTime): 4.386336250000001 ns.
TypedDataPoly.A_VUV.view.2(RunTime): 5.7639675 ns.
TypedDataPoly.A_UVx5.array.2(RunTime): 4.62768 ns.
TypedDataPoly.A_UVx5.view.2(RunTime): 5.7099649999999995 ns.
TypedDataPoly.mega.array.2(RunTime): 5.272632499999999 ns.
TypedDataPoly.mega.mixed.2(RunTime): 5.62861 ns.
TypedDataPoly.mono.array.100(RunTime): 0.6455633088733822 ns.
TypedDataPoly.A_V.array.100(RunTime): 3.1558100965636964 ns.
TypedDataPoly.A_V.view.100(RunTime): 4.476973567105732 ns.
TypedDataPoly.A_UV.array.100(RunTime): 3.149724878714137 ns.
TypedDataPoly.A_UV.view.100(RunTime): 4.500062299750802 ns.
TypedDataPoly.A_VUV.array.100(RunTime): 3.1438380581862146 ns.
TypedDataPoly.A_VUV.view.100(RunTime): 4.499246259421757 ns.
TypedDataPoly.A_UVx5.array.100(RunTime): 3.1570175999999996 ns.
TypedDataPoly.A_UVx5.view.100(RunTime): 4.482889818440727 ns.
TypedDataPoly.mega.array.100(RunTime): 3.649420567570034 ns.
TypedDataPoly.mega.mixed.100(RunTime): 4.068594455581881 ns.
On the other hand, there is a massive performance tax for using UnmodifiableUint8ListView on the web, especially views of views.
https://github.com/dart-lang/sdk/issues/50255 discusses how this might be fixed.
compile js -O3:
TypedDataPoly.mono.array.2(RunTime): 2.209502118308509 ns.
TypedDataPoly.A_V.array.2(RunTime): 2.58625 ns.
TypedDataPoly.A_V.view.2(RunTime): 2.32 ns.
TypedDataPoly.A_UV.array.2(RunTime): 51.633530557495135 ns.
TypedDataPoly.A_UV.view.2(RunTime): 302.4986387561256 ns.
TypedDataPoly.A_VUV.array.2(RunTime): 52.19476512355694 ns.
TypedDataPoly.A_VUV.view.2(RunTime): 302.84394312113756 ns.
TypedDataPoly.A_UVx5.array.2(RunTime): 55.649763488505165 ns.
TypedDataPoly.A_UVx5.view.2(RunTime): 849.458699173131 ns.
TypedDataPoly.mega.array.2(RunTime): 59.75952192382461 ns.
TypedDataPoly.mega.mixed.2(RunTime): 142.7126082991336 ns.
TypedDataPoly.mono.array.100(RunTime): 0.9815000000000002 ns.
TypedDataPoly.A_V.array.100(RunTime): 1.1626947678735444 ns.
TypedDataPoly.A_V.view.100(RunTime): 1.2075 ns.
TypedDataPoly.A_UV.array.100(RunTime): 17.17602868362643 ns.
TypedDataPoly.A_UV.view.100(RunTime): 231.5 ns.
TypedDataPoly.A_VUV.array.100(RunTime): 16.85678073510773 ns.
TypedDataPoly.A_VUV.view.100(RunTime): 229.7 ns.
TypedDataPoly.A_UVx5.array.100(RunTime): 17.01657458563536 ns.
TypedDataPoly.A_UVx5.view.100(RunTime): 697.5524475524476 ns.
TypedDataPoly.mega.array.100(RunTime): 22.770700636942674 ns.
TypedDataPoly.mega.mixed.100(RunTime): 94.4 ns.
Change-Id: If8878efd4c57bbd87effcd1d3f1339bc0cffbd75
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264897
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
This refactors the member sort test so that this package does not depend on unpublished packages
(analysis_server, ...). This makes it possible to publish this package without having to have
local (non-git) modifications.
Change-Id: I52bdaa459c2e219f38ac930468647b4d7c4165e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265001
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
This reverts commit a9915dd268.
Reason for revert: build failures on android bots
Original change's description:
> [vm, gc] Add separate marking verification.
>
> This is separate from the other heap verification flags because they cause the scavenger to wait for the old-gen GC to finish, which can mask bugs in failing to apply the incremental barrier.
>
> TEST=ci
> Change-Id: Idec5087f316e6d7be9dd27c56ed636ee00d638d4
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264883
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>
TBR=rmacnak@google.com,asiva@google.com,dart-scoped@luci-project-accounts.iam.gserviceaccount.com
Change-Id: Ia104ca00f9e83608699c9ceac83e476da50a11b4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/265005
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
This is separate from the other heap verification flags because they cause the scavenger to wait for the old-gen GC to finish, which can mask bugs in failing to apply the incremental barrier.
TEST=ci
Change-Id: Idec5087f316e6d7be9dd27c56ed636ee00d638d4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264883
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
This change has been discussed for 8+ years and it would of course be preferred
to be added as an instance method, but since that is a breaking change I added it as an extension as discussed here:
https://github.com/dart-lang/sdk/issues/24644#issuecomment-1241695835
Change-Id: Iebb9f300e449920ae8891abac88f30b271321661
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258541
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
https://dart-review.googlesource.com/c/sdk/+/260760 added support for
Windows to `DynamicLibrary.process()` but forgot to update the dartdoc
comment.
Change-Id: Ic8533e4d1bb23009753bcdef446e2cfe49dea0f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264940
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Now that type parameters can occur nested within type literals there
is no reason to special-case type parameters. Now that we don't
consider type literals to be always constant, it is safe to remove
this extra check and handle type parameters the same as a generic
type literal containing a type parameter.
Change-Id: I887d162e20fd29f3285d73149927e51e1f1d1753
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264894
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Long ago Dart didn't support generic type literals and the deferred
loading algorithm assumed that in the ConstantCollector visitor. Now that Dart supports them, we need to ignore them if they get encountered.
Fixes#49851
Change-Id: I637f70a74bbe5ca8fc76c2f8ff79e97eeac19182
Fixed: 49851
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264884
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Change-Id: I1b8b806b975b259a8489e5637548c1ab6b0ce347
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264889
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Auto-Submit: Devon Carew <devoncarew@google.com>
Previously, if a variable with a generic type was null-checked, and
the migration engine did not add a question mark to the type of the
variable itself, e.g.:
f<T extends Object?>(T x) {
if (x == null) { ... }
}
Then the migration tool would erroneously consider the null check
unnecessary. It failed to account for the fact that the bound on the
generic type might be nullable.
This change fixes the tool so that it now properly accounts for the
bound on the generic type variable.
Bug: https://b.corp.google.com/issues/247496662
Change-Id: I2b131e75b7e3fc5db0b668f1064340d404442c82
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264501
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
This also fixes a couple nullability signatures in world.dart and class_set.dart
Change-Id: I11b383c312a2320ae4ea7bac36c46c3f80fb7e0e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264341
Reviewed-by: Nate Biggs <natebiggs@google.com>
Closes https://github.com/dart-lang/sdk/pull/50240
TEST=building for fuchsia and testing on Nest Hub device.
GitOrigin-RevId: 28a6d9d8654f81cdf86161b1fc884b289a035392
Change-Id: Ie84d7943ea0d874fe4e5b421ddf47b8f0a884628
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264640
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This rehabilitates language server support for Fuchsia.
This makes GnWorkspace more like PubWorkspace, not like BlazeWorkspace. The workspace is the location of `BUILD.gn` file (and is identical to the package, although I did not change this in this CL). And there must be also `.jiri_root` somewhere above it.
We don't look for `pubspec.yaml` files to decide that we have a new `ContextRoot`, instead we rely on `.dart_tool/package_config.json` created by `Pub` from `pubspec.yaml`. For GN, I had to specialize it to look for `BUILD.gn` files.
With this change `BUILD.gn` takes preference over any other signal, so we don't care if there are `pubspec.yaml` files.
Fixed: fuchsia:109640
Change-Id: I2277336bd377abb9d8c8c33529183e21b2f51c4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264280
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
* Use dartk as the default compiler for runtime=vm.
* Status file entries for checking for the `none` compiler now either
use dartk or are deleted.
Tested: Standard CQ and local testing.
Fixes: https://github.com/dart-lang/sdk/issues/50241
Change-Id: I7a08d3e491ae1c82a0348fb66ea7b557398f97e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264682
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
The snapshot is already available in the build directory, this makes the
test save up 11 times all the parse and warmup costs of loading the
compiler in the VM.
In aggregate, this made the test run in 5 seconds instead of 2 and half
minutes on my local desktop.
Change-Id: Ic0f1ef030b06467999fd0178b599de697f8ccc94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264730
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>