Index: src/wasm/wasm-module.h |
diff --git a/src/wasm/wasm-module.h b/src/wasm/wasm-module.h |
index 510ac3c59f60faa975e1709ab5141fe9bac71acd..cce704f4feeb3cd5b0c566f373769d519319dc20 100644 |
--- a/src/wasm/wasm-module.h |
+++ b/src/wasm/wasm-module.h |
@@ -25,22 +25,29 @@ const size_t kMaxStringSize = 256; |
const uint32_t kWasmMagic = 0x6d736100; |
const uint32_t kWasmVersion = 0x0a; |
-enum WasmSectionDeclCode { |
- kDeclMemory = 0x00, |
- kDeclSignatures = 0x01, |
- kDeclFunctions = 0x02, |
- kDeclGlobals = 0x03, |
- kDeclDataSegments = 0x04, |
- kDeclFunctionTable = 0x05, |
- kDeclEnd = 0x06, |
- kDeclStartFunction = 0x07, |
- kDeclImportTable = 0x08, |
- kDeclExportTable = 0x09, |
- kDeclWLL = 0x11, |
+// WebAssembly sections are named as strings in the binary format, but |
+// internally V8 uses an enum to handle them. |
+// |
+// Entries have the form F(enumerator, string). |
+#define FOR_EACH_WASM_SECTION_TYPE(F) \ |
+ F(kDeclMemory, "memory") \ |
+ F(kDeclSignatures, "signatures") \ |
+ F(kDeclFunctions, "functions") \ |
+ F(kDeclGlobals, "globals") \ |
+ F(kDeclDataSegments, "data_segments") \ |
+ F(kDeclFunctionTable, "function_table") \ |
+ F(kDeclEnd, "end") \ |
+ F(kDeclStartFunction, "start_function") \ |
+ F(kDeclImportTable, "import_table") \ |
+ F(kDeclExportTable, "export_table") |
+ |
+enum WasmSectionDeclCode : uint32_t { |
+#define F(enumerator, string) enumerator, |
+ FOR_EACH_WASM_SECTION_TYPE(F) |
+#undef F |
+ kMaxModuleSectionCode |
}; |
-static const int kMaxModuleSectionCode = 0x11; |
- |
enum WasmFunctionDeclBit { |
kDeclFunctionName = 0x01, |
kDeclFunctionImport = 0x02, |