Commit 846790f1 authored by Thibaud Michaud's avatar Thibaud Michaud Committed by V8 LUCI CQ

[wasm] Cleanup wasm asm builtin wrappers

Split small chunks of assembly instructions into separate functions.
This makes the code easier to follow and to maintain, especially for
register allocation.

Drive-by: simplify stack-switching test.

R=ahaas@chromium.org

Bug: v8:12191
Change-Id: Id7544a3b2d16085540d9f1863a0eabd1f72f22bb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3461929Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79105}
parent e7821290
This diff is collapsed.
......@@ -27,7 +27,7 @@ load("test/mjsunit/wasm/wasm-module-builder.js");
.addBody([]).exportFunc();
let suspender = new WebAssembly.Suspender();
function js_import(i) {
return new Promise((resolve) => { resolve(42); });
return Promise.resolve(42);
}
// Wrap the import, instantiate the module, and wrap the export.
......@@ -97,7 +97,7 @@ load("test/mjsunit/wasm/wasm-module-builder.js");
]).exportFunc();
let suspender = new WebAssembly.Suspender();
function js_import() {
return new Promise((resolve) => { resolve(42); });
return Promise.resolve(42);
};
let wasm_js_import = new WebAssembly.Function(
{parameters: [], results: ['externref']}, js_import);
......@@ -143,7 +143,7 @@ load("test/mjsunit/wasm/wasm-module-builder.js");
let i = 0;
// The n-th call to the import returns a promise that resolves to n.
function js_import() {
return new Promise((resolve) => { resolve(++i); });
return Promise.resolve(++i);
};
let wasm_js_import = new WebAssembly.Function(
{parameters: [], results: ['externref']}, js_import);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment