8000 [JSC] Enable more V8 wasm tests · WebKit/WebKit@9838d68 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9838d68

Browse files
committed
[JSC] Enable more V8 wasm tests
https://bugs.webkit.org/show_bug.cgi?id=251165 rdar://104657752 Reviewed by Saam Barati and Justin Michaud. Enable more V8 wasm tests to expand coverage. * JSTests/wasm/v8/anyfunc.js: (testAnyFuncIdentityFunction): * JSTests/wasm/v8/bit-shift-right.js: * JSTests/wasm/v8/bulk-memory.js: (TestIllegalNumericOpcode): Canonical link: https://commits.webkit.org/259405@main
1 parent bb61af8 commit 9838d68

File tree

7 files changed

+10
-68
lines changed

7 files changed

+10
-68
lines changed

JSTests/wasm/v8/anyfunc.js

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,4 @@
11
//@ requireOptions("--useBBQJIT=1", "--useWasmLLInt=1", "--wasmLLIntTiersUpToBBQ=1")
2-
//@ skip
3-
// Failure:
4-
// Exception: Object <Error(RuntimeError: Funcref must be an exported wasm function (evaluating 'instance.exports.main({'hello': 'world'})'))> is not an instance of <TypeError> but of <RuntimeError>
5-
// MjsUnitAssertionError@mjsunit.js:36:27
6-
// failWithMessage@mjsunit.js:323:36
7-
// assertInstanceof@mjsunit.js:563:22
8-
// checkException@mjsunit.js:498:23
9-
// assertThrows@mjsunit.js:518:21
10-
// testAnyFuncIdentityFunction@anyfunc.js:30:15
11-
// global code@anyfunc.js:34:3
12-
132
// Copyright 2019 the V8 project authors. All rights reserved.
143
// Use of this source code is governed by a BSD-style license that can be
154
// found in the LICENSE file.
@@ -27,7 +16,7 @@ load("wasm-module-builder.js");
2716

2817
const instance = builder.instantiate();
2918

30-
// assertThrows(() => instance.exports.main(print), TypeError);
19+
assertThrows(() => instance.exports.main(print), TypeError);
3120
assertThrows(() => instance.exports.main({'hello': 'world'}), TypeError);
3221
assertSame(
3322
instance.exports.main, instance.exports.main(instance.exports.main));

JSTests/wasm/v8/bigint-rematerialize.js

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
//@ requireOptions("--useBBQJIT=1", "--useWasmLLInt=1", "--wasmLLIntTiersUpToBBQ=1")
2-
//@ skip
3-
// Skipping this test due to the following issues:
4-
// call to %Is64Bit()
5-
// call to %OptimizeFunctionOnNextCall()
6-
// call to %PrepareFunctionForOptimization()
7-
82
// Copyright 2022 the V8 project authors. All rights reserved.
93
// Use of this source code is governed by a BSD-style license that can be
104
// found in the LICENSE file.
@@ -35,16 +29,14 @@ function f(x) {
3529
}
3630
}
3731

38-
%PrepareFunctionForOptimization(f);
3932
assertEquals(0n, f(1n));
4033
assertEquals(1n, f(2n));
41-
%OptimizeFunctionOnNextCall(f);
34+
for (var i = 0; i < 10000; ++i) {
35+
f(1n);
36+
f(2n);
37+
}
4238
assertEquals(0n, f(1n));
43-
assertOptimized(f);
4439
// After optimization, the result of the js wasm call is stored in word64 and
4540
// passed to StateValues without conversion. Rematerialization will happen
4641
// in deoptimizer.
4742
assertEquals(-1n, f(0));
48-
if (%Is64Bit()) {
49-
assertUnoptimized(f);
50-
}

JSTests/wasm/v8/bigint.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,4 @@
11
//@ requireOptions("--useBBQJIT=1", "--useWasmLLInt=1", "--wasmLLIntTiersUpToBBQ=1")
2-
//@ skip
3-
// Failure:
4-
// Exception: Failure:
5-
// expected:
6-
// contains ''value' must be a WebAssembly type'
7-
// found:
8-
// "WebAssembly.Global expects its 'value' field to be the string 'i32', 'i64', 'f32', 'f64', 'anyfunc', 'funcref', or 'externref'"
9-
// Looks like we need to change the expected exception.
10-
112
// Copyright 2018 the V8 project authors. All rights reserved.
123
// Use of this source code is governed by a BSD-style license that can be
134
// found in the LICENSE file.
@@ -172,7 +163,7 @@ load("wasm-module-builder.js");
172163
try {
173164
new WebAssembly.Global(argument);
174165
} catch (e) {
175-
assertContains("'value' must be a WebAssembly type", e.message);
166+
assertContains("expects its 'value' field to be the string", e.message);
176167
}
177168
})();
178169

JSTests/wasm/v8/bit-shift-right.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
//@ requireOptions("--useBBQJIT=1", "--useWasmLLInt=1", "--wasmLLIntTiersUpToBBQ=1")
2-
//@ skip
3-
// Skipping this test due to the following issues:
4-
// call to %WasmTierUpFunction()
5-
62
// Copyright 2022 the V8 project authors. All rights reserved.
73
// Use of this source code is governed by a BSD-style license that can be
84
// found in the LICENSE file.

JSTests/wasm/v8/bulk-memory.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,4 @@
11
//@ requireOptions("--useBBQJIT=1", "--useWasmLLInt=1", "--wasmLLIntTiersUpToBBQ=1")
2-
//@ skip
3-
// Failure:
4-
// Exception: Object <Error(LinkError: Invalid data segment initialization: segment of 2 bytes memory of 65536 bytes, at offset 65535, segment writes outside of memory (evaluating 'new WebAssembly.Instance(module, ffi)'))> is not an instance of <RuntimeError> but of <LinkError>
5-
//
6-
// Stack: MjsUnitAssertionError@mjsunit.js:36:27
7-
// failWithMessage@mjsunit.js:323:36
8-
// assertInstanceof@mjsunit.js:563:22
9-
// checkException@mjsunit.js:498:23
10-
// assertThrows@mjsunit.js:518:21
11-
// TestLazyDataSegmentBoundsCheck@bulk-memory.js:208:15
12-
// global code@bulk-memory.js:214:3
13-
142
// Copyright 2018 the V8 project authors. All rights reserved.
153
// Use of this source code is governed by a BSD-style license that can be
164
// found in the LICENSE file.
@@ -267,5 +255,5 @@ function getMemoryFill(mem) {
267255
assertEquals(false, WebAssembly.validate(builder.toBuffer()));
268256
assertThrows(
269257
() => builder.toModule(), WebAssembly.CompileError,
270-
/invalid numeric opcode: 0xfc790/);
258+
/invalid 0xfc extended op 1936/);
271259
})();

JSTests/wasm/v8/code-space-overflow.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
//@ requireOptions("--useBBQJIT=1", "--useWasmLLInt=1", "--wasmLLIntTiersUpToBBQ=1")
2-
//@ skip
3-
// Failure:
4-
// Exception: ReferenceError: Can't find variable: performance
5-
// global code@code-space-overflow.js:23:26
6-
72
// Copyright 2022 the V8 project authors. All rights reserved.
83
// Use of this source code is governed by a BSD-style license that can be
94
// found in the LICENSE file.
@@ -20,9 +15,9 @@
2015

2116
load("wasm-module-builder.js");
2217

23-
const start = performance.now();
18+
const start = Date.now();
2419
function time(name) {
25-
const ms_since_start = (performance.now() - start).toFixed(1).padStart(7);
20+
const ms_since_start = (Date.now() - start).toFixed(1).padStart(7);
2621
// print(`[${ms_since_start}] ${name}`);
2722
}
2823

JSTests/wasm/v8/instantiate-module-basic.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,4 @@
11
//@ requireOptions("--useBBQJIT=1", "--useWasmLLInt=1", "--wasmLLIntTiersUpToBBQ=1")
2-
//@ skip
3-
// Failure:
4-
// Exception: Failure:
5-
// expected:
6-
// contains 'Argument 0'
7-
// found:
8-
// "TypeError: first argument to WebAssembly.Instance must be a WebAssembly.Module (evaluating 'new WebAssembly.Instance(invalid_cases[i])')"
9-
// Looks like we need to update the exception strings.
10-
112
// Copyright 2015 the V8 project authors. All rights reserved.
123
// Use of this source code is governed by a BSD-style license that can be
134
// found in the LICENSE file.
@@ -96,7 +87,7 @@ assertFalse(WebAssembly.validate(bytes(88, 88, 88, 88, 88, 88, 88, 88)));
9687
let instance = new WebAssembly.Instance(invalid_cases[i]);
9788
assertUnreachable('should not be able to instantiate invalid modules.');
9889
} catch (e) {
99-
assertContains('Argument 0', e.toString());
90+
assertContains('first argument to WebAssembly.Instance must', e.toString());
10091
}
10192
}
10293
})();

0 commit comments

Comments
 (0)
0