5 #ifndef V8_WASM_WASM_CONSTANTS_H_ 6 #define V8_WASM_WASM_CONSTANTS_H_ 16 constexpr
uint32_t kWasmMagic = 0x6d736100;
17 constexpr
uint32_t kWasmVersion = 0x01;
20 enum ValueTypeCode : uint8_t {
29 kLocalExceptRef = 0x68,
32 constexpr uint8_t kWasmFunctionTypeCode = 0x60;
35 enum ImportExportKindCode : uint8_t {
36 kExternalFunction = 0,
40 kExternalException = 4
44 enum MaximumFlag : uint8_t { kNoMaximumFlag = 0, kHasMaximumFlag = 1 };
46 enum MemoryFlags : uint8_t {
54 enum SegmentFlags : uint8_t {
61 enum SectionCode : int8_t {
62 kUnknownSectionCode = 0,
64 kImportSectionCode = 2,
65 kFunctionSectionCode = 3,
66 kTableSectionCode = 4,
67 kMemorySectionCode = 5,
68 kGlobalSectionCode = 6,
69 kExportSectionCode = 7,
70 kStartSectionCode = 8,
71 kElementSectionCode = 9,
72 kCodeSectionCode = 10,
73 kDataSectionCode = 11,
74 kNameSectionCode = 12,
75 kExceptionSectionCode = 13,
76 kSourceMappingURLSectionCode = 14,
79 kFirstSectionInModule = kTypeSectionCode,
80 kLastKnownModuleSection = kSourceMappingURLSectionCode,
81 kFirstUnorderedSection = kNameSectionCode,
85 enum NameSectionKindCode : uint8_t { kModule = 0, kFunction = 1, kLocal = 2 };
87 constexpr
size_t kWasmPageSize = 0x10000;
88 constexpr
uint32_t kWasmPageSizeLog2 = 16;
89 static_assert(kWasmPageSize ==
size_t{1} << kWasmPageSizeLog2,
"consistency");
92 using WasmCodePosition =
int;
93 constexpr WasmCodePosition kNoCodePosition = -1;
95 constexpr
uint32_t kExceptionAttribute = 0;
101 #endif // V8_WASM_WASM_CONSTANTS_H_