Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(403)

Unified Diff: src/wasm/wasm-module.h

Issue 1743773002: WebAssembly: skip unknown sections, add names (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix limit type Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/wasm/module-decoder.cc ('k') | test/unittests/wasm/module-decoder-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « src/wasm/module-decoder.cc ('k') | test/unittests/wasm/module-decoder-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698