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

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

Issue 2484643002: [wasm] Compare the maximum memory size with the spec limit, not with the V8 limit (Closed)
Patch Set: Add a negative test Created 4 years, 1 month 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/module-decoder.cc ('k') | test/unittests/wasm/module-decoder-unittest.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 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 #ifndef V8_WASM_MODULE_H_ 5 #ifndef V8_WASM_MODULE_H_
6 #define V8_WASM_MODULE_H_ 6 #define V8_WASM_MODULE_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "src/api.h" 10 #include "src/api.h"
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 170
171 enum ModuleOrigin { kWasmOrigin, kAsmJsOrigin }; 171 enum ModuleOrigin { kWasmOrigin, kAsmJsOrigin };
172 172
173 class WasmCompiledModule; 173 class WasmCompiledModule;
174 174
175 // Static representation of a module. 175 // Static representation of a module.
176 struct V8_EXPORT_PRIVATE WasmModule { 176 struct V8_EXPORT_PRIVATE WasmModule {
177 static const uint32_t kPageSize = 0x10000; // Page size, 64kb. 177 static const uint32_t kPageSize = 0x10000; // Page size, 64kb.
178 static const uint32_t kMinMemPages = 1; // Minimum memory size = 64kb 178 static const uint32_t kMinMemPages = 1; // Minimum memory size = 64kb
179 static const size_t kV8MaxPages = 16384; // Maximum memory size = 1gb 179 static const size_t kV8MaxPages = 16384; // Maximum memory size = 1gb
180 static const size_t kSpecMaxPages = 65536; // Maximum according to the spec
180 static const size_t kV8MaxTableSize = 16 * 1024 * 1024; 181 static const size_t kV8MaxTableSize = 16 * 1024 * 1024;
181 182
182 Zone* owned_zone; 183 Zone* owned_zone;
183 const byte* module_start = nullptr; // starting address for the module bytes 184 const byte* module_start = nullptr; // starting address for the module bytes
184 const byte* module_end = nullptr; // end address for the module bytes 185 const byte* module_end = nullptr; // end address for the module bytes
185 uint32_t min_mem_pages = 0; // minimum size of the memory in 64k pages 186 uint32_t min_mem_pages = 0; // minimum size of the memory in 64k pages
186 uint32_t max_mem_pages = 0; // maximum size of the memory in 64k pages 187 uint32_t max_mem_pages = 0; // maximum size of the memory in 64k pages
187 bool mem_export = false; // true if the memory is exported 188 bool mem_export = false; // true if the memory is exported
188 // TODO(wasm): reconcile start function index being an int with 189 // TODO(wasm): reconcile start function index being an int with
189 // the fact that we index on uint32_t, so we may technically not be 190 // the fact that we index on uint32_t, so we may technically not be
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
568 int instance_count); 569 int instance_count);
569 void ValidateModuleState(Isolate* isolate, Handle<JSObject> wasm_module); 570 void ValidateModuleState(Isolate* isolate, Handle<JSObject> wasm_module);
570 void ValidateOrphanedInstance(Isolate* isolate, Handle<JSObject> instance); 571 void ValidateOrphanedInstance(Isolate* isolate, Handle<JSObject> instance);
571 572
572 } // namespace testing 573 } // namespace testing
573 } // namespace wasm 574 } // namespace wasm
574 } // namespace internal 575 } // namespace internal
575 } // namespace v8 576 } // namespace v8
576 577
577 #endif // V8_WASM_MODULE_H_ 578 #endif // V8_WASM_MODULE_H_
OLDNEW
« no previous file with comments | « src/wasm/module-decoder.cc ('k') | test/unittests/wasm/module-decoder-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698