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

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

Issue 2277443009: Populate relocation information correctly for RelocatableInt32Constants. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase + fix serializer test flakiness Created 4 years, 3 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/cctest/wasm/test-run-wasm-module.cc ('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
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 --stress-compaction 5 // Flags: --expose-wasm --expose-gc --stress-compaction
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 kPageSize = 0x10000; 10 var kPageSize = 0x10000;
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 function testGrowMemoryTrapsWithNonSmiInput() { 121 function testGrowMemoryTrapsWithNonSmiInput() {
122 var builder = genGrowMemoryBuilder(); 122 var builder = genGrowMemoryBuilder();
123 var module = builder.instantiate(); 123 var module = builder.instantiate();
124 function growMem(pages) { return module.exports.grow_memory(pages); } 124 function growMem(pages) { return module.exports.grow_memory(pages); }
125 // The parameter of grow_memory is unsigned. Therefore -1 stands for 125 // The parameter of grow_memory is unsigned. Therefore -1 stands for
126 // UINT32_MIN, which cannot be represented as SMI. 126 // UINT32_MIN, which cannot be represented as SMI.
127 assertEquals(-1, growMem(-1)); 127 assertEquals(-1, growMem(-1));
128 }; 128 };
129 129
130 testGrowMemoryTrapsWithNonSmiInput(); 130 testGrowMemoryTrapsWithNonSmiInput();
131
132 function testGrowMemoryCurrentMemory() {
133 var builder = genGrowMemoryBuilder();
134 builder.addMemory(1, 1, false);
135 builder.addFunction("memory_size", kSig_i_v)
136 .addBody([kExprMemorySize])
137 .exportFunc();
138 var module = builder.instantiate();
139 function growMem(pages) { return module.exports.grow_memory(pages); }
140 function MemSize() { return module.exports.memory_size(); }
141 assertEquals(65536, MemSize());
142 assertEquals(1, growMem(1));
143 assertEquals(131072, MemSize());
144 }
145
146 testGrowMemoryCurrentMemory();
OLDNEW
« no previous file with comments | « test/cctest/wasm/test-run-wasm-module.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698