When there is a shape change, class/library forwarding remains fused with the instance forwarding, and enum forwarding happens in a separate become operation.
TEST=ci
Bug: https://github.com/flutter/flutter/issues/131446
Change-Id: Iff2aacc664fbfcbc39c6aabd3698b413d18671cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317521
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
No functional change. By default, `_clone` re-uses the reachability of
`this`. The `reachable` argument allowed the caller to override that
default. However, the only call site that used it passed in
`this.reachable`, so there was no effect.
Change-Id: I2b08e29a724b35efc531f4bcfbc6ec4a2a2519d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317443
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
- Make Shape class final and more fields final.
- Add minor optimizations to `==`, `.hashCode` and `.toString`.
Cleans up or avoids a few issues I noticed while debugging some performance
regressions when calling Dart Core Object members on record values.
Change-Id: Ida7fdb5c562d03c03330e245e94c80321dc433c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317320
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
The uses the #type handle to pass the DartType in the message rather
than using the toString() method which doesn't give the desired result.
Change-Id: Iac17507643a9932570d5975a106a3ededc03f58c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316585
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
DartType.== was declared abstract, expecting subtypes to call
the `equals` method, but this was accidentally omitted for
ExtensionType.
This CL moves the implementation to DartType.== since it was called
with the same arguments in all subtypes, thus ensuring that new
DartType classes will get the correct equals by default.
Closes#53046
Change-Id: Ieaaf33ecb569ea7361ac338066a3a5760391e424
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316583
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
The `collectContexts(member)` already visits initializer lists when
visiting constructors, so no need to call it separately for
initializers.
Change-Id: Ida51a0e8c4003f19cd7b533a2847946926237bc0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317101
Commit-Queue: Ömer Ağacan <omersa@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
This renames InlineClass to ExtensionTypeDeclaration, and InlineType
to ExtensionType. Members of extension type declarations are called
extension type members instead of extension type declaration members
for "brevity".
TEST=existing
Change-Id: I91ed62533ddd345644492f04dc3310d007460288
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316780
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Flipped the ordering of the equality operation so that the compiler
can see it is being dispatched to a string literal and can generate
a faster check.
Change-Id: I5c2f6b123ebe0f6cb81efba94fe4bf81168bec74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317261
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reverting previous change since it does break some other parts of g3. Shortcircuiting the `??` isn't sufficient in some cases. So we attempt to fix it further downstream.
This change does a check for unresolved types and ignores the cast since we can't tell what type it is anyways. Similar to what we do with type parameters and when we don't know the type.
The generators in g3 seem to emit a lot more InvalidTypes and this is necessary to avoid the errors now that we propagate errors upwards.
b/293326927
Change-Id: I172980dfd3338f27d0a57e156b15dd937619ff73
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316841
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Since external APIs can only use primitives and JS types in static interop,
we should require that all type parameters on static interop APIs extend
another static interop type. This is the minimum required to ensure all
type parameters can be erased to JSValue. This only affects dart:js_interop
users and replaces the previous type parameter static error check.
Change-Id: Ia546874da73c808aa25deb8d54d581db783987df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316140
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Change-Id: Ida68ed3995c4db9be34fa0ce90b6683fc826f8a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315822
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Auto-Submit: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
- Updates test infra to use the assets built by the new "ddc" build
targets.
- The old "dartdevc" targets are still present to avoid breaking
golem when this change lands.
- Old targets are still used when packaging assets for the SDK.
- Golem and the SDK packaging will be updated in following changes.
Change-Id: I1926e0c86833c812f5ed8355d7cd4df8740d79ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/315224
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
This CL mostly just moves code around. There are three broad changes in this CL:
1) Reify the builder / built pattern that exists implicitly in the existing code. Builders now live in `src/builder`, while the built ir lives in `src/ir`.
2) Reify the module subsections.
3) `pkg/dart2wasm` has been updated to use the new API.
There is only one minor logic change in the entire CL, we now defer serialization of a module until the bytes are actually required, as opposed to serializing eagerly.
This change is designed to make the wasm_builder more robust. By clearly delineating which parts of the AST are mutable and which parts are immutable, then it should make it easier for users of the wasm_builder to avoid undefined behavior, i.e. holding on to something that can change.
Change-Id: I676107b867aa74fabf413108673e170126bdb5c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316280
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
And using Future from dart:core, which was not enabled until Dart
2.1.0.
Dart 3's minimum language version is 2.12. google3's is 2.9.
Change-Id: Id31d92007e685447ff217bdccf8161c8fd6ce6e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316863
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
This language feature allows type promotion to apply to private final
fields, e.g.:
class C {
final int? _x;
C(this._x);
}
f(C c) {
if (c._x != null) {
print(c._x.abs()); // (1)
}
}
Previously the line marked (1) would have needed to be written
`print(c._x!.abs());`.
Note that to ensure soundness, there are certain restrictions:
- Public fields don't undergo promotion (because a public field might
be overridden by a class in some other library).
- Non-final fields don't undergo promotion (because a non-final field
might be modified as a side effect of code executed between the type
test and the field's usage).
- Fields that are forwarded to `noSuchMethod` in the same library
don't undergo promotion (because there's no guarantee that
`noSuchMethod` will return the same value on every invocation). For
example:
class C {
final int? _x;
C(this._x);
}
class D implements C {
@override
noSuchMethod(...) => ...;
}
f(C c) {
if (c._x != null) {
print(c._x.abs()); // ERROR: `c._x` might dispatch to
// `D.noSuchMethod`, in which case there's
// no guarantee that it will return a
// non-null value the second time it's
// invoked.
}
}
- If two classes define fields or getters of the same name, and
promotion is not permitted for one of them, then it isn't permitted
for the other. This is because there might be a class in some other
library that's a subclass of both classes, causing a reference to
one field or getter to dispatch to the other. For example:
class C {
final int? _x;
C(this._x);
}
class D {
int? get _x => ...;
}
f(C c) {
if (c._x != null) {
print(c._x.abs()); // ERROR: `c._x` might dispatch to `D._x`
// (e.g. because some library might declare
// `class E extends D implements C`), in
// which case there's no guarantee that it
// will return a non-null value the second
// time it's invoked.
}
}
Change-Id: Ib9183581aa0194377e38ab70d37c3e9f0bb57a75
Bug: https://github.com/dart-lang/language/issues/2020
Tested: TAP global presubmit
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/314600
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
There's a false positive with the `prefer_const_constructors` lint where
deferred constant values in const constructors were not being reported
as an error.
This change adds the new error so that the lint doesn't fire.
Fixes https://github.com/dart-lang/sdk/issues/48991
Bug: https://github.com/dart-lang/sdk/issues/48991
Change-Id: I378093c02ec63e0c5eb5a1a8d80c1bbb0c88ba2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316842
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Previously, --suppress-core-dump option was inserted into the beginning
of the command line and was effectively passed to fssh, which
doesn't understand this option:
./third_party/fuchsia/sdk/linux/tools/x64/fssh --suppress-core-dump run fuchsia-pkg://fuchsia.com/dart_ffi_test_release#meta/fuchsia_ffi_test_component.cmx --sound-null-safety -Dtest_runner.configuration=vm-fuchsia-release-x64 --ignore-unrecognized-flags --packages=/pkg/data/.dart_tool/package_config.json --disable-dart-dev /pkg/data/tests/ffi/callback_unwind_error_test.dart
Instead, it should be passed as the first argument after 'run ...cmx':
./third_party/fuchsia/sdk/linux/tools/x64/fssh run fuchsia-pkg://fuchsia.com/dart_ffi_test_release#meta/fuchsia_ffi_test_component.cmx --suppress-core-dump --sound-null-safety -Dtest_runner.configuration=vm-fuchsia-release-x64 --ignore-unrecognized-flags --packages=/pkg/data/.dart_tool/package_config.json --disable-dart-dev /pkg/data/tests/ffi/callback_unwind_error_test.dart
TEST=ci
Cq-Include-Trybots: luci.dart.try:vm-fuchsia-release-x64-try
Change-Id: Id33a4c54478b872889dcdd7034e9dae6336a3ae8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316620
Reviewed-by: Liam Appelbe <liama@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: William Hesse <whesse@google.com>
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Fixes b/293426600
This synthetic procedure is added on every class with type args.
Mark it as synthetic so the JS interop checks don't trigger on
it.
Change-Id: I5b04fe4340b409a4ab1eb5c32e37fe6ff37df4b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316702
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
Auto-Submit: Srujan Gaddam <srujzs@google.com>
Turns out the old code was also checking for the presence of the DEPS file.
This is not necessary, it was only done as a safeguard in case we had multiple
folders with the same name lying around. We could add DEPS to the set of files
sent to the shard, but that seems unnecesary here.
Fixes#53059
Change-Id: I83fc2569f42117c5fc4ea90c651cd7627a21a9ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316700
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>