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

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

Issue 2591753002: [wasm] Implement correct 2-level namespace for imports. (Closed)
Patch Set: Fix debug tests Created 4 years 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/wasm/gc-frame.js ('k') | test/mjsunit/wasm/globals.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Flags: --expose-wasm --stress-gc 5 // Flags: --expose-wasm --stress-gc
6 6
7 load("test/mjsunit/wasm/wasm-constants.js"); 7 load("test/mjsunit/wasm/wasm-constants.js");
8 load("test/mjsunit/wasm/wasm-module-builder.js"); 8 load("test/mjsunit/wasm/wasm-module-builder.js");
9 9
10 function run(f) { 10 function run(f) {
11 var builder = new WasmModuleBuilder(); 11 var builder = new WasmModuleBuilder();
12 builder.addImport("f", kSig_i_i); 12 builder.addImport("m", "f", kSig_i_i);
13 builder.addFunction("main", kSig_i_i) 13 builder.addFunction("main", kSig_i_i)
14 .addBody([ 14 .addBody([
15 kExprGetLocal, 0, 15 kExprGetLocal, 0,
16 kExprCallFunction, 0]) 16 kExprCallFunction, 0])
17 .exportAs("main"); 17 .exportAs("main");
18 18
19 print("module"); 19 print("module");
20 var module = new WebAssembly.Module(builder.toBuffer()); 20 var module = new WebAssembly.Module(builder.toBuffer());
21 21
22 for (var i = 0; i < 10; i++) { 22 for (var i = 0; i < 10; i++) {
23 print(" instance " + i); 23 print(" instance " + i);
24 var instance = new WebAssembly.Instance(module, {f: f}); 24 var instance = new WebAssembly.Instance(module, {m: {f: f}});
25 var g = instance.exports.main; 25 var g = instance.exports.main;
26 for (var j = 0; j < 10; j++) { 26 for (var j = 0; j < 10; j++) {
27 assertEquals(f(j), g(j)); 27 assertEquals(f(j), g(j));
28 } 28 }
29 } 29 }
30 } 30 }
31 31
32 (function test() { 32 (function test() {
33 for (var i = 0; i < 100; i++) { 33 for (var i = 0; i < 100; i++) {
34 run(x => (x + 19)); 34 run(x => (x + 19));
35 run(x => (x - 18)); 35 run(x => (x - 18));
36 } 36 }
37 })(); 37 })();
OLDNEW
« no previous file with comments | « test/mjsunit/wasm/gc-frame.js ('k') | test/mjsunit/wasm/globals.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698