| OLD | NEW |
| 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 kSpecMaxPages = 65536; // Maximum according to the spec |
| 181 static const size_t kV8MaxTableSize = 16 * 1024 * 1024; | 181 static const size_t kV8MaxTableSize = 16 * 1024 * 1024; |
| 182 | 182 |
| 183 Zone* owned_zone; | 183 Zone* owned_zone; |
| 184 const byte* module_start = nullptr; // starting address for the module bytes | 184 const byte* module_start = nullptr; // starting address for the module bytes |
| 185 const byte* module_end = nullptr; // end address for the module bytes | 185 const byte* module_end = nullptr; // end address for the module bytes |
| 186 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 |
| 187 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 |
| 188 bool has_memory = false; // true if the memory was defined or imported |
| 188 bool mem_export = false; // true if the memory is exported | 189 bool mem_export = false; // true if the memory is exported |
| 189 // TODO(wasm): reconcile start function index being an int with | 190 // TODO(wasm): reconcile start function index being an int with |
| 190 // the fact that we index on uint32_t, so we may technically not be | 191 // the fact that we index on uint32_t, so we may technically not be |
| 191 // able to represent some start_function_index -es. | 192 // able to represent some start_function_index -es. |
| 192 int start_function_index = -1; // start function, if any | 193 int start_function_index = -1; // start function, if any |
| 193 ModuleOrigin origin = kWasmOrigin; // origin of the module | 194 ModuleOrigin origin = kWasmOrigin; // origin of the module |
| 194 | 195 |
| 195 std::vector<WasmGlobal> globals; // globals in this module. | 196 std::vector<WasmGlobal> globals; // globals in this module. |
| 196 uint32_t globals_size = 0; // size of globals table. | 197 uint32_t globals_size = 0; // size of globals table. |
| 197 uint32_t num_imported_functions = 0; // number of imported functions. | 198 uint32_t num_imported_functions = 0; // number of imported functions. |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 int instance_count); | 571 int instance_count); |
| 571 void ValidateModuleState(Isolate* isolate, Handle<JSObject> wasm_module); | 572 void ValidateModuleState(Isolate* isolate, Handle<JSObject> wasm_module); |
| 572 void ValidateOrphanedInstance(Isolate* isolate, Handle<JSObject> instance); | 573 void ValidateOrphanedInstance(Isolate* isolate, Handle<JSObject> instance); |
| 573 | 574 |
| 574 } // namespace testing | 575 } // namespace testing |
| 575 } // namespace wasm | 576 } // namespace wasm |
| 576 } // namespace internal | 577 } // namespace internal |
| 577 } // namespace v8 | 578 } // namespace v8 |
| 578 | 579 |
| 579 #endif // V8_WASM_MODULE_H_ | 580 #endif // V8_WASM_MODULE_H_ |
| OLD | NEW |