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

Side by Side Diff: src/wasm/wasm-limits.h

Issue 2626313003: [wasm] Change the constant kV8MaxWasmMemoryPages to a command line flag. (Closed)
Patch Set: Rebase Created 3 years, 11 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 | « src/wasm/wasm-js.cc ('k') | src/wasm/wasm-module.cc » ('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 #ifndef V8_WASM_WASM_LIMITS_H_ 5 #ifndef V8_WASM_WASM_LIMITS_H_
6 #define V8_WASM_WASM_LIMITS_H_ 6 #define V8_WASM_WASM_LIMITS_H_
7 7
8 namespace v8 { 8 namespace v8 {
9 namespace internal { 9 namespace internal {
10 namespace wasm { 10 namespace wasm {
11 11
12 // The following limits are imposed by V8 on WebAssembly modules. 12 // The following limits are imposed by V8 on WebAssembly modules.
13 // The limits are agreed upon with other engines for consistency. 13 // The limits are agreed upon with other engines for consistency.
14 const size_t kV8MaxWasmTypes = 1000000; 14 const size_t kV8MaxWasmTypes = 1000000;
15 const size_t kV8MaxWasmFunctions = 1000000; 15 const size_t kV8MaxWasmFunctions = 1000000;
16 const size_t kV8MaxWasmImports = 100000; 16 const size_t kV8MaxWasmImports = 100000;
17 const size_t kV8MaxWasmExports = 100000; 17 const size_t kV8MaxWasmExports = 100000;
18 const size_t kV8MaxWasmGlobals = 1000000; 18 const size_t kV8MaxWasmGlobals = 1000000;
19 const size_t kV8MaxWasmDataSegments = 100000; 19 const size_t kV8MaxWasmDataSegments = 100000;
20 const size_t kV8MaxWasmMemoryPages = 16384; // = 1 GiB 20 // kV8MaxWasmMemoryPages is defined by FLAG_wasm_max_mem_pages
21 // const size_t kV8MaxWasmMemoryPages = 16384; // = 1 GiB
21 const size_t kV8MaxWasmStringSize = 100000; 22 const size_t kV8MaxWasmStringSize = 100000;
22 const size_t kV8MaxWasmModuleSize = 1024 * 1024 * 1024; // = 1 GiB 23 const size_t kV8MaxWasmModuleSize = 1024 * 1024 * 1024; // = 1 GiB
23 const size_t kV8MaxWasmFunctionSize = 128 * 1024; 24 const size_t kV8MaxWasmFunctionSize = 128 * 1024;
24 const size_t kV8MaxWasmFunctionLocals = 50000; 25 const size_t kV8MaxWasmFunctionLocals = 50000;
25 const size_t kV8MaxWasmFunctionParams = 1000; 26 const size_t kV8MaxWasmFunctionParams = 1000;
26 const size_t kV8MaxWasmFunctionMultiReturns = 1000; 27 const size_t kV8MaxWasmFunctionMultiReturns = 1000;
27 const size_t kV8MaxWasmFunctionReturns = 1; 28 const size_t kV8MaxWasmFunctionReturns = 1;
28 const size_t kV8MaxWasmTableSize = 10000000; 29 const size_t kV8MaxWasmTableSize = 10000000;
29 const size_t kV8MaxWasmTableEntries = 10000000; 30 const size_t kV8MaxWasmTableEntries = 10000000;
30 const size_t kV8MaxWasmTables = 1; 31 const size_t kV8MaxWasmTables = 1;
31 const size_t kV8MaxWasmMemories = 1; 32 const size_t kV8MaxWasmMemories = 1;
32 33
33 const size_t kSpecMaxWasmMemoryPages = 65536; 34 const size_t kSpecMaxWasmMemoryPages = 65536;
34 const size_t kSpecMaxWasmTableSize = 0xFFFFFFFFu; 35 const size_t kSpecMaxWasmTableSize = 0xFFFFFFFFu;
35 36
36 const uint64_t kWasmMaxHeapOffset = 37 const uint64_t kWasmMaxHeapOffset =
37 static_cast<uint64_t>( 38 static_cast<uint64_t>(
38 std::numeric_limits<uint32_t>::max()) // maximum base value 39 std::numeric_limits<uint32_t>::max()) // maximum base value
39 + std::numeric_limits<uint32_t>::max(); // maximum index value 40 + std::numeric_limits<uint32_t>::max(); // maximum index value
40 41
41 } // namespace wasm 42 } // namespace wasm
42 } // namespace internal 43 } // namespace internal
43 } // namespace v8 44 } // namespace v8
44 45
45 #endif // V8_WASM_WASM_LIMITS_H_ 46 #endif // V8_WASM_WASM_LIMITS_H_
OLDNEW
« no previous file with comments | « src/wasm/wasm-js.cc ('k') | src/wasm/wasm-module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698