Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(777)

Side by Side Diff: test/mjsunit/wasm/gc-buffer.js

Issue 2424623002: [wasm] Use a Managed<WasmModule> to hold metadata about modules. (Closed)
Patch Set: [wasm] Use a Managed<WasmModule> to hold metadata about modules. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/mjsunit/regress/wasm/regression-02256b.js ('k') | test/mjsunit/wasm/indirect-calls.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Flags: --expose-wasm --stress-gc --expose-gc
6
7 load("test/mjsunit/wasm/wasm-constants.js");
8 load("test/mjsunit/wasm/wasm-module-builder.js");
9
10 function run(f) {
11 // wrap the creation in a closure so that the only thing returned is
12 // the module (i.e. the underlying array buffer of WASM wire bytes dies).
13 var module = (() => {
14 var builder = new WasmModuleBuilder();
15 builder.addImport("the_name_of_my_import", kSig_i_i);
16 builder.addFunction("main", kSig_i_i)
17 .addBody([
18 kExprGetLocal, 0,
19 kExprCallFunction, 0])
20 .exportAs("main");
21 print("module");
22 return new WebAssembly.Module(builder.toBuffer());
23 })();
24
25 gc();
26 for (var i = 0; i < 10; i++) {
27 print(" instance " + i);
28 var instance = new WebAssembly.Instance(module, {the_name_of_my_import: f});
29 var g = instance.exports.main;
30 assertEquals("function", typeof g);
31 for (var j = 0; j < 10; j++) {
32 assertEquals(f(j), g(j));
33 }
34 }
35 }
36
37 (function test() {
38 for (var i = 0; i < 3; i++) {
39 run(x => (x + 19));
40 run(x => (x - 18));
41 }
42 })();
OLDNEW
« no previous file with comments | « test/mjsunit/regress/wasm/regression-02256b.js ('k') | test/mjsunit/wasm/indirect-calls.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698