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

Side by Side Diff: test/mjsunit/wasm/memory-size.js

Issue 2386183004: [wasm] Call a runtime function for a MemorySize instruction. (Closed)
Patch Set: Comments addressed 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/regress/wasm/regression-651961.js ('k') | 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
(Empty)
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
3 // found in the LICENSE file.
4
5 // Flags: --expose-wasm
6
7 load("test/mjsunit/wasm/wasm-constants.js");
8 load("test/mjsunit/wasm/wasm-module-builder.js");
9
10 (function testMemorySizeZero() {
11 print("testMemorySizeZero()");
12 var builder = new WasmModuleBuilder();
13 builder.addFunction("memory_size", kSig_i_v)
14 .addBody([kExprMemorySize])
15 .exportFunc();
16 var module = builder.instantiate();
17 assertEquals(0, module.exports.memory_size());
18 })();
19
20 (function testMemorySizeNonZero() {
21 print("testMemorySizeNonZero()");
22 var builder = new WasmModuleBuilder();
23 var size = 11;
24 builder.addMemory(size, size, false);
25 builder.addFunction("memory_size", kSig_i_v)
26 .addBody([kExprMemorySize])
27 .exportFunc();
28 var module = builder.instantiate();
29 assertEquals(size, module.exports.memory_size());
30 })();
OLDNEW
« no previous file with comments | « test/mjsunit/regress/wasm/regression-651961.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698