79a1468831
Changes: - Add possibility to define and emit all reference types. - Simplify function locals definition. - Change 'type' to 'type_index' where appropiate. Bug: v8:7748 Change-Id: Ie35a6204369e678298ee2ff2ec7c7793c5315c3e Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2390144 Commit-Queue: Manos Koukoutos <manoskouk@chromium.org> Reviewed-by: Thibaud Michaud <thibaudm@chromium.org> Cr-Commit-Position: refs/heads/master@{#69814}
28 lines
1.1 KiB
JavaScript
28 lines
1.1 KiB
JavaScript
// Copyright 2018 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.
|
|
|
|
load('test/mjsunit/wasm/wasm-module-builder.js');
|
|
|
|
const builder = new WasmModuleBuilder();
|
|
builder.addFunction(undefined, makeSig([kWasmI32, kWasmF32], []))
|
|
.addLocals(kWasmI32, 7)
|
|
.addBody([
|
|
kExprLocalGet, 0, // get_local
|
|
kExprI32Const, 0, // i32.const 0
|
|
kExprIf, kWasmStmt, // if
|
|
kExprUnreachable, // unreachable
|
|
kExprEnd, // end if
|
|
kExprLocalGet, 4, // get_local
|
|
kExprLocalTee, 8, // tee_local
|
|
kExprBrIf, 0, // br_if depth=0
|
|
kExprLocalTee, 7, // tee_local
|
|
kExprLocalTee, 0, // tee_local
|
|
kExprLocalTee, 2, // tee_local
|
|
kExprLocalTee, 8, // tee_local
|
|
kExprDrop, // drop
|
|
kExprLoop, kWasmStmt, // loop
|
|
kExprEnd, // end loop
|
|
]);
|
|
builder.instantiate();
|