dart-sdk/sdk/lib
Jess Lally 3c4d4ad450 Reland "[dart2wasm] Replace struct.new_default with struct.new for object allocation."
This reverts commit 67f0d4daf0, and further optimises constructor contexts by preventing empty contexts.

Reason for revert: Includes fix for Flutter engine unit test failures.

Fixes https://github.com/dart-lang/sdk/issues/53506

Original change's description:
[dart2wasm] Replace `struct.new_default` with `struct.new` for object allocation.

When using the `struct.new_default` instruction for object allocation,
fields are always nullable and mutable. By using the `struct.new`
instruction instead, class fields can now have the same mutability and
nullability in Wasm as declared in Dart. In addition, the class ID and
type parameters (which are also stored in an object's struct), can now
be immutable and nonnullable as well.

To do this, object construction is now split into three functions:
(1) Initializer: evaluates initializers for instance fields and
constructor initializers (this constructor before super constructor).
(2) Constructor body: executes the constructor body (super constructor
before this constructor), with `this` pointed to the constructed object.
(3) Constructor allocator: which calls (1), allocates the object using
`struct.new`, then calls (2).

Because fields now have the correct mutability and nullability in Wasm,
this removes unnecessary null checks for nonnullable fields, and may
allow for better optimisations by Binaryen.

Fixes https://github.com/dart-lang/sdk/issues/51492

Change-Id: I13499bdc412f474bc76473115b6e63d6954f4d23
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/326080
Reviewed-by: Ömer Ağacan <omersa@google.com>
Commit-Queue: Jess Lally <jessicalally@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2023-09-26 10:07:42 +00:00
..
_http Fix parsing of folded header field values. 2023-09-11 21:13:58 +00:00
_internal Reland "[dart2wasm] Replace struct.new_default with struct.new for object allocation." 2023-09-26 10:07:42 +00:00
_wasm [dart2wasm] Support initial value and literals for Wasm object arrays 2023-09-07 05:29:30 +00:00
async [vm] Treat Future.then(..., onError:...) as catch all handler 2023-08-31 11:47:54 +00:00
cli [vm] Disable dart:cli waitFor by default 2023-09-14 10:08:29 +00:00
collection Hide the existence of EfficientLengthIterable better. 2023-09-12 11:08:42 +00:00
convert Make utf8.encode() have Uint8List return type 2023-07-11 08:54:33 +00:00
core Hide the existence of EfficientLengthIterable better. 2023-09-12 11:08:42 +00:00
developer [vm/compiler] Tag non-ffi force-optimized functions idempotent. 2023-08-18 18:27:58 +00:00
ffi Reland "[ffi] NativeCallable.listener example." 2023-09-24 23:33:19 +00:00
html [dart:html] Fix incorrect parameter mention in drawImageScaledFromSource docs 2023-08-23 00:25:29 +00:00
indexed_db web_audio is not part sky_engine 2023-09-14 10:33:17 +00:00
internal Hide the existence of EfficientLengthIterable better. 2023-09-12 11:08:42 +00:00
io [doc/io] Sync Directory.rename()/renameSync() 2023-09-25 20:42:53 +00:00
isolate Mark packageConfigSync and resolvePackageUriSync as released in 3.2 2023-08-22 08:05:19 +00:00
js Reland "[pkg:js/dart:js_interop] Move annotations to dart:_js_annotations" 2023-05-02 15:24:18 +00:00
js_interop [dart:js_interop] Add/fix some js_interop helpers 2023-09-23 18:32:59 +00:00
js_interop_unsafe [dart:js_interop_unsafe] Rename extensions and make []/[]= take String properties 2023-09-12 23:11:55 +00:00
js_util [js_util] Make callMethod take an Object method. 2023-03-23 00:23:00 +00:00
math Adding class modifiers to dart:math. 2023-03-13 14:01:26 +00:00
mirrors [sdk docs] update sdk libraries to use triple slash docs 2023-03-14 19:10:25 +00:00
svg web_audio is not part sky_engine 2023-09-14 10:33:17 +00:00
typed_data [flip-modifiers]: Reapply "Enforce current library restrictions." 2023-03-03 09:37:38 +00:00
vmservice Make Iterable be the default implementation of itself. 2023-04-04 21:45:19 +00:00
web_audio web_audio is not part sky_engine 2023-09-14 10:33:17 +00:00
web_gl web_audio is not part sky_engine 2023-09-14 10:33:17 +00:00
web_sql web_audio is not part sky_engine 2023-09-14 10:33:17 +00:00
analysis_options.yaml [vm/ffi] Support varargs 2023-01-20 10:30:41 +00:00
libraries.json [dart2wasm] Make implementation libraries part of core to hide internals 2023-08-14 11:09:10 +00:00
libraries.yaml [dart2wasm] Make implementation libraries part of core to hide internals 2023-08-14 11:09:10 +00:00
PRESUBMIT.py
vmservice_libraries.json
vmservice_libraries.yaml