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

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

Issue 2390113003: [wasm] Refactor import handling for 0xC. (Closed)
Patch Set: Fix gc stress failure 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/wasm/import-table.js ('k') | test/mjsunit/wasm/instantiate-module-basic.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 let nogc = () => {}; 10 let nogc = () => {};
11 11
12 function newModule() { 12 function newModule() {
13 let builder = new WasmModuleBuilder(); 13 let builder = new WasmModuleBuilder();
14 builder.addMemory(1, 1, true); 14 builder.addMemory(1, 1, true);
15 builder.addFunction("main", kSig_i) 15 builder.addFunction("main", kSig_i_v)
16 .addBody([kExprI32Const, 0, kExprI32LoadMem, 0, 0]) 16 .addBody([kExprI32Const, 0, kExprI32LoadMem, 0, 0])
17 .exportFunc(); 17 .exportFunc();
18 18
19 return new WebAssembly.Module(builder.toBuffer()); 19 return new WebAssembly.Module(builder.toBuffer());
20 } 20 }
21 21
22 function newInstance(module, val) { 22 function newInstance(module, val) {
23 var instance = new WebAssembly.Instance(module); 23 var instance = new WebAssembly.Instance(module);
24 var view = new Int32Array(instance.exports.memory.buffer); 24 var view = new Int32Array(instance.exports.memory.buffer);
25 view[0] = val; 25 view[0] = val;
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 roots[1] = newInstance(module, 22222); 113 roots[1] = newInstance(module, 22222);
114 assertEquals(11111, roots[0].exports.main()); 114 assertEquals(11111, roots[0].exports.main());
115 assertEquals(22222, roots[1].exports.main()); 115 assertEquals(22222, roots[1].exports.main());
116 roots[0] = null; 116 roots[0] = null;
117 roots[1] = null; 117 roots[1] = null;
118 })(); 118 })();
119 } 119 }
120 120
121 TestReclaimingCompiledModule(nogc); 121 TestReclaimingCompiledModule(nogc);
122 TestReclaimingCompiledModule(gc); 122 TestReclaimingCompiledModule(gc);
OLDNEW
« no previous file with comments | « test/mjsunit/wasm/import-table.js ('k') | test/mjsunit/wasm/instantiate-module-basic.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698