Instead use external pointer block lists so that the same weakling can be pending for both minor and major GC at the same time. When we begin marking through new-space in major GCs, this will need to happen for weaklings in new-space. Once the pending lists are independent, it is easy to handle the reverse case. This also improves the promptness with which old-space weaklings with unreachable new-space targets are clear.
TEST=ci
Change-Id: I46a0a78eeae0210caad48a162c8d64a9af79e749
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/314863
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Enum forwarding requires evaluating and canonicalizing the new enum instances. If these in turn refer to other instances of classes with shape changes, canonicalization may try to compare instances of the old and new shapes and dereference past the end of an object. By waiting for instance morphing to complete, canonicalization can only see instances with the new shape.
Also, don't attempt to forward Enum.values. When an enum member is added or removed, this has the same merging problem as 40442.
Cf. bad074cc49.
TEST=ci
Bug: https://github.com/flutter/flutter/issues/129177
Change-Id: I19d0508059bade8496000eeea257bb0730f11d17
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316041
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Tested: CQ
Change-Id: I16210697b47dd85aec8743b457e773b044cab81f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316200
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
This CL lays the foundation for allowing us to emit instructions without finalizing imports, which will in turn enable more flexibility in code generation. For example, we will no longer need to do a pre-code generation pass to collect imports. In addition, it will pave the way for other optimizations as suggested in the `TODO` at the top of `instructions.dart`.
Perhaps counter-intuitively, even without any optimizations, this doesn't seem to be a measurable regression:
Before:
Completed compilation of dart2wasm-html-engine in 52652ms.
Completed compilation of dart2wasm-html-html in 51827ms.
Completed compilation of dart2wasm-html-ui in 20399ms.
Completed compilation of dart2wasm-canvaskit-canvaskit in 32899ms.
Completed compilation of dart2wasm-canvaskit-ui in 20695ms.
Completed compilation of dart2wasm-skwasm-ui in 20319ms.
After:
Completed compilation of dart2wasm-html-engine in 51476ms.
Completed compilation of dart2wasm-html-html in 48845ms.
Completed compilation of dart2wasm-html-ui in 19676ms.
Completed compilation of dart2wasm-canvaskit-canvaskit in 31933ms.
Completed compilation of dart2wasm-canvaskit-ui in 19733ms.
Completed compilation of dart2wasm-skwasm-ui in 19962ms.
Change-Id: Ib3740f88db56070fc3ccdde484675267e4bf40c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315580
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
This change adds the functions `mapLiteral` and `mapEntry` to the
"mini-ast" representation used for unit testing shared flow analysis
and type analysis logic. These can be used to model map literals with
explicit type arguments. Set/map literals without explicit type
arguments are not supported yet.
These functions replace the old `inContextMapEntry` method, which was
an alternative way of testing the type analysis behavior of map
literal entries (and was not yet being used). The new approach is
better in that it allows the test cases to follow the structure of
actual Dart code (map entries inside map literals) rather than just
testing map entries in isolation.
Change-Id: I4bfd31b8fb2865f3d0892da0a47ee0bdacaf9250
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315225
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Minor changes to find_builders.dart script to use pattern
matching, drop duplicate builders, and drop some type casts.
Change-Id: I463ba8352622dc66678aa71627d84130308da9a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315261
Reviewed-by: Daco Harkes <dacoharkes@google.com>
This adds checks for conflicting supertypes and prepares for computation
of extension type members.
Change-Id: If997fe84bac929274a6014b315ecea4f3856eedd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315441
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
- Introduces a new output subdirectory `gen/utils/ddc` where the
new build targets output files. This is intended to make the
migration to the new assets easier since landing this change
shouldn't immediately break any dependencies.
- Enables building the canary and stable assets at the same time.
- Changes more names in our workflow from "dartdevc" to "ddc".
- Updates the ddc-canary-linux-chrome and
ddc-canary-linux-chrome-unsound configurations to use the
new assets.
The new outputs appear in directories that are more consistently
named, (no more sound vs kernel confusion). They are named in
preparation for the eventual deletion of the unsound targets
without any lingering cruft to be cleaned up in the sound
directories.
The new structure is:
```
gen/utils/ddc/
|- canary
| |- pkg
| |- sdk
|- canary_unsound
| |- pkg
| |- sdk
|- stable
| |- pkg
| |- sdk
|- stable-unsound
|- pkg
|- sdk
```
The 'pkg' and 'sdk' directories all contain outputs with the same
files names, each compiled in the respective build modes
(sound/unsound and stable/canary).
Change-Id: I66822ebf03bba487b6d359a8e0aa818b9e7b6bef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313081
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
I suspect we ought to just remove many/all of the remaining simpler parser tests. I glanced at a few, and they do not seem specific to analyzer, so their covered features should be covered by parser tests in _fe_analyzer_shared.
https://github.com/dart-lang/sdk/issues/50702
Change-Id: I0e524562f6584145db5e80a154e72ea66090d924
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316042
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Improves performance of legacy mode apps in the new type system.
Change-Id: Ia884ea244741df5385271f43baa4125678b995ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315983
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
These are intended to be syntactic and not semantic in meaning, so I think has* is a better name.
Change-Id: Ia2a8a276c1057bde913eb755cc1a7a559d953774
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315960
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
A side effect of DDC's new shared runtime ('dart:_rti') is that previously @notNull-annotated code paths were being extraneously null-checked. This is partly responsible for the slowdowns in some internal mixed-mode apps found in testing.
Change-Id: I3f619cfd23688f3eb4ada0079ad1664d39a7e010
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315640
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
Found some methods that weren't being referenced anywhere, or they
weren't cleaned up. Removing because it's just dead code.
Change-Id: Id344d2d7cedd87468255a33fea75bfda97d10cac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316000
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
- Run the tests on the existing DDC bots.
- In the future we would like to move these to their own bots so
they can be triggered individually.
Change-Id: I2ab022f19323cdfd20f42ef5c41777547ec428f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313882
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Following the refactoring we started in previous CLs, this splits string
and int patch files into (1) patch files that only patch and don't add
implementation classes (2) files for implementation classes (3) helpers.
Changes:
- `string_patch` is split into `string.dart` and `string_patch.dart`.
- VM's `integers_patch.dart` copied as `int_patch.dart` and updated.
This was needed as `integers_patch` requires VM's library paths in
imports.
We needed to copy this file to be able to optimize based on
dart2wasm's implementation classes. However in this CL we copy the
file as-is and update import paths.
- VM's `string_buffer_patch.dart` copied to be able to use the string
implementation classes from the new library.
`string_buffer_create.dart` is merged ino `string_buffer_patch.dart`.
- `getHash` and `setHash` to set object identity moved to
`object_helper.dart`, to be able to use in string implementations.
- Redundant `new` keywords in copied files removed.
One TODO added in `string_buffer_patch.dart` when allocating a new
string to the buffer:
// _parts = _GrowableList.withCapacity(10)..add(str);
// TODO(omersa): Uncomment the line above after moving list
// implementations to a library.
_parts = [str];
We can enable the old code again after moving list implementations to a
library.
Change-Id: Ice5dba40b3ba894797028987d4b42cb0c0f0c230
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315821
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Whether the reordered objects fail to fit depends non-deterministically on the parallel worker speeds and the exact contents of new-space that vary with each VM or core library change.
Bug: https://github.com/dart-lang/sdk/issues/52936
Change-Id: I6e287d42b5ca77d2ffafd9a5a053118617d6fe51
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313940
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
When using the "mini-ast" pseudo-language to write unit tests for the
flow analysis and type analysis logic in the `_fe_analyzer_shared`
package, it is no longer necessary to use `.expr` to turn a `Var` into
an `Expression`; this now happens automatically. The way this works
under the hood is that the `Var` and `Expression` classes implement
the `ProtoExpression` interface; constructs that expect expressions
are declared with input parameters of type `ProtoExpression`, and they
automatically convert to `Expression`s when necessary.
Change-Id: I85c493145c3fc41a5296c1807cd63fe1401672db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315247
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This removes the substitutions from ClassHierarchyBuilder and moves
the checking of inheritance conflict to the ClassHierarchyNodeBuilder.
Change-Id: I87a943102ab644c3b50acb07defb156e686225d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315102
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
It's not guaranteed that a "terminate" request will get a response so this changes the helper to accept a "terminated" event as acknowledgement of termination too.
It also fixes some issues running individual tests that didn't set a CWD (by setting a default for tests, since we can't "dart run test:test" without a cwd), and also updates a breakpoint test to not send breakpoints on invalid lines (something that had been fixed in the CLI test, but not the Test test).
Fixes https://github.com/dart-lang/sdk/issues/53023
Change-Id: I19dd60eb2b6d56035bb4d5b02d8e90713a8ce42d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315823
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Also
* Make C++ offset_extractor binaries emit entire if/def condition
(including product vs non-product)
=> This makes it much nicer to look up offsets, as the preceding
#if condition will be the whole condition.
* Run the builds & offset extractions in parallel
This will make it easier to extend the cross product of our
configurations that require different offsets (e.g. sanitizers)
TEST=Manually run.
Change-Id: I458deb7a1c9403ab3624dd6b6ca51df72d6a6b28
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312442
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
It really looks like `_SubstitutedTypeParameters` factory
constructor assumes its `substitution` argument doesn't
include any of `elements` neither as a key, nor anywhere
it the result types. Since if it does contains a key from
`elements` that part of `substitution` will be lost, overriden by
`...substitution2.map` part of `Substitution.fromMap` call.
And if it has `elements` mentioned anywhere in values of the
`substitution` map, those won't be renamed.
But sometimes `_SubstitutedTypeParameters._SubstitutedTypeParameters`
is called with a `subtitution` that includes some of `elements`.
For example, that's what happens in both added tests.
I assume it never breaks, because the part of `substitution`
that acts on `elements` is trivial: just renaming a type
variable to a fresh name. And since `_SubstitutedTypeParameters`
just gets yet another fresh name for it, that works.
One small problem arises though if a type variable renamed by
`substitution` has a bound that references the type variable itself
(like `T extends Foo<T>`). In that case bound gets substituted with the
`substitution` first, so `substitution2` doesn't work on it anymore.
So we end up with an element `T0 extends Foo<T1>`, where `T0` and
`T1` and two different fresh names for `T`.
This commit changes the order of substitutions when handling bounds,
such that the part of `substitution` that substitutes `elements` is
effectively ignored. That agrees with the existing behavior of
rewriting this part of `substitution` in the result, so it shouldn't
make things worse.
Change-Id: I8f68c4342aad0c8f59f7c01a6cfac074946529ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312401
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Ilya Yanok <yanok@google.com>
The change in [0] has propagated now everywhere, so we can use
`utf8.encode()` instead of the longer `const Utf8Encoder.convert()`.
As the checked-in SDK has been rolled to include [0] we can now rely on
the better return type.
[0] https://github.com/dart-lang/sdk/issues/52801
TEST=ci
CoreLibraryReviewExempt: Minor cleanup.
Change-Id: I2c0144023e03b2c265582d83a7fb9469b02f1570
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313563
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
A script to find all try jobs for a set of tests.
Usage:
```
$ tools/find_builders.dart ffi/regress_51504_test ffi/regress_51913_test
Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-debug-x64,...
```
Change-Id: I85abd3ca2b2adf4e184a38f5ef821d40fbd97bf2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/314800
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: William Hesse <whesse@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
This reverts commit 43db92d9ed.
Revert "Tweaks for comments of classes around augmentations."
This reverts commit 6d0fb5094f.
Change-Id: I9508169158d536302579346defebf696edfe4bec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315660
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Define debugger runtime API so the debugger can display objects without knowing DDC implementation details.
- Add new DDC debugger runtime API in `debugger.dart`
- Add helpers for getting some type information in new and old type systems
- Add tests
Closes: https://github.com/dart-lang/sdk/issues/52773
Change-Id: I8efa4cacebb0d73ef58b5360979089cba2039379
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311154
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Anna Gringauze <annagrin@google.com>
Inline classes will be replaced with extension types.
Change-Id: I9472dfbb92f7f50a4649e6f1953481a9ac237fe3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/313284
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Currently all closure dynamic call entries have the same name. This
makes it difficult to find locations of crashes. Example:
wasm-function[677]:0x1de1d: RuntimeError: illegal cast
RuntimeError: illegal cast
at dynamic call entry (wasm://wasm/000909b2:wasm-function[677]:0x1de1d)
at method forwarder for 'call' (wasm://wasm/000909b2:wasm-function[583]:0x1b474)
...
With this we now add the function name before "dynamic call entry":
wasm-function[677]:0x1de1d: RuntimeError: illegal cast
RuntimeError: illegal cast
at C.m1 tear-off dynamic call entry (wasm://wasm/000921c6:wasm-function[677]:0x1de1d)
at method forwarder for 'call' (wasm://wasm/000921c6:wasm-function[583]:0x1b474)
...
Which makes it easy to find the function in .wat output as there is only
one function with the name "C.m1 tear-off dyamic call entry".
Change-Id: Iea726b695fc29b361a347b64194d5c09601a0999
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315440
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
We have disabled most legacy testing and keeping the old suites in sync
is no longer worth the effort.
Change-Id: Id2f60ef558225bfc16836ad9c11e4c5819717b45
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315401
Auto-Submit: Alexander Thomas <athom@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
In following CLs I plan to add `final` and `sealed` modifiers.
Change-Id: Ia6b9091034ed9f8f6f8576dbe6029d7e72a9d6b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315249
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
This marks all types without subtypes as final and all types with
subtypes as non-final. This makes the emitted types maximally final
and is appropriate for a closed-world module.
V8 currently ignores the finality of types for the temporary WasmGC
encoding, which make our current encoding work even though it
implicitly marks some types as final that shouldn't be. For the final
WasmGC instruction encoding, V8 is likely to reject modules containing
final types with subtypes.
Change-Id: If3030c49e8fe60fec8099b731b6fcf618d6a7e64
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310163
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Ömer Ağacan <omersa@google.com>
I did not change the content of the functions, except the following:
* modernized some variable declarations with `var`.
* added periods to the end of comments.
* privatized most methods.
Work towards https://github.com/dart-lang/sdk/issues/50702
Change-Id: I4d63d3ee847316b58fa76c12558767c0825027a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315243
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
the types phase.
Also seales the Code types hierarchy to block users from attempting to
create their own subclasses.
Bug: https://github.com/dart-lang/language/issues/3211
Change-Id: I51ebdfdad6e1fba3c19ef91f25e238730e98e740
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/314821
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>