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

Side by Side Diff: test/mjsunit/wasm/test-wasm-module-builder.js

Issue 1772593002: [wasm] Fix stupid arguments. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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 | « no previous file | no next file » | 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 5 // Flags: --expose-wasm
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 var debug = (((typeof arguments) != undefined) && arguments[0] == "debug");
11
12 (function BasicTest() { 10 (function BasicTest() {
13 var module = new WasmModuleBuilder(); 11 var module = new WasmModuleBuilder();
14 module.addMemory(1, 2, false); 12 module.addMemory(1, 2, false);
15 module.addFunction("foo", [kAstI32]) 13 module.addFunction("foo", [kAstI32])
16 .addBody([kExprI8Const, 11]) 14 .addBody([kExprI8Const, 11])
17 .exportAs("blarg"); 15 .exportAs("blarg");
18 16
19 var buffer = module.toBuffer(debug); 17 var buffer = module.toBuffer(debug);
20 var instance = _WASMEXP_.instantiateModule(buffer); 18 var instance = _WASMEXP_.instantiateModule(buffer);
21 assertEquals(11, instance.exports.blarg()); 19 assertEquals(11, instance.exports.blarg());
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 module.addMemory(1, 1, false); 79 module.addMemory(1, 1, false);
82 module.addFunction("load", [kAstI32, kAstI32]) 80 module.addFunction("load", [kAstI32, kAstI32])
83 .addBody([kExprI32LoadMem, 0, kExprGetLocal, 0]) 81 .addBody([kExprI32LoadMem, 0, kExprGetLocal, 0])
84 .exportAs("load"); 82 .exportAs("load");
85 module.addDataSegment(0, [9, 9, 9, 9], true); 83 module.addDataSegment(0, [9, 9, 9, 9], true);
86 84
87 var buffer = module.toBuffer(debug); 85 var buffer = module.toBuffer(debug);
88 var instance = _WASMEXP_.instantiateModule(buffer); 86 var instance = _WASMEXP_.instantiateModule(buffer);
89 assertEquals(151587081, instance.exports.load(0)); 87 assertEquals(151587081, instance.exports.load(0));
90 })(); 88 })();
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698