This remove the [Space] class from the old algorithm and instead
encodes the patterns into the new model. The [Pattern] and
[Patterns] classes of the new model have been renamed to
[SingleSpace] and [Space], respectively, and a [Path] class is
added to track the path property used in the model of the new
algorithm.
Change-Id: I0c86c738807030be2f9b59f3aefb5bfcf5bbaeee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286501
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Fix test_runner's handling of tests passed as
relative native file paths to the test runner command.
Fix failing use of a special executable to test a crashing process.
Change-Id: I0837a0c2c4461883a604aa85083c3098dfbaae2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286821
Reviewed-by: Devon Carew <devoncarew@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: William Hesse <whesse@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Change from `List<_StringBase>` to `List<String>`, as that's what
`_getTypeNames` returns.
Change-Id: Ib216796eb0a105e81e45d6217c2a6ddb015129c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286923
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
This reverts commit c67fac9cb4.
Reason for revert: Regresses `dart:io` performance and causes
failures.
https://github.com/dart-lang/sdk/issues/51639
Original change's description:
> [vm] Remove tcmalloc and malloc profiler.
>
> The standalone VM originally began statically linking tcmalloc to work around bugs in the system malloc for Fiber. Later it used tcmalloc's hooks to implement a profiler, but this is rarely used since it is only available in debug mode, misses early allocations, and often misses late allocations from an exhausted sample buffer. Removing it altogether avoids build complexity around which combinations of compiler/architecture/sysroot support tcmalloc, and reduces binary size.
>
> TEST=ci
> Change-Id: I4b259e18b82b2d12a2a60962aabf83bd8d997d19
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286120
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
Change-Id: I4395edd6f5bd7e26b4e38f4d931ad2ea67afba18
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286925
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
This proved to be quite a bit more time consuming than I'd realized,
and it was a lot harder to verify the results than I would have
guessed.
But I think it made it easier to see holes in our location coverage
to have the tests split up this way. I decided not to fill those
holes in this CL in the hope that it's easier to see the
correspondence between the old tests and the new tests.
Change-Id: Ia73ce4367fc11ae78310f7ae182bf16591246597
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286871
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Changes:
- Instantiation context structs now have a common supertype:
`#InstantiationClosureContextBase`. This supertype is used to check if
a closure is an instantiation.
- Generic closure vtables now have one more entry for comparing types in
instantiation contexts.
- All instantiations with same number of types use the same context
struct type and the vtable entry for comparing types in contexts.
- `_Closure._equals` checks if closures are instantiations (with a type
test against `#InstantiationClosureContextBase`), and if they are,
gets the contexts and calls the function in the vtable for comparing
the types in the contexts.
Fixes#51030
Change-Id: I680041480963381337dcfa1fbf6c3a77ca564205
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/285902
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
We've changed const `==` to be based on primitive equality. It used to
just be an allowed list of concrete types, but now `==` is a valid
constant expression on any type that has primitive equality.
This change isn't directly part of patterns, but is enabled under the
same flag.
Update this test to the new semantics.
Change-Id: I484bd09f5775319dc49038d70a244c3c1564fe93
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286865
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
The standalone VM originally began statically linking tcmalloc to work around bugs in the system malloc for Fiber. Later it used tcmalloc's hooks to implement a profiler, but this is rarely used since it is only available in debug mode, misses early allocations, and often misses late allocations from an exhausted sample buffer. Removing it altogether avoids build complexity around which combinations of compiler/architecture/sysroot support tcmalloc, and reduces binary size.
TEST=ci
Change-Id: I4b259e18b82b2d12a2a60962aabf83bd8d997d19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286120
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Querying the thread clock takes the overwhelming majority of time when using the VM-internal recorders (ring, startup, endless, file). Including the thread clocks in the timeline allowed visualizing roughly how much an event got scheduled out, but not when. This is a high price to pay for such fuzzy information. Precise scheduling information is available from Fuchsia tracing, systrace or Signposts.
```
import "dart:developer";
main() {
var n = 1000000;
var watch = new Stopwatch()..start();
for (var i = 0; i < n; i++) {
Timeline.timeSync("EventName", () {});
}
print("${watch.elapsedMicroseconds.toDouble() / n} us/event");
}
```
--timeline_recorder=ring 2.751822 -> 0.487936 us/event (5.64x)
--timeline_recorder=systrace 0.440439 -> 0.435997 us/event
TEST=ci
Bug: https://github.com/flutter/flutter/issues/121372
Change-Id: Ib6d625f28384a4e87df2a3305483f0f6facd08ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286661
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
This contains support for all of the 3.0 language features. It also
contains a couple of very minor style changes. Unlike the previous
reverted roll (https://dart-review.googlesource.com/c/sdk/+/285460),
this does *not* contain the style change to support compact switch
statements. This should eliminate most of the style churn.
Change-Id: I95dd73a3a921b4a0cd278a7abb86daf8eea21397
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286701
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Change-Id: I139200ddbec0da456c38d495141b0122ed034a08
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286222
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
This test runs multiple timers with fixed timeouts and expects certain
order for timer handlers. Timers may not fire in order if the system is
under heavy load, which happens during isolate stress testing.
Change-Id: I5fc7f23f44496b2df57797463493a89b6c64f763
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286840
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Auto-Submit: Alexander Markov <alexmarkov@google.com>
This allows us report more specific errors.
Bug: https://github.com/dart-lang/sdk/issues/51505
Change-Id: I6e40af1fedce55886a58b954721154db933ede17
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286605
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This improves the exhaustiveness handling for null assert patterns
by extending the space of the subpattern with the null space. This
reflects the fact that null assert will throw on `null` and can
therefore be considered to cover that case.
Change-Id: If344eaaa55dcc70474f45519b53586e7d36e6e80
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286400
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
`hashCode` requires that equal objects have the same hash code.
However it doesn't (and cannot) require that inequal objects have
different hash codes. Remove the invalid check.
This makes the test pass on dart2wasm, which currently implements
closure hash code as:
// Simple hash code for now, we can optimize later
@override
int get hashCode => runtimeType.hashCode;
Note: this change alone does not make the whole file pass with
dart2wasm, there's another (unrelated) issue which will be fixed
separately.
Change-Id: Ibc83aee13fdbe48d1b2f7d8e720766b455c6b930
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286783
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
This reapplies commit 0c05e33836
and reverts the revert 029e0cec71.
Tested: Added few new tests, updated existing. Mainly regression testing.
CoreLibraryReviewExempt: Reviewed in original CL.
Change-Id: Ifcc79ce2f9375f607722643a04957b0961e6c295
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284304
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This fast path is never taken, because it's subsumed by the
even-faster path at the top of toString. When this function
is called, negSmi is always <= -100.
Tested: ci
Change-Id: I687fada0222b7815c41151b84c1ce4b1d312d6e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284260
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
- Only add type as input if the info doesn't have one. This was causing nulls to be added into implementations of `==` where they weren't being added before.
- Add a mechanism to avoid virtual targets for dynamic calls with specified selectors. Inference results suffer when virtual targets are used for the 3 specified selectors as these lead to intercepted calls that cannot be optimized out.
After this change in a big program there are 42 member type differences between the linearized and current algorithms in a program with ~84.5k member types. Some of those 42 are actually improvements on the current algorithm that we get since the new algorithm no longer imposes a refinement limit (except to catch non-converging types).
Change-Id: Ic15d95345e1e2fdc25aa74df00f72e1920fbd3a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/284860
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
- Avoid TLS initialization checks by using inline initialization.
- Avoid global offset table indirection by reducing -fPIC to -fPIE.
out/ReleaseXARM64/exe.stripped/dart_precompiled_runtime
11137992 -> 11274776 (-1.21%)
We still need -fPIC in some places because we build a few shared libraries for FFI, so copy some of Fuchsia's GN setup to use -fPIE or -fPIC as appropriate.
Account for older gcc that does not default to -fpie.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/51602
Change-Id: I85072153cb1aef9047c1adbf36c7496fbeb11e10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286221
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
This reverts commit 69b9559caf.
Reason for revert: Windows error: overflow in expression
Original change's description:
> Roll Clang from 20d06c833d83 to 28ee6040710f
>
> If this roll has caused a breakage, revert this CL and stop the roller
> using the controls here:
> https://autoroll.skia.org/r/clang-dart-sdk
> Please CC dart-engprod@google.com,dart-vm-gardener@grotations.appspotmail.com,dart-vm-team@google.com on the revert to ensure that a human
> is aware of the problem.
>
> To file a bug in Clang: https://bugs.fuchsia.dev/p/fuchsia/issues/list?q=component%3AToolchain
> To file a bug in Dart SDK: https://github.com/dart-lang/sdk/issues
>
> To report a problem with the AutoRoller itself, please file a bug:
> https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug
>
> Documentation for the AutoRoller is here:
> https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
>
> Cq-Include-Trybots: luci.dart.try:dart-sdk-linux-try;luci.dart.try:dart-sdk-mac-try;luci.dart.try:dart-sdk-mac-arm64-try;luci.dart.try:dart-sdk-win-try
> Change-Id: I433a87e0b7a2f8407ea3b8e23a1894957cfa23ac
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286580
> Commit-Queue: DEPS Autoroller <dart-autoroll@skia-public.iam.gserviceaccount.com>
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
Change-Id: I09a090a33fb663327eb74e5a192714673bcd661f
Cq-Include-Trybots: luci.dart.try:dart-sdk-linux-try;luci.dart.try:dart-sdk-mac-try;luci.dart.try:dart-sdk-mac-arm64-try;luci.dart.try:dart-sdk-win-try
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286608
Auto-Submit: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
These tests don't have a language version and so will get opted in when the flag is flipped, and need to be compatible.
TEST=only test changes
Change-Id: Idf49123e25c876102e6719ed3de8b475e80c8975
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286542
Reviewed-by: Alexander Aprelev <aam@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
TEST=Perfetto checks the __plusplus macro and reports an error when it
thinks a version prior to C++17 is being used. Perfetto was erroneously
reporting this error during the MSVC tryjob because we weren't setting
/Zc:__cplusplus. This change fixes the issue. See
https://ci.chromium.org/ui/p/dart/builders/try/vm-kernel-msvc-windows-try/146/overview
Change-Id: I6db00bec20936c0b1743bcb6e21b2c8f829097d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286220
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Derek Xu <derekx@google.com>
It is not used de-facto, and I don't know that we have semantics for it.
Change-Id: I450b164a96b1a16b89b85811e84338110abbae99
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/286342
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>