This enables us to upgrade our testing to use a newer version of d8.
Change-Id: I79a8879a325b9996b9923304439a3ee8fa5fa02a
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238345
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Implements memory access through the `Pointer`, `Struct` and `Union` FFI
types. `Pointer` supports `fromAddress`, `address`, `elementAt`, `cast`,
`value`, `ref` (only getter), `[]`, `[]=` (not for structs and unions),
`==` and `hashCode`. Structs and unions support getters and setters for
their members.
`Pointer`, `Struct` and `Union` are all represented as `i32`, both
internally and in imports and exports. They currently don't have any
boxed representation, which means they can't be nullable (a `Pointer`
can still contain `nullptr` - the C null) and can't be assigned to
supertypes (i.e. `Object`, `dynamic`, type variables), stored in
containers nor passed as arguments or return values of local functions
or function expressions. To pass an FFI value in these situations, box
it manually by storing it in a field.
For the FFI integer types, only the explicitly sized versions (e.g.
`Int8`, `Uint32`) are supported.
Whenever the feature is used, the module will import a memory by the
name "ffi.memory", which will be accessed by the operations.
This also adds an optional commandline argument to `run_wasm.js` to
specify the module containing the FFI code. When such a module is
specified, it will be instantiated first, and its exports will appear as
imports to the Dart module under the "ffi" module name.
Change-Id: Ie55b072056f972b42db6b75e0c676944bbe88c1a
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237686
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Subclasses of the _Function class are generated on the fly as fields
with function types are encountered. Therefore, this class must be early
in the initialization order.
Change-Id: Ia0b998c443af9f6bdb4af512f6da99e6e3767c1f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237681
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
This changes all mixins in the VM's hash map/set implementation to be
declared as mixins and introduces appropriate interfaces needed to
concisely express the prerequisites of the various mixins in the stack.
It also separates most of the implementation of immutable maps and sets
into mixins to enable sharing the implementation with dart2wasm.
Tested: ci + manual testing of dart2wasm
Change-Id: Ife1e7195aba35741629aa4dffedb929b1028a85a
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236180
Reviewed-by: Daco Harkes <dacoharkes@google.com>
This CL flips another 7 TryFinally tests to passing without introducing
any new failures.
Change-Id: I3064161f33db2fd16ae4f8d7eae4a904339d707b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/234220
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
WasmGC type definitions must all agree on whether they specify a
supertype or not.
This changes the exception tag function type to specify a supertype in
nominal mode to comply with this requirement.
Change-Id: I7bab0ceaa94c3b9098c2d517c0f91c6a19541dc9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/234920
Auto-Submit: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
These transformations are maintained by the VM team and keeping them
in pkg/kernel would put a burden on the CFE team after code reviews
are tightened to require OWNERS approval.
TEST=ci
Change-Id: I931033ba987d17a2c9c6d80a16dad09bfbaa0572
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/234905
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This adds constructors and conversion methods to the native Wasm int and
float types WasmI32, WasmI64, WasmF32 and WasmF64 to convert between
these and Dart int/double. This enables imports and exports to use the
native Wasm types to specify the Wasm function signature concisely.
Change-Id: I3ff459ad9c16574ac6186f753036acc17fa6814d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/234400
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
This CL adds support for try, catch, throw, and rethrow. In addition, it
adds stack trace support. If functions have names then these will print
in the stack trace.
This CL flips an additional 53 tests to passing(5241 -> 5294). 1 test
which was passing on TOT now crashes at compile time due to
a missing language feature which is now reachable through compilation of
a catch block. A number of other tests flip from runtime errors to
compile time crashes due to similar issues.
Note: TryFinally is implemented in the follow on.
Change-Id: I740dd25c4e062e1be2f50bbd18d1302575dff6f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/226808
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
Change-Id: I7d74013b27625d0a5d3e4d3d8f83aa4859fb4892
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/233303
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
This is work in progress. Several language features are still
unimplemented or only partially implemented.
Instructions for running the compiler and its output can be found in
pkg/dart2wasm/dart2wasm.md. These procedures are preliminary and
expected to change.
The best version of d8 to use for this version of dart2wasm is 10.0.40,
as explained here: https://dart-review.googlesource.com/c/sdk/+/232097
This commit also adds a dart2wasm-hostasserts-linux-x64-d8 testing
configuration to run the compiler over the test suite.
The history of the prototype that this is based on can be seen here:
https://github.com/askeksa-google/sdk/tree/wasm_prototype
Issue: https://github.com/dart-lang/sdk/issues/32894
Change-Id: I910b6ff239ef9c5f66863e4ca97b39b8202cce85
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175728
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>