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

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

Issue 2591753002: [wasm] Implement correct 2-level namespace for imports. (Closed)
Patch Set: Fix debug tests Created 3 years, 12 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/wasm/gc-buffer.js ('k') | test/mjsunit/wasm/gc-stress.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 --expose-gc 5 // Flags: --expose-wasm --expose-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 makeFFI(func, t) { 10 function makeFFI(func, t) {
11 var builder = new WasmModuleBuilder(); 11 var builder = new WasmModuleBuilder();
12 12
13 var sig_index = builder.addType(makeSig([t,t,t,t,t,t,t,t,t,t], [t])); 13 var sig_index = builder.addType(makeSig([t,t,t,t,t,t,t,t,t,t], [t]));
14 builder.addImport("func", sig_index); 14 builder.addImport("m", "func", sig_index);
15 // Try to create a frame with lots of spilled values and parameters 15 // Try to create a frame with lots of spilled values and parameters
16 // on the stack to try to catch GC bugs in the reference maps for 16 // on the stack to try to catch GC bugs in the reference maps for
17 // the different parts of the stack. 17 // the different parts of the stack.
18 builder.addFunction("main", sig_index) 18 builder.addFunction("main", sig_index)
19 .addBody([ 19 .addBody([
20 kExprGetLocal, 0, // -- 20 kExprGetLocal, 0, // --
21 kExprGetLocal, 1, // -- 21 kExprGetLocal, 1, // --
22 kExprGetLocal, 2, // -- 22 kExprGetLocal, 2, // --
23 kExprGetLocal, 3, // -- 23 kExprGetLocal, 3, // --
24 kExprGetLocal, 4, // -- 24 kExprGetLocal, 4, // --
(...skipping 11 matching lines...) Expand all
36 kExprGetLocal, 4, // -- 36 kExprGetLocal, 4, // --
37 kExprGetLocal, 5, // -- 37 kExprGetLocal, 5, // --
38 kExprGetLocal, 6, // -- 38 kExprGetLocal, 6, // --
39 kExprGetLocal, 7, // -- 39 kExprGetLocal, 7, // --
40 kExprGetLocal, 8, // -- 40 kExprGetLocal, 8, // --
41 kExprGetLocal, 9, // -- 41 kExprGetLocal, 9, // --
42 kExprCallFunction, 0, // -- 42 kExprCallFunction, 0, // --
43 ]) // -- 43 ]) // --
44 .exportFunc(); 44 .exportFunc();
45 45
46 return builder.instantiate({func: func}).exports.main; 46 return builder.instantiate({m: {func: func}}).exports.main;
47 } 47 }
48 48
49 49
50 function print10(a, b, c, d, e, f, g, h, i) { 50 function print10(a, b, c, d, e, f, g, h, i) {
51 print(a + ",", b + ",", c + ",", d + ",", e + ",", f + ",", g + ",", h + ",", i); 51 print(a + ",", b + ",", c + ",", d + ",", e + ",", f + ",", g + ",", h + ",", i);
52 gc(); 52 gc();
53 print(a + ",", b + ",", c + ",", d + ",", e + ",", f + ",", g + ",", h + ",", i); 53 print(a + ",", b + ",", c + ",", d + ",", e + ",", f + ",", g + ",", h + ",", i);
54 } 54 }
55 55
56 (function I32Test() { 56 (function I32Test() {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 var gc_object = { 89 var gc_object = {
90 valueOf: function() { 90 valueOf: function() {
91 // Call the GC in valueOf, which is called within the JSToWasm wrapper. 91 // Call the GC in valueOf, which is called within the JSToWasm wrapper.
92 gc(); 92 gc();
93 return {}; 93 return {};
94 } 94 }
95 }; 95 };
96 96
97 main(gc_object); 97 main(gc_object);
98 })(); 98 })();
OLDNEW
« no previous file with comments | « test/mjsunit/wasm/gc-buffer.js ('k') | test/mjsunit/wasm/gc-stress.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698