Skip to content

Commit

Permalink
[wasm] Flip section code for exception and data-count.
Browse files Browse the repository at this point in the history
This flips the section codes for the exception section (part of the
exception handling proposal) and the data-count section (part of the
bulk memory proposal).

Also see the following discussions for the underlying motivation:
WebAssembly/bulk-memory-operations#42
WebAssembly/exception-handling#70

R=binji@chromium.org
BUG=v8:8868

Change-Id: I9f5f524e7aec067720346a5bb8d45c7c80a4c7a2
Reviewed-on: https://chromium-review.googlesource.com/c/1478207
Reviewed-by: Ben Smith <binji@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59856}
  • Loading branch information
Michael Starzinger authored and Commit Bot committed Feb 26, 2019
1 parent 5ac4f47 commit f94cd44
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/wasm/wasm-constants.h
Expand Up @@ -71,8 +71,8 @@ enum SectionCode : int8_t {
kElementSectionCode = 9, // Elements section
kCodeSectionCode = 10, // Function code
kDataSectionCode = 11, // Data segments
kExceptionSectionCode = 12, // Exception section
kDataCountSectionCode = 13, // Number of data segments
kDataCountSectionCode = 12, // Number of data segments
kExceptionSectionCode = 13, // Exception section

// The following sections are custom sections, and are identified using a
// string rather than an integer. Their enumeration values are not guaranteed
Expand All @@ -83,7 +83,7 @@ enum SectionCode : int8_t {
// Helper values
kFirstSectionInModule = kTypeSectionCode,
kLastKnownModuleSection = kSourceMappingURLSectionCode,
kFirstUnorderedSection = kExceptionSectionCode,
kFirstUnorderedSection = kDataCountSectionCode,
};

// Binary encoding of name section kinds.
Expand Down
4 changes: 2 additions & 2 deletions test/mjsunit/wasm/wasm-module-builder.js
Expand Up @@ -70,8 +70,8 @@ let kStartSectionCode = 8; // Start function declaration
let kElementSectionCode = 9; // Elements section
let kCodeSectionCode = 10; // Function code
let kDataSectionCode = 11; // Data segments
let kExceptionSectionCode = 12; // Exception section (between Global & Export)
let kDataCountSectionCode = 13; // Data segments
let kDataCountSectionCode = 12; // Data segment count (between Element & Code)
let kExceptionSectionCode = 13; // Exception section (between Global & Export)

// Name section types
let kModuleNameCode = 0;
Expand Down

0 comments on commit f94cd44

Please sign in to comment.