v8/test/mjsunit/regress/wasm/regress-1029642.js
Camillo Bruni a345a442d3 [d8][mjsunit][tools] Improve d8 file API
- Add d8.file.read() and d8.file.execute() helpers
- Change tools and tests to use new d8.file helper
- Unify error throwing in v8::Shell::ReadFile

Change-Id: I5ef4cb27f217508a367106f01e872a4059d5e399
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2928505
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74883}
2021-06-01 13:37:57 +00:00

68 lines
2.3 KiB
JavaScript

// Copyright 2019 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --wasm-staging
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
d8.file.execute('test/mjsunit/wasm/wasm-module-builder.js')
const builder = new WasmModuleBuilder();
builder.addMemory(0, 0, false);
builder.addType(makeSig([kWasmF32, kWasmF32, kWasmF64], [kWasmF64]));
// Generate function 1 (out of 1).
builder.addFunction(undefined, 0 /* sig */)
.addBodyWithEnd([
// signature: d_ffdl
// body:
kExprLoop, kWasmF64, // @15 f64
kExprLoop, kWasmF64, // @17 f64
kExprF64Const, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
kExprF64Const, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
kExprF64Const, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
kExprF64Const, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
kExprI32Const, 0,
kExprIf, kWasmF64, // @251 f64
kExprLoop, kWasmF64, // @253 f64
kExprI32Const, 0,
kExprIf, kWasmI32, // @267 i32
kExprMemorySize, 0x00,
kExprMemoryGrow, 0x00,
kExprElse, // @273
kExprF32Const, 0x00, 0x00, 0x00, 0x00,
kExprI32SConvertF32,
kExprEnd, // @282
kExprDrop,
kExprF64Const, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
kExprI32Const, 0x00,
kExprBrIf, 0x01, // depth=1
kExprI32SConvertF64,
kExprF64SConvertI32,
kExprEnd, // @311
kExprElse, // @312
kExprF64Const, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
kExprEnd, // @322
kExprF64Max,
kExprF64Max,
kExprF32Const, 0x00, 0x00, 0x00, 0x00,
kExprF32Const, 0x00, 0x00, 0x00, 0x00,
kExprF64Const, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
kExprCallFunction, 0x00, // function #0: d_ffdl
kExprF64Max,
kExprF64Max,
kExprF64Max,
kExprI32Const, 0x00,
kExprF64SConvertI32,
kExprF64Const, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
kExprF64Max,
kExprF64Max,
kExprEnd, // @1374
kExprEnd, // @1375
kExprEnd, // @1376
]);
builder.addExport('main', 0);
builder.toModule();