summaryrefslogtreecommitdiff
path: root/deps/v8/test/mjsunit/wasm/module-memory.js
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2019-11-08 15:39:11 +0100
committerMichaël Zasso <targos@protonmail.com>2019-11-08 15:46:25 +0100
commit6ca81ad72a3c6fdf16c683335be748f22aaa9a0d (patch)
tree33c8ee75f729aed76c2c0b89c63f9bf1b4dd66aa /deps/v8/test/mjsunit/wasm/module-memory.js
parent1eee0b8bf8bba39b600fb16a9223e545e3bac2bc (diff)
downloadandroid-node-v8-6ca81ad72a3c6fdf16c683335be748f22aaa9a0d.tar.gz
android-node-v8-6ca81ad72a3c6fdf16c683335be748f22aaa9a0d.tar.bz2
android-node-v8-6ca81ad72a3c6fdf16c683335be748f22aaa9a0d.zip
deps: update V8 to 7.9.317.20
PR-URL: https://github.com/nodejs/node/pull/30020 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'deps/v8/test/mjsunit/wasm/module-memory.js')
-rw-r--r--deps/v8/test/mjsunit/wasm/module-memory.js39
1 files changed, 16 insertions, 23 deletions
diff --git a/deps/v8/test/mjsunit/wasm/module-memory.js b/deps/v8/test/mjsunit/wasm/module-memory.js
index 3dd580d269..0f870e7815 100644
--- a/deps/v8/test/mjsunit/wasm/module-memory.js
+++ b/deps/v8/test/mjsunit/wasm/module-memory.js
@@ -18,18 +18,18 @@ function genModule(memory) {
// main body: while(i) { if(mem[i]) return -1; i -= 4; } return 0;
// TODO(titzer): this manual bytecode has a copy of test-run-wasm.cc
/**/ kExprLoop, kWasmStmt, // --
- /* */ kExprGetLocal, 0, // --
+ /* */ kExprLocalGet, 0, // --
/* */ kExprIf, kWasmStmt, // --
- /* */ kExprGetLocal, 0, // --
+ /* */ kExprLocalGet, 0, // --
/* */ kExprI32LoadMem, 0, 0, // --
/* */ kExprIf, kWasmStmt, // --
/* */ kExprI32Const, 127, // --
/* */ kExprReturn, // --
/* */ kExprEnd, // --
- /* */ kExprGetLocal, 0, // --
+ /* */ kExprLocalGet, 0, // --
/* */ kExprI32Const, 4, // --
/* */ kExprI32Sub, // --
- /* */ kExprSetLocal, 0, // --
+ /* */ kExprLocalSet, 0, // --
/* */ kExprBr, 1, // --
/* */ kExprEnd, // --
/* */ kExprEnd, // --
@@ -52,9 +52,7 @@ function testPokeMemory() {
var array = new Int8Array(buffer);
assertEquals(kMemSize, array.length);
- for (var i = 0; i < kMemSize; i++) {
- assertEquals(0, array[i]);
- }
+ assertTrue(array.every((e => e === 0)));
for (var i = 0; i < 10; i++) {
assertEquals(0, main(kMemSize - 4));
@@ -99,9 +97,7 @@ function testPokeOuterMemory() {
var array = new Int8Array(buffer.buffer);
assertEquals(kMemSize, array.length);
- for (var i = 0; i < kMemSize; i++) {
- assertEquals(0, array[i]);
- }
+ assertTrue(array.every((e => e === 0)));
for (var i = 0; i < 10; i++) {
assertEquals(0, main(kMemSize - 4));
@@ -139,33 +135,30 @@ function testOOBThrows() {
builder.addMemory(1, 1, true);
builder.addFunction("geti", kSig_i_ii)
.addBody([
- kExprGetLocal, 0,
- kExprGetLocal, 1,
+ kExprLocalGet, 0,
+ kExprLocalGet, 1,
kExprI32LoadMem, 0, 0,
kExprI32StoreMem, 0, 0,
- kExprGetLocal, 1,
+ kExprLocalGet, 1,
kExprI32LoadMem, 0, 0,
])
.exportFunc();
var module = builder.instantiate();
- var offset;
- function read() { return module.exports.geti(0, offset); }
- function write() { return module.exports.geti(offset, 0); }
+ let read = offset => module.exports.geti(0, offset);
+ let write = offset => module.exports.geti(offset, 0);
- for (offset = 0; offset < 65533; offset++) {
- assertEquals(0, read());
- assertEquals(0, write());
- }
+ assertEquals(0, read(65532));
+ assertEquals(0, write(65532));
// Note that this test might be run concurrently in multiple Isolates, which
// makes an exact comparison of the expected trap count unreliable. But is is
// still possible to check the lower bound for the expected trap count.
- for (offset = 65534; offset < 66536; offset++) {
+ for (let offset = 65534; offset < 66536; offset++) {
const trap_count = %GetWasmRecoveredTrapCount();
- assertTraps(kTrapMemOutOfBounds, read);
- assertTraps(kTrapMemOutOfBounds, write);
+ assertTraps(kTrapMemOutOfBounds, () => read(offset));
+ assertTraps(kTrapMemOutOfBounds, () => write(offset));
if (%IsWasmTrapHandlerEnabled()) {
assertTrue(trap_count + 2 <= %GetWasmRecoveredTrapCount());
}