The sample wasn't working for the longest time.
Fixes:
- Null safety, and late fields.
- `dart pub` instead of `pub`.
- Use the new `NativeFinalizer` and `Finalizable` features.
Change-Id: I0a397abae511ab3f6762d1b2c4047226d15e36d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143804
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Michael Thomsen <mit@google.com>
The front-end variable initialization analysis considers a variable
definitely initialized if it's initialized in all `case` branches of an
"explicitly exhaustive" `switch` statement, i.e. a `switch` statement switching on an enum value where the `case` branches cover all variants
of the enum.
In order for the emitted Wasm code to validate according to the
flow-sensitive non-nullable locals validation scheme being discussed in
https://github.com/WebAssembly/function-references/issues/44 this
definite initialization must be reflected in the static control flow of
the Wasm code. Thus, such a switch statement must not have static
control flow exiting the switch statement through the (dynamically
unreachable) default case.
Change-Id: I53628d2c6e9690214ffb4c60498c4f2b895f33e7
Cq-Include-Trybots: luci.dart.try:dart2wasm-linux-x64-d8-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/245985
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Tested: Added flag to text output and updated expectation files
Change-Id: I44bb82242ad608b19894e22c41d8404c5003c2d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/245982
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Late fields start out holding a sentinel value and after they are initialized or assigned, never hold a sentinel value again.
This CL implements some removal of checks and loads based on this monotonic behaviour.
On two large Dart Angular apps, this reduces the number of late-instance-field checks by ~25%.
One app is 0.44% smaller, the other is 0.98% smaller.
The optimization_test.dart no longer forces `--disable-inlining` because that prevents the inlining that exposes the optimization opportunities.
Most tests already use `@pragma('dart2js:noInline')` to prevent inlining where relevant.
Change-Id: I2327a96e69191313ed6c07eabe94aa2962fb2648
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/246881
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Ensures that kernel dump info doesn't break the original dump info's behavior.
Change-Id: I9bfe22cea0d1a5597db9c98fe736f20369b80c82
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247122
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
1. We cannot just discard the LibraryContext instance, if there are
linked bundles loaded, we need to release them, otherwise the
byte store will keep it forever.
2. But we don't want to release them if there is a chance that there
are no other isolates that reference it. So, we release after reload.
Change-Id: I92e01b57e83466d4679718e23eebcbfdc70d5602
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247330
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Also include 'loadedBundles' into the textual dump.
Change-Id: Iba7bfe89dcb085bdcddcd20902d4148b9fa5095a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247325
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
- Rename to OrderedIndexed(Sink/Source)
- Add an interface to be shared with UnorderedIndexed(Sink/Source).
- Move 'reshape' logic into subclass.
Change-Id: I1f891aab961bde6685d77af342729ed6b5f31260
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247400
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Nate Biggs <natebiggs@google.com>
This CL consists of:
1) Moving most of the contents of `js_util_wasm_patch` to
`js_util_patch` and `js_helper`.
2) Addressing the inconsistencies between `js_util` and `js_util_wasm`.
3) Fixing a minor bug with nested `allowInterop` in
`js_util_wasm_optimizer`.
4) Removing hardcoded eval.
Change-Id: Ie43cdc91d344745ef9b40e273192b34af2a84138
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/246380
Commit-Queue: Joshua Litt <joshualitt@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
As a general push toward using more semantical types instead of general.
Change-Id: I26aac3572c4a77be7741aaf807a2aeeca93af6d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247321
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
It is not very useful to run Cider tests on Windows.
And we could just disable these tests on Windows.
But this kind of tests might be useful to verify the state of the
system in DAS, when we un-fork Cider and DAS implementations.
Change-Id: I4a7ed641cd750b7626427cdab5104c533ea5407e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247132
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
This allows us to see which files were read, unlinked summary created,
how many many references to data we have, how we discard data from the
byte store, how we discard libraries from LinkedElementFactory,
and linked summaries from the byte store, etc.
Change-Id: I4eb57d96db8e1f816e7b932b727a6a92e6b07248
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247244
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Bug: b/232495224
Change-Id: I3c9de9574637bbc114d42da9804ca77cf0d054f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247082
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
These are now covered by textual dumps.
Change-Id: I5521c437dbb438053b9dead44d0167e47d818477
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247246
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Prelude to adding kernel dump info tests
Change-Id: I9b349700ec422da3833ee08514946fcd9b7d9b30
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/246860
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Let me know if there's other information you think we should be
reporting or if this won't accurately capture the time it takes to
handle notifications.
Change-Id: I7c57316ad37bd6bb9add9ab6d27e6f3428f4b491
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247241
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Danny Tuppeny <danny@tuppeny.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Closes#49165
The empty string argument can be confusing to read since it is not clear
what it means. Allow omitting the argument entirely to default to an
empty path.
R=lrn@google.com
Change-Id: I05ca432a679a0df751a16d1beb241b14f80d4681
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/246988
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Lasse Nielsen <lrn@google.com>
Static class members could technically be mapped to a name with dots,
but in the early days of JSInterop we thought this was not necessary
since it could also be modeled as a top-level member or by adding
additional classes and exposing the member as a simple name on a deeper
class.
This invariant was assumed by DDC (which crashed if this was not the
case) and ignored by dart2js.
This change adds a static check to ensure both compilers act
consistenlty.
Fixes https://github.com/dart-lang/sdk/issues/27926
Change-Id: I20e59fbb75f0378a58ca88dc3910e079b4eeb7a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247180
Reviewed-by: Riley Porter <rileyporter@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
When generating the tear-off stub of a JSInterop method, dart2js
associated the full JSName as the target name, as opposed to a
target path. This meant that code like:
@JS('console.log')
external consoleLog(arg1, [arg2]);
main() => (consoleLog)(1);
Generated a tear-off with code like:
self[console.log](arg);
Instead of:
self.console.log(arg);
Fixes https://github.com/dart-lang/sdk/issues/49129
Change-Id: I7abb320ce790e2ce533031fefd3abc15f8958b5d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/246340
Reviewed-by: Stephen Adams <sra@google.com>
On ia32 the kernel service runs from .dill file instead of app-jit
snapshot which makes it already slow (even more so in debug mode because
we run e.g. FlowGraphChecker).
The tests additionally use --optimization-counter-threshold flags,
causing more optimized compilations which makes it even slower.
=> Give tests more time.
TEST=ci
Change-Id: If09b4eb0971fed0c4572373598bbf171f4452eb2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247083
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
This CL splits the OmittedTypeBuilder into two concrete subclasses:
1) ImplicitTypeBuilder for omitted types that are not inferred. For
instance omitted types in function types. These always build the
`dynamic` type.
2) InferableTypeBuilder for types that can be inferred. The
inference is provided by an Inferable object which define how the
inference is performed. For instance SourceFieldBuilder implements
Inferable to implement the field type based on the initializer and
DeclaredSourceConstructorBuilder implements Inferable to implement
the initializing formal types through the field types.
With this change, implicitly typed fields are no longer registered
directly, but are instead handled through the InferableTypeBuilder.
Change-Id: I06e153015de89802d7151941d480d6506347c732
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/247080
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>