Ryan Macnak
6fe15f6df9
[vm] Represent tagged pointers as C++ value types instead of C++ pointer types.
...
This works around bugs in UndefinedBehaviorSanitizer and Clang.
Bug: b/28638298
Change-Id: I6be595f9664516019d28017d24559583a1ae3a21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144354
Commit-Queue: Ryan Macnak <rmacnak@google.com >
Reviewed-by: Vyacheslav Egorov <vegorov@google.com >
2020-04-25 05:21:27 +00:00
Liam Appelbe
26c49d5578
[vm] Wasm memory exports, and emscripten hello world
...
I got the hello world wasm file from the emscripten team and got it
running using a fake implementation of WASI's fd_write function. This
necessitated adding support for memory exports.
Bug: https://github.com/dart-lang/sdk/issues/37882
Change-Id: I139a4e868d437e2232bf4260e5cc26d8c598ac2c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119061
Commit-Queue: Liam Appelbe <liama@google.com >
Reviewed-by: Alexander Markov <alexmarkov@google.com >
2019-10-01 18:19:56 +00:00
Liam Appelbe
6da8c39c5a
[vm] Small WasmImports API change, and more WASM error tests
...
Bug: https://github.com/dart-lang/sdk/issues/37882
Change-Id: I3044d588398ccb19e3ebcebe6cd506b047a37857
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118601
Commit-Queue: Liam Appelbe <liama@google.com >
Reviewed-by: Alexander Markov <alexmarkov@google.com >
2019-09-27 23:36:11 +00:00
Liam Appelbe
d2a0900a50
Reland "[vm] Wasm function imports"
...
This reverts commit a7cb8ee88b .
Reason for revert: Fixed the crash
Original change's description:
> Revert "[vm] Wasm function imports"
>
> This reverts commit 7a24aec8f4 .
>
> Reason for revert: debug-mode gen_snapshot crashes on all programs
>
> Original change's description:
> > [vm] Wasm function imports
> >
> > Bug: https://github.com/dart-lang/sdk/issues/37882
> > Change-Id: Ia8aa9a87803d5e8b899ddab5479b8cd93e03fd71
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118204
> > Commit-Queue: Liam Appelbe <liama@google.com >
> > Reviewed-by: Ryan Macnak <rmacnak@google.com >
> > Reviewed-by: Alexander Markov <alexmarkov@google.com >
>
> TBR=rmacnak@google.com ,alexmarkov@google.com ,liama@google.com
>
> Change-Id: Ib5d348e25854af010b1d8a64a87406da443981df
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: https://github.com/dart-lang/sdk/issues/37882
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119143
> Reviewed-by: Samir Jindel <sjindel@google.com >
> Commit-Queue: Samir Jindel <sjindel@google.com >
TBR=rmacnak@google.com ,alexmarkov@google.com ,sjindel@google.com ,liama@google.com
Change-Id: I4fd073a087eae7bb95c75079446d9111e7bc8c40
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/37882
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119168
Reviewed-by: Liam Appelbe <liama@google.com >
Reviewed-by: Alexander Markov <alexmarkov@google.com >
Commit-Queue: Liam Appelbe <liama@google.com >
2019-09-27 21:29:12 +00:00
Samir Jindel
a7cb8ee88b
Revert "[vm] Wasm function imports"
...
This reverts commit 7a24aec8f4 .
Reason for revert: debug-mode gen_snapshot crashes on all programs
Original change's description:
> [vm] Wasm function imports
>
> Bug: https://github.com/dart-lang/sdk/issues/37882
> Change-Id: Ia8aa9a87803d5e8b899ddab5479b8cd93e03fd71
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118204
> Commit-Queue: Liam Appelbe <liama@google.com >
> Reviewed-by: Ryan Macnak <rmacnak@google.com >
> Reviewed-by: Alexander Markov <alexmarkov@google.com >
TBR=rmacnak@google.com ,alexmarkov@google.com ,liama@google.com
Change-Id: Ib5d348e25854af010b1d8a64a87406da443981df
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/37882
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119143
Reviewed-by: Samir Jindel <sjindel@google.com >
Commit-Queue: Samir Jindel <sjindel@google.com >
2019-09-27 12:22:58 +00:00
Liam Appelbe
7a24aec8f4
[vm] Wasm function imports
...
Bug: https://github.com/dart-lang/sdk/issues/37882
Change-Id: Ia8aa9a87803d5e8b899ddab5479b8cd93e03fd71
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118204
Commit-Queue: Liam Appelbe <liama@google.com >
Reviewed-by: Ryan Macnak <rmacnak@google.com >
Reviewed-by: Alexander Markov <alexmarkov@google.com >
2019-09-26 22:08:12 +00:00
Liam Appelbe
fd0a89971c
[vm] More wasm cleanup
...
Fix some VM/native transition issues, and add a describe() function that
prints all the imports and exports of a module.
Bug: https://github.com/dart-lang/sdk/issues/37882
Change-Id: I68a8860857c3fcb37c49a9e92731629a13fd9449
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118363
Reviewed-by: Ryan Macnak <rmacnak@google.com >
Commit-Queue: Liam Appelbe <liama@google.com >
2019-09-24 21:24:57 +00:00
Liam Appelbe
fd7e337dd6
[vm] Update wasmer and resolve a TODO.
...
Bug: https://github.com/dart-lang/sdk/issues/37882
Change-Id: Idee2f5383516e62ff3c228968c105835fcd954f3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118200
Reviewed-by: Ryan Macnak <rmacnak@google.com >
Commit-Queue: Liam Appelbe <liama@google.com >
2019-09-19 22:49:44 +00:00
Liam Appelbe
30d24335a8
[vm] Fix all wasm exception memory leaks
...
This involved refactoring so that all the throws happen in the top level native entry functions, and then making sure that all the native objects are accounted for in those locations. I ran the wasm tests under asan and verified they used to leak but now don't.
Bug: https://github.com/dart-lang/sdk/issues/37882
Change-Id: I9991ff6b9f8af1fa2f335c73ecf11aba29ea8c72
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117443
Commit-Queue: Liam Appelbe <liama@google.com >
Reviewed-by: Ryan Macnak <rmacnak@google.com >
2019-09-17 23:13:20 +00:00
Liam Appelbe
f7e0968955
[vm] Remove redundant classes from wasm.cc
...
These classes just thinly wrap wasmer objects, so we don't need them.
Bug: https://github.com/dart-lang/sdk/issues/37882
Change-Id: I06d715cc823c48101da3730ee68dd11adf5eb523
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117420
Commit-Queue: Liam Appelbe <liama@google.com >
Reviewed-by: Alexander Markov <alexmarkov@google.com >
2019-09-17 18:23:59 +00:00
Liam Appelbe
7505b3a5f0
[vm] Boilerplate for wasm types.
...
Follow up to https://dart-review.googlesource.com/c/sdk/+/117210 , which
was a quick fix to get the bots green. Since I've cut the FFI dependency
for the native type markers, wasm.cc needs to switch to using these new
classes, and we need boilerplate to associate them with some CIDs.
Bug: https://github.com/dart-lang/sdk/issues/37882
Change-Id: Ic64de8fd08b8a84476aeaacae3f57af3f278b8c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117292
Reviewed-by: Alexander Markov <alexmarkov@google.com >
Commit-Queue: Liam Appelbe <liama@google.com >
2019-09-17 16:38:19 +00:00
Liam Appelbe
ed9e89ea38
Implement a basic WASM API using wasmer.
...
Currently this only supports functions that take and return numeric
types. Byte arrays, and callbacks will come later, in a separate
wrapper package.
Bug: https://github.com/dart-lang/sdk/issues/37882
Change-Id: I7bb82be83cbbb6062736b3e958f89d021f1af4bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114586
Commit-Queue: Liam Appelbe <liama@google.com >
Reviewed-by: Samir Jindel <sjindel@google.com >
Reviewed-by: Ryan Macnak <rmacnak@google.com >
2019-09-13 18:25:16 +00:00
Liam Appelbe
05c28c6115
Reland "Scaffolding for dart:wasm"
...
This reverts commit 9198813a55 .
Reason for revert: Relanding with a fix
Original change's description:
> Revert "Scaffolding for dart:wasm"
>
> This reverts commit f39a3f188e .
>
> Reason for revert: https://golem.corp.goog/BuildInfo?target=flutter-profile&machine-type=android-armv7&revision=84750
>
> Original change's description:
> > Scaffolding for dart:wasm
> >
> > This CL doesn't have any tests because it's just boilerplate. I'll
> > add a test in the follow up CLs where I add actual functionality.
> >
> > Bug: https://github.com/dart-lang/sdk/issues/37882
> > Change-Id: I47c81f5f1be724f8226e756ba5d01880a45f1ac7
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112841
> > Reviewed-by: Siva Annamalai <asiva@google.com >
> > Reviewed-by: Liam Appelbe <liama@google.com >
> > Commit-Queue: Liam Appelbe <liama@google.com >
>
> TBR=asiva@google.com ,liama@google.com
>
> Change-Id: I0fd0f29d66a07fc29e840ddaec2d4161c8d599cb
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: https://github.com/dart-lang/sdk/issues/37882
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114044
> Reviewed-by: Liam Appelbe <liama@google.com >
> Commit-Queue: Liam Appelbe <liama@google.com >
TBR=asiva@google.com ,liama@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: https://github.com/dart-lang/sdk/issues/37882
Change-Id: Idb43cbd3a0521776ac420bfef91c8a9a4362f18e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114757
Reviewed-by: Liam Appelbe <liama@google.com >
Commit-Queue: Liam Appelbe <liama@google.com >
2019-08-28 23:11:21 +00:00
Liam Appelbe
9198813a55
Revert "Scaffolding for dart:wasm"
...
This reverts commit f39a3f188e .
Reason for revert: https://golem.corp.goog/BuildInfo?target=flutter-profile&machine-type=android-armv7&revision=84750
Original change's description:
> Scaffolding for dart:wasm
>
> This CL doesn't have any tests because it's just boilerplate. I'll
> add a test in the follow up CLs where I add actual functionality.
>
> Bug: https://github.com/dart-lang/sdk/issues/37882
> Change-Id: I47c81f5f1be724f8226e756ba5d01880a45f1ac7
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112841
> Reviewed-by: Siva Annamalai <asiva@google.com >
> Reviewed-by: Liam Appelbe <liama@google.com >
> Commit-Queue: Liam Appelbe <liama@google.com >
TBR=asiva@google.com ,liama@google.com
Change-Id: I0fd0f29d66a07fc29e840ddaec2d4161c8d599cb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/37882
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114044
Reviewed-by: Liam Appelbe <liama@google.com >
Commit-Queue: Liam Appelbe <liama@google.com >
2019-08-21 21:06:10 +00:00
Liam Appelbe
f39a3f188e
Scaffolding for dart:wasm
...
This CL doesn't have any tests because it's just boilerplate. I'll
add a test in the follow up CLs where I add actual functionality.
Bug: https://github.com/dart-lang/sdk/issues/37882
Change-Id: I47c81f5f1be724f8226e756ba5d01880a45f1ac7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112841
Reviewed-by: Siva Annamalai <asiva@google.com >
Reviewed-by: Liam Appelbe <liama@google.com >
Commit-Queue: Liam Appelbe <liama@google.com >
2019-08-21 19:55:04 +00:00