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 13 matching lines...) Expand all Loading... |
24 class WasmCompilationUnit; | 24 class WasmCompilationUnit; |
25 } | 25 } |
26 | 26 |
27 namespace wasm { | 27 namespace wasm { |
28 class ErrorThrower; | 28 class ErrorThrower; |
29 | 29 |
30 const size_t kMaxModuleSize = 1024 * 1024 * 1024; | 30 const size_t kMaxModuleSize = 1024 * 1024 * 1024; |
31 const size_t kMaxFunctionSize = 128 * 1024; | 31 const size_t kMaxFunctionSize = 128 * 1024; |
32 const size_t kMaxStringSize = 256; | 32 const size_t kMaxStringSize = 256; |
33 const uint32_t kWasmMagic = 0x6d736100; | 33 const uint32_t kWasmMagic = 0x6d736100; |
34 const uint32_t kWasmVersion = 0x0c; | 34 const uint32_t kWasmVersion = 0x0d; |
35 | 35 |
36 const uint8_t kWasmFunctionTypeForm = 0x40; | 36 const uint8_t kWasmFunctionTypeForm = 0x60; |
37 const uint8_t kWasmAnyFunctionTypeForm = 0x20; | 37 const uint8_t kWasmAnyFunctionTypeForm = 0x70; |
38 | 38 |
39 enum WasmSectionCode { | 39 enum WasmSectionCode { |
40 kUnknownSectionCode = 0, // code for unknown sections | 40 kUnknownSectionCode = 0, // code for unknown sections |
41 kTypeSectionCode = 1, // Function signature declarations | 41 kTypeSectionCode = 1, // Function signature declarations |
42 kImportSectionCode = 2, // Import declarations | 42 kImportSectionCode = 2, // Import declarations |
43 kFunctionSectionCode = 3, // Function declarations | 43 kFunctionSectionCode = 3, // Function declarations |
44 kTableSectionCode = 4, // Indirect function table and other tables | 44 kTableSectionCode = 4, // Indirect function table and other tables |
45 kMemorySectionCode = 5, // Memory attributes | 45 kMemorySectionCode = 5, // Memory attributes |
46 kGlobalSectionCode = 6, // Global declarations | 46 kGlobalSectionCode = 6, // Global declarations |
47 kExportSectionCode = 7, // Exports | 47 kExportSectionCode = 7, // Exports |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 int instance_count); | 563 int instance_count); |
564 void ValidateModuleState(Isolate* isolate, Handle<JSObject> wasm_module); | 564 void ValidateModuleState(Isolate* isolate, Handle<JSObject> wasm_module); |
565 void ValidateOrphanedInstance(Isolate* isolate, Handle<JSObject> instance); | 565 void ValidateOrphanedInstance(Isolate* isolate, Handle<JSObject> instance); |
566 | 566 |
567 } // namespace testing | 567 } // namespace testing |
568 } // namespace wasm | 568 } // namespace wasm |
569 } // namespace internal | 569 } // namespace internal |
570 } // namespace v8 | 570 } // namespace v8 |
571 | 571 |
572 #endif // V8_WASM_MODULE_H_ | 572 #endif // V8_WASM_MODULE_H_ |
OLD | NEW |