| 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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 struct ModuleWireBytes; | 172 struct ModuleWireBytes; |
| 173 | 173 |
| 174 // Static representation of a module. | 174 // Static representation of a module. |
| 175 struct V8_EXPORT_PRIVATE WasmModule { | 175 struct V8_EXPORT_PRIVATE WasmModule { |
| 176 static const uint32_t kPageSize = 0x10000; // Page size, 64kb. | 176 static const uint32_t kPageSize = 0x10000; // Page size, 64kb. |
| 177 static const uint32_t kMinMemPages = 1; // Minimum memory size = 64kb | 177 static const uint32_t kMinMemPages = 1; // Minimum memory size = 64kb |
| 178 | 178 |
| 179 Zone* owned_zone; | 179 Zone* owned_zone; |
| 180 uint32_t min_mem_pages = 0; // minimum size of the memory in 64k pages | 180 uint32_t min_mem_pages = 0; // minimum size of the memory in 64k pages |
| 181 uint32_t max_mem_pages = 0; // maximum size of the memory in 64k pages | 181 uint32_t max_mem_pages = 0; // maximum size of the memory in 64k pages |
| 182 bool has_max_mem = false; // try if a maximum memory size exists |
| 182 bool has_memory = false; // true if the memory was defined or imported | 183 bool has_memory = false; // true if the memory was defined or imported |
| 183 bool mem_export = false; // true if the memory is exported | 184 bool mem_export = false; // true if the memory is exported |
| 184 // TODO(wasm): reconcile start function index being an int with | 185 // TODO(wasm): reconcile start function index being an int with |
| 185 // the fact that we index on uint32_t, so we may technically not be | 186 // the fact that we index on uint32_t, so we may technically not be |
| 186 // able to represent some start_function_index -es. | 187 // able to represent some start_function_index -es. |
| 187 int start_function_index = -1; // start function, if any | 188 int start_function_index = -1; // start function, if any |
| 188 ModuleOrigin origin = kWasmOrigin; // origin of the module | 189 ModuleOrigin origin = kWasmOrigin; // origin of the module |
| 189 | 190 |
| 190 std::vector<WasmGlobal> globals; // globals in this module. | 191 std::vector<WasmGlobal> globals; // globals in this module. |
| 191 uint32_t globals_size = 0; // size of globals table. | 192 uint32_t globals_size = 0; // size of globals table. |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 void ValidateModuleState(Isolate* isolate, Handle<WasmModuleObject> module_obj); | 452 void ValidateModuleState(Isolate* isolate, Handle<WasmModuleObject> module_obj); |
| 452 void ValidateOrphanedInstance(Isolate* isolate, | 453 void ValidateOrphanedInstance(Isolate* isolate, |
| 453 Handle<WasmInstanceObject> instance); | 454 Handle<WasmInstanceObject> instance); |
| 454 | 455 |
| 455 } // namespace testing | 456 } // namespace testing |
| 456 } // namespace wasm | 457 } // namespace wasm |
| 457 } // namespace internal | 458 } // namespace internal |
| 458 } // namespace v8 | 459 } // namespace v8 |
| 459 | 460 |
| 460 #endif // V8_WASM_MODULE_H_ | 461 #endif // V8_WASM_MODULE_H_ |
| OLD | NEW |