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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
43 kMemorySectionCode = 5, // Memory attributes | 43 kMemorySectionCode = 5, // Memory attributes |
44 kGlobalSectionCode = 6, // Global declarations | 44 kGlobalSectionCode = 6, // Global declarations |
45 kExportSectionCode = 7, // Exports | 45 kExportSectionCode = 7, // Exports |
46 kStartSectionCode = 8, // Start function declaration | 46 kStartSectionCode = 8, // Start function declaration |
47 kElementSectionCode = 9, // Elements section | 47 kElementSectionCode = 9, // Elements section |
48 kCodeSectionCode = 10, // Function code | 48 kCodeSectionCode = 10, // Function code |
49 kDataSectionCode = 11, // Data segments | 49 kDataSectionCode = 11, // Data segments |
50 kNameSectionCode = 12, // Name section (encoded as a string) | 50 kNameSectionCode = 12, // Name section (encoded as a string) |
51 }; | 51 }; |
52 | 52 |
53 // Internal constants for the layout of the module object. | |
54 enum WasmInstanceObjectFields { | |
titzer
2016/10/11 18:48:54
Not sure why these internal fields need to be expo
ahaas
2016/10/12 18:03:58
I do not expose them anymore. Instead I make GetIn
| |
55 kWasmCompiledModule = 0, | |
56 kWasmModuleFunctionTable, | |
57 kWasmModuleCodeTable, | |
58 kWasmMemObject, | |
59 kWasmMemArrayBuffer, | |
60 kWasmGlobalsArrayBuffer, | |
61 kWasmDebugInfo, | |
62 kWasmModuleInternalFieldCount | |
63 }; | |
64 | |
53 inline bool IsValidSectionCode(uint8_t byte) { | 65 inline bool IsValidSectionCode(uint8_t byte) { |
54 return kTypeSectionCode <= byte && byte <= kDataSectionCode; | 66 return kTypeSectionCode <= byte && byte <= kDataSectionCode; |
55 } | 67 } |
56 | 68 |
57 const char* SectionName(WasmSectionCode code); | 69 const char* SectionName(WasmSectionCode code); |
58 | 70 |
59 class WasmDebugInfo; | 71 class WasmDebugInfo; |
60 | 72 |
61 // Constants for fixed-size elements within a module. | 73 // Constants for fixed-size elements within a module. |
62 static const uint32_t kMaxReturnCount = 1; | 74 static const uint32_t kMaxReturnCount = 1; |
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
546 int instance_count); | 558 int instance_count); |
547 void ValidateModuleState(Isolate* isolate, Handle<JSObject> module_obj); | 559 void ValidateModuleState(Isolate* isolate, Handle<JSObject> module_obj); |
548 void ValidateOrphanedInstance(Isolate* isolate, Handle<JSObject> instance); | 560 void ValidateOrphanedInstance(Isolate* isolate, Handle<JSObject> instance); |
549 | 561 |
550 } // namespace testing | 562 } // namespace testing |
551 } // namespace wasm | 563 } // namespace wasm |
552 } // namespace internal | 564 } // namespace internal |
553 } // namespace v8 | 565 } // namespace v8 |
554 | 566 |
555 #endif // V8_WASM_MODULE_H_ | 567 #endif // V8_WASM_MODULE_H_ |
OLD | NEW |