bf3c8b8ff3
Use naming similar to the spec: "table" instead of "function table", "element segment" instead of "function table init". Change-Id: Ib1b6cdfa566f8bd00017ccedf9440084204f10ff Reviewed-on: https://chromium-review.googlesource.com/c/1273612 Commit-Queue: Ben Smith <binji@chromium.org> Reviewed-by: Andreas Haas <ahaas@chromium.org> Cr-Commit-Position: refs/heads/master@{#56545}
28 lines
835 B
JavaScript
28 lines
835 B
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.
|
|
|
|
// Flags: --wasm-lazy-compilation
|
|
|
|
load('test/mjsunit/wasm/wasm-constants.js');
|
|
load('test/mjsunit/wasm/wasm-module-builder.js');
|
|
|
|
var builder = new WasmModuleBuilder();
|
|
let q_table = builder.addImportedTable("q", "table")
|
|
let q_base = builder.addImportedGlobal("q", "base", kWasmI32);
|
|
let q_fun = builder.addImport("q", "fun", kSig_v_v);
|
|
builder.addType(kSig_i_ii);
|
|
builder.addElementSegment(q_base, true, [ q_fun ])
|
|
let module = new WebAssembly.Module(builder.toBuffer());
|
|
let table = new WebAssembly.Table({
|
|
element: "anyfunc",
|
|
initial: 10,
|
|
});
|
|
let instance = new WebAssembly.Instance(module, {
|
|
q: {
|
|
base: 0,
|
|
table: table,
|
|
fun: () => (0)
|
|
}
|
|
});
|