237d21b2a4
* add functionality to wasm-module-builder.js to emit the module name in the name section. * extend WasmModule to store the module name length and offset. * add functionality to module-decoder.cc to decode the module name. * use the module name for printing stack traces. more uses should follow. * extend one message test to contain a module name. R=ahaas@chromium.org Change-Id: I94e6f1f2eb99cb656a92a85bb7afe0742292046f Reviewed-on: https://chromium-review.googlesource.com/530366 Reviewed-by: Andreas Haas <ahaas@chromium.org> Commit-Queue: Clemens Hammacher <clemensh@chromium.org> Cr-Commit-Position: refs/heads/master@{#45846}
16 lines
495 B
JavaScript
16 lines
495 B
JavaScript
// Copyright 2017 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: --expose-wasm
|
|
|
|
load("test/mjsunit/wasm/wasm-constants.js");
|
|
load("test/mjsunit/wasm/wasm-module-builder.js");
|
|
|
|
var builder = new WasmModuleBuilder();
|
|
builder.setName('test-module');
|
|
builder.addFunction(undefined, kSig_i_v)
|
|
.addBody([kExprUnreachable])
|
|
.exportAs('main');
|
|
builder.instantiate().exports.main();
|