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

Side by Side Diff: test/mjsunit/wasm/import-table.js

Issue 2395133002: Revert of [wasm] Refactor import handling for 0xC. (Closed)
Patch Set: 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/globals.js ('k') | test/mjsunit/wasm/instance-gc.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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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 function testCallImport(func, check) { 10 function testCallImport(func, check) {
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 } 259 }
260 } 260 }
261 261
262 testCallPrint(); 262 testCallPrint();
263 testCallPrint(); 263 testCallPrint();
264 264
265 265
266 function testCallImport2(foo, bar, expected) { 266 function testCallImport2(foo, bar, expected) {
267 var builder = new WasmModuleBuilder(); 267 var builder = new WasmModuleBuilder();
268 268
269 builder.addImport("foo", kSig_i_v); 269 builder.addImport("foo", kSig_i);
270 builder.addImport("bar", kSig_i_v); 270 builder.addImport("bar", kSig_i);
271 builder.addFunction("main", kSig_i_v) 271 builder.addFunction("main", kSig_i)
272 .addBody([ 272 .addBody([
273 kExprCallFunction, 0, // -- 273 kExprCallFunction, 0, // --
274 kExprCallFunction, 1, // -- 274 kExprCallFunction, 1, // --
275 kExprI32Add, // -- 275 kExprI32Add, // --
276 ]) // -- 276 ]) // --
277 .exportFunc(); 277 .exportFunc();
278 278
279 var main = builder.instantiate({foo: foo, bar: bar}).exports.main; 279 var main = builder.instantiate({foo: foo, bar: bar}).exports.main;
280 assertEquals(expected, main()); 280 assertEquals(expected, main());
281 } 281 }
282 282
283 testCallImport2(function() { return 33; }, function () { return 44; }, 77); 283 testCallImport2(function() { return 33; }, function () { return 44; }, 77);
OLDNEW
« no previous file with comments | « test/mjsunit/wasm/globals.js ('k') | test/mjsunit/wasm/instance-gc.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698