[all-commits] [llvm/llvm-project] 9ac562: [WebAssembly] Rename WasmLimits::Initial to ::Mini...

Andy Wingo via All-commits all-commits at lists.llvm.org
Wed Mar 24 01:11:29 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9ac5620cb8548c0bd0150f0da68219dd3a5a657a
      https://github.com/llvm/llvm-project/commit/9ac5620cb8548c0bd0150f0da68219dd3a5a657a
  Author: Andy Wingo <wingo at igalia.com>
  Date:   2021-03-24 (Wed, 24 Mar 2021)

  Changed paths:
    M lld/test/wasm/alias.s
    M lld/test/wasm/bsymbolic.s
    M lld/test/wasm/call-indirect.ll
    M lld/test/wasm/data-layout.s
    M lld/test/wasm/export-table-explicit.test
    M lld/test/wasm/export-table.test
    M lld/test/wasm/growable-table.test
    M lld/test/wasm/import-memory.test
    M lld/test/wasm/import-table.test
    M lld/test/wasm/large-memory.test
    M lld/test/wasm/local-symbols.ll
    M lld/test/wasm/locals-duplicate.test
    M lld/test/wasm/multi-table.s
    M lld/test/wasm/pie.ll
    M lld/test/wasm/relocatable.ll
    M lld/test/wasm/responsefile.test
    M lld/test/wasm/shared-memory-no-atomics.yaml
    M lld/test/wasm/shared-memory.yaml
    M lld/test/wasm/shared.ll
    M lld/test/wasm/stack-pointer.ll
    M lld/test/wasm/undefined-weak-call.s
    M lld/test/wasm/weak-alias-overide.ll
    M lld/test/wasm/weak-alias.ll
    M lld/test/wasm/weak-symbols.s
    M lld/test/wasm/weak-undefined.s
    M lld/wasm/SyntheticSections.cpp
    M lld/wasm/Writer.cpp
    M lld/wasm/WriterUtils.cpp
    M llvm/include/llvm/BinaryFormat/Wasm.h
    M llvm/include/llvm/ObjectYAML/WasmYAML.h
    M llvm/lib/MC/WasmObjectWriter.cpp
    M llvm/lib/Object/WasmObjectFile.cpp
    M llvm/lib/ObjectYAML/WasmEmitter.cpp
    M llvm/lib/ObjectYAML/WasmYAML.cpp
    M llvm/test/CodeGen/WebAssembly/call-indirect.ll
    M llvm/test/CodeGen/WebAssembly/function-pointer64.ll
    M llvm/test/MC/WebAssembly/assembler-binary.ll
    M llvm/test/MC/WebAssembly/call-indirect-relocs.s
    M llvm/test/MC/WebAssembly/comdat.ll
    M llvm/test/MC/WebAssembly/data-section.s
    M llvm/test/MC/WebAssembly/global-ctor-dtor.ll
    M llvm/test/MC/WebAssembly/reloc-pic.s
    M llvm/test/MC/WebAssembly/tables.s
    M llvm/test/MC/WebAssembly/type-index.s
    M llvm/test/MC/WebAssembly/wasm64.s
    M llvm/test/MC/WebAssembly/weak-alias.s
    M llvm/test/Object/wasm-relocs-and-producers.yaml
    M llvm/test/ObjectYAML/wasm/data_section.yaml
    M llvm/test/ObjectYAML/wasm/elem_section.yaml
    M llvm/test/ObjectYAML/wasm/import_memory_shared.yaml
    M llvm/test/ObjectYAML/wasm/import_section.yaml
    M llvm/test/ObjectYAML/wasm/memory_section.yaml
    M llvm/test/ObjectYAML/wasm/multiple-tables.yaml
    M llvm/test/ObjectYAML/wasm/table_section.yaml
    M llvm/test/tools/llvm-readobj/wasm/wasm-imports.test
    M llvm/tools/llvm-readobj/WasmDumper.cpp
    M llvm/tools/obj2yaml/wasm2yaml.cpp

  Log Message:
  -----------
  [WebAssembly] Rename WasmLimits::Initial to ::Minimum.  NFC.

This patch renames the "Initial" member of WasmLimits to the name used
in the spec, "Minimum".

In the core WebAssembly specification, the Limits data type has one
required "min" member and one optional "max" member, indicating the
minimum required size of the corresponding table or memory, and the
maximum size, if any.

Although the WebAssembly spec does instantiate locally-defined tables
and memories with the initial size being equal to the minimum size, it
can't impose such a requirement for imports.  It doesn't make sense to
require an initial size for a memory import, for example.  The compiler
can only sensibly express the minimum and maximum sizes.

See
https://github.com/WebAssembly/js-types/blob/master/proposals/js-types/Overview.md#naming-of-size-limits
for a related discussion that agrees that the right name of "initial" is
"minimum" when querying the type of a table or memory from JavaScript.
(Of course it still makes sense for JS to speak in terms of an initial
size when it explicitly instantiates memories and tables.)

Differential Revision: https://reviews.llvm.org/D99186




More information about the All-commits mailing list