mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-13 13:02:28 +00:00
LibWeb: Support wasm module instantiation using a global address
Fixes 1 WPT subtest in `wasm/core/simd`.
This commit is contained in:
parent
58c3a391a3
commit
76ee1ce04c
Notes:
github-actions[bot]
2025-07-25 13:36:40 +00:00
Author: https://github.com/gmta
Commit: 76ee1ce04c
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5602
4 changed files with 42 additions and 2 deletions
|
@ -342,8 +342,11 @@ JS::ThrowCompletionOr<NonnullOwnPtr<Wasm::ModuleInstance>> instantiate_module(JS
|
|||
// 3.5.1.7. Set the surrounding agent's associated store to store.
|
||||
address = cache.abstract_machine().store().allocate({ type.type(), false }, cast_value);
|
||||
}
|
||||
// FIXME: 3.5.2. Otherwise, if v implements Global,
|
||||
// FIXME: 3.5.2.1. Let globaladdr be v.[[Global]].
|
||||
// 3.5.2. Otherwise, if v implements Global,
|
||||
else if (import_.is_object() && is<Global>(import_.as_object())) {
|
||||
// 3.5.2.1. Let globaladdr be v.[[Global]].
|
||||
address = as<Global>(import_.as_object()).address();
|
||||
}
|
||||
// 3.5.3. Otherwise,
|
||||
else {
|
||||
// 3.5.3.1. Throw a LinkError exception.
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
Harness status: OK
|
||||
|
||||
Found 4 tests
|
||||
|
||||
4 Pass
|
||||
Pass #1 Reinitialize the default imports
|
||||
Pass #2 Reinitialize the default imports
|
||||
Pass #3 Test that WebAssembly instantiation succeeds
|
||||
Pass #4 Test that WebAssembly instantiation succeeds
|
|
@ -0,0 +1,12 @@
|
|||
(function simd_linking_wast_js() {
|
||||
|
||||
// simd_linking.wast:1
|
||||
let $1 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x06\xab\x80\x80\x80\x00\x02\x7b\x00\xfd\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0b\x7b\x01\xfd\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0b\x07\x94\x80\x80\x80\x00\x02\x06\x67\x2d\x76\x31\x32\x38\x03\x00\x07\x6d\x67\x2d\x76\x31\x32\x38\x03\x01");
|
||||
|
||||
// simd_linking.wast:5
|
||||
register("Mv128", $1)
|
||||
|
||||
// simd_linking.wast:7
|
||||
let $2 = instance("\x00\x61\x73\x6d\x01\x00\x00\x00\x02\x92\x80\x80\x80\x00\x01\x05\x4d\x76\x31\x32\x38\x07\x6d\x67\x2d\x76\x31\x32\x38\x03\x7b\x01");
|
||||
reinitializeRegistry();
|
||||
})();
|
|
@ -0,0 +1,16 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>WebAssembly Web Platform Test</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<script src="../../../resources/testharness.js"></script>
|
||||
<script src="../../../resources/testharnessreport.js"></script>
|
||||
<script src="../js/harness/async_index.js"></script>
|
||||
|
||||
<div id=log></div>
|
||||
<script src="../js/simd/simd_linking.wast.js"></script>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue