diff options
author | Keith Winstein <208955+keithw@users.noreply.github.com> | 2024-11-08 07:45:07 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-08 07:45:07 -0800 |
commit | 765b47d02aac894da80b74284263d1b487415aa0 (patch) | |
tree | 9e7275ddf2f8f3326c3a779e30a3aa963159ffa7 /src/binary-reader-objdump.cc | |
parent | c1d97e9c75c687faa81fe0ab4f1ac77c30487f47 (diff) | |
download | wabt-765b47d02aac894da80b74284263d1b487415aa0.tar.gz wabt-765b47d02aac894da80b74284263d1b487415aa0.tar.bz2 wabt-765b47d02aac894da80b74284263d1b487415aa0.zip |
Add support for the custom-page-sizes proposal (#2502)
This adds support in the binary/text parsers and writers,
the validator and interpreter, and objdump (but not wasm2c).
Diffstat (limited to 'src/binary-reader-objdump.cc')
-rw-r--r-- | src/binary-reader-objdump.cc | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/binary-reader-objdump.cc b/src/binary-reader-objdump.cc index ff9afbc6..52e6d27a 100644 --- a/src/binary-reader-objdump.cc +++ b/src/binary-reader-objdump.cc @@ -1059,7 +1059,8 @@ class BinaryReaderObjdump : public BinaryReaderObjdumpBase { std::string_view module_name, std::string_view field_name, Index memory_index, - const Limits* page_limits) override; + const Limits* page_limits, + uint32_t page_size) override; Result OnImportGlobal(Index import_index, std::string_view module_name, std::string_view field_name, @@ -1081,7 +1082,9 @@ class BinaryReaderObjdump : public BinaryReaderObjdumpBase { const Limits* elem_limits) override; Result OnMemoryCount(Index count) override; - Result OnMemory(Index index, const Limits* limits) override; + Result OnMemory(Index index, + const Limits* limits, + uint32_t page_size) override; Result OnGlobalCount(Index count) override; Result BeginGlobal(Index index, Type type, bool mutable_) override; @@ -1563,7 +1566,8 @@ Result BinaryReaderObjdump::OnImportMemory(Index import_index, std::string_view module_name, std::string_view field_name, Index memory_index, - const Limits* page_limits) { + const Limits* page_limits, + uint32_t page_size) { PrintDetails(" - memory[%" PRIindex "] pages: initial=%" PRId64, memory_index, page_limits->initial); if (page_limits->has_max) { @@ -1575,6 +1579,9 @@ Result BinaryReaderObjdump::OnImportMemory(Index import_index, if (page_limits->is_64) { PrintDetails(" i64"); } + if (page_size != WABT_DEFAULT_PAGE_SIZE) { + PrintDetails(" (pagesize %u)", page_size); + } PrintDetails(" <- " PRIstringview "." PRIstringview "\n", WABT_PRINTF_STRING_VIEW_ARG(module_name), WABT_PRINTF_STRING_VIEW_ARG(field_name)); @@ -1615,7 +1622,9 @@ Result BinaryReaderObjdump::OnMemoryCount(Index count) { return OnCount(count); } -Result BinaryReaderObjdump::OnMemory(Index index, const Limits* page_limits) { +Result BinaryReaderObjdump::OnMemory(Index index, + const Limits* page_limits, + uint32_t page_size) { PrintDetails(" - memory[%" PRIindex "] pages: initial=%" PRId64, index, page_limits->initial); if (page_limits->has_max) { @@ -1627,6 +1636,9 @@ Result BinaryReaderObjdump::OnMemory(Index index, const Limits* page_limits) { if (page_limits->is_64) { PrintDetails(" i64"); } + if (page_size != WABT_DEFAULT_PAGE_SIZE) { + PrintDetails(" (pagesize %u)", page_size); + } PrintDetails("\n"); return Result::Ok; } |