Commit Graph

25 Commits

Author SHA1 Message Date
Jakob Kummerow
3aa4f05d0c [wasm-c-api] Roll bf31edf: Fix life times of host info
Host info used to be stored on the global reference underlying a Ref;
now it is stored in a JSWeakMap and hence tied to the lifetime of the
actual object on V8's heap.
Additionally, the internal metadata needed for C-API functions is now
stored on the SharedFunctionInfo and no longer overlaps with the host
info mechanism.

Bonus content:
Roll 6db391e: Remove a few more leftover uses of _enum types

Change-Id: Ibb1fa4b0dd5157fef15c030bac705a11aa3beaea
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1768368
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63400}
2019-08-26 14:28:51 +00:00
Jakob Kummerow
116cbea5ed [wasm-c-api] Roll 7865f7d: Expose possible traps during Instance::make
Change-Id: Iadc6fa94ac2b77a8a8b0f1dbf3c28fc97ff13930
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1765608
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63361}
2019-08-23 09:46:29 +00:00
Jakob Kummerow
2d17bf79d5 [wasm-c-api] Roll 3094fe2: Implement Global::get/set for refs
Change-Id: Ibab34553f1499bd5dee7cf7477284783cc0660fc
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1763534
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63318}
2019-08-21 15:54:59 +00:00
Jakob Kummerow
ec9bc860b4 [wasm-c-api] Roll 351b9b7: Support multiple return values
This just adds the upstream tests; our implementation already had support.

Change-Id: If8d340ebe79eae65d12164a01883482d521b8451
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1762287
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63280}
2019-08-20 14:48:14 +00:00
Jakob Kummerow
3b45da47cd [wasm-c-api] Roll 70a2889: Remove template meta-programming
This change is very mechanical:
own<Foo*> → own<Foo>
vec<Foo*> → ownvec<Foo>
As usual, everything in third_party/ is straight-up copied from upstream.

Change-Id: If5fabda99e2b281da6f2e71ce23a2f5b68aaac86
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1760815
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63263}
2019-08-20 09:35:35 +00:00
Jakob Kummerow
aadc5cc147 [wasm-c-api] Roll 35e1532: Properly support anyref
Change-Id: Ib28e408cb6046fd728ceff6e6bf4005a241664e2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1745340
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63247}
2019-08-19 13:39:00 +00:00
Jakob Kummerow
fa997a3ad3 [wasm-c-api] Roll to upstream 70be7c6
This contains the following upstream commits:

486d3fe: Rename DEBUG to WASM_API_DEBUG
8d8e37d: Explicitly number wasm_valkind_t
299ebe0: Fix underlying types for enums
70be7c6: Fix test
Change-Id: I692fb6c909e5211920438740d2c57ea7ee74ab12
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1745483
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63147}
2019-08-09 15:13:46 +00:00
Jakob Kummerow
5e46b285df [wasm-c-api] Roll dc8cc29: Implement stack trace API
Change-Id: Ic5145b7ba15ae58d15e2cc4511afc2f8c6d42ea0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1741654
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63132}
2019-08-08 20:44:42 +00:00
Jakob Kummerow
01d77d0356 [wasm-c-api] Roll 96d346c: Add ref equality
Also roll 0705a10: Comments

Change-Id: I9802283fa68093839286779503b6073122cbc8d7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1739369
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63108}
2019-08-07 09:18:33 +00:00
Jakob Kummerow
6d73ced600 [wasm-c-api] Drop Isolate::Enter/Exit calls...
...from the Store constructor/destructor. They were preventing embedders
from using several Stores with overlapping but non-nested lifetimes.
Without Isolate::Enter, such use cases are supported; the only consequence
is that Isolate::Current will not work and therefore must not be called;
but it is deprecated and not called from the Wasm C API anyway.

Change-Id: I65eda00243126e189febb0fd8b38a953c4ee078f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1698387
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62692}
2019-07-12 18:51:32 +00:00
Jakob Kummerow
6f05773467 [wasm-c-api] Add test for traps
Change-Id: I51c25c3e41d11ac2419aac1041fe92192f8fdb9e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1698382
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62688}
2019-07-12 15:31:21 +00:00
Jakob Kummerow
37cb58b85f [wasm-c-api] Add test with multiple threads
Change-Id: Ie7a8b7fe22bed8092135c0e48cb681fbdd14b9fd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1698381
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62685}
2019-07-12 14:47:58 +00:00
Jakob Kummerow
f43944a222 [cleanup] Unify exports handling in WasmModuleBuilder
Change-Id: Id474294a808f5c77321cd12ff5333eb6000b04fa
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1692933
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62655}
2019-07-11 15:50:30 +00:00
Jakob Kummerow
b86a506d2d [wasm-c-api] Add test for Table operations
Change-Id: Id1c46ca22002c358155823e3caae18f0ed9c47f5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1691033
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62651}
2019-07-11 14:35:29 +00:00
Jakob Kummerow
c69c743166 [wasm-c-api] Add serialization test
Change-Id: I871659626b41a15723f92150f6f076d356313136
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1691028
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62639}
2019-07-11 11:46:02 +00:00
Jakob Kummerow
371dd417be [wasm-c-api] Add reflection test
Change-Id: I7bce20f1f8b0a2ca2fe86cd65905e9ea65134e27
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1691027
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62629}
2019-07-11 09:06:24 +00:00
Jakob Kummerow
a0da3d5465 [wasm-c-api] Add test for Memory
Change-Id: Ide762b9af9bd23d376025e9b3e6f5ccab7b0f1a5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1691026
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62600}
2019-07-09 12:49:18 +00:00
Jakob Kummerow
97c75d37ad [wasm-c-api] Add test for globals
Change-Id: I05bfc6eb98ea31b559d4195364e722ddf472afee
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1687677
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62571}
2019-07-08 14:24:56 +00:00
Clemens Hammacher
bcdf2e2a54 [wasm] Remove non-const arguments from module builder
R=ahaas@chromium.org

Bug: v8:9429, v8:9396
Change-Id: I2a66142c04b2ec0e3ed57ea2392dda6d17d53b38
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1687895
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62554}
2019-07-08 11:42:59 +00:00
Jakob Kummerow
89056f511c [wasm-c-api] Add finalization test
and make Foreign::make() functional.

Change-Id: Idca3affee5ee89f1774641c5b6475445aef25756
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1685792
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62506}
2019-07-03 12:02:47 +00:00
Jakob Kummerow
5fe29649cf [wasm-c-api] Add anyref support to functions
plus a test that calls a CAPI function directly from C++ (without
the detour through Wasm).
Anyref tables are still unsupported.

Change-Id: I450a6a75fde411da99691deab04c59a760a65a7d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1684076
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62489}
2019-07-02 13:22:27 +00:00
Jakob Kummerow
e304d80e09 [wasm-c-api] Faster C-to-Wasm entry
powered by a new function Execution::CallWasm and a corresponding,
Turbofan-generated CWasmEntry stub. This entirely sidesteps the
traditional Execution::Invoke -> JSEntryStub path.

Change-Id: If2b97825cca4ce927eecbddc248c64782d903287
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1660618
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62424}
2019-06-27 13:39:48 +00:00
Clemens Hammacher
cc21e58d30 [owners] Remove redundant OWNERS files in test/
We have a global test/OWNERS that has "file://COMMON_OWNERS".
This CL removes redundant OWNERS files in test/ subdirectories and
removes redundant entries from OWNERS files we need to keep for
special per-file entries.

R=yangguo@chromium.org, machenbach@chromium.org
CC=​​jkummerow@chromium.org

Bug: v8:9247
Change-Id: Ic2e8cbe8e379d7d23c86c6164305e65807f28ed3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1674024
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62336}
2019-06-24 12:44:32 +00:00
Jakob Kummerow
0d8945853a [wasm-c-api] Fix signature deserialization
Func::type() was broken for functions created with Func::make().

Change-Id: I2867bcf00d9e5c1488165a804598c9ca8081ff25
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1655648
Auto-Submit: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Tamer Tas <tmrts@chromium.org>
Reviewed-by: Tamer Tas <tmrts@chromium.org>
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62167}
2019-06-14 09:03:47 +00:00
Jakob Kummerow
f5ab7d38be [wasm-c-api] Add tests and fixes
In a new test suite: "wasm-api-tests", using a new binary "wasm_api_tests",
powered by gtest/gmock (like unittests).
Also fix a bunch of issues that these tests uncovered, mostly to ensure
that the stack is walkable.

Change-Id: I1d5604eea85da078ebecd4ebb7383647595f16ac
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1627539
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61885}
2019-05-28 09:57:04 +00:00