mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 12:12:47 +01:00
0ac187d2cf
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
84 lines
3.0 KiB
ArmAsm
84 lines
3.0 KiB
ArmAsm
# RUN: llvm-mc -triple=wasm32-unknown-unknown -mattr=+reference-types < %s | FileCheck --check-prefix=CHECK %s
|
|
# RUN: llvm-mc -triple=wasm32-unknown-unknown -mattr=+reference-types -filetype=obj < %s | obj2yaml | FileCheck -check-prefix=BIN %s
|
|
|
|
test0:
|
|
.functype test0 () -> ()
|
|
i32.const 42
|
|
f64.const 2.5
|
|
i32.const 0
|
|
call_indirect empty_fref_table, (i32, f64) -> ()
|
|
end_function
|
|
|
|
.tabletype empty_fref_table, funcref
|
|
empty_fref_table:
|
|
|
|
|
|
# CHECK: .text
|
|
# CHECK-LABEL: test0:
|
|
# CHECK-NEXT: .functype test0 () -> ()
|
|
# CHECK-NEXT: i32.const 42
|
|
# CHECK-NEXT: f64.const 0x1.4p1
|
|
# CHECK-NEXT: i32.const 0
|
|
# CHECK-NEXT: call_indirect empty_fref_table, (i32, f64) -> ()
|
|
# CHECK-NEXT: end_function
|
|
|
|
# CHECK: .tabletype empty_fref_table, funcref
|
|
# CHECK: empty_fref_table:
|
|
|
|
# BIN: --- !WASM
|
|
# BIN-NEXT: FileHeader:
|
|
# BIN-NEXT: Version: 0x1
|
|
# BIN-NEXT: Sections:
|
|
# BIN-NEXT: - Type: TYPE
|
|
# BIN-NEXT: Signatures:
|
|
# BIN-NEXT: - Index: 0
|
|
# BIN-NEXT: ParamTypes: []
|
|
# BIN-NEXT: ReturnTypes: []
|
|
# BIN-NEXT: - Index: 1
|
|
# BIN-NEXT: ParamTypes:
|
|
# BIN-NEXT: - I32
|
|
# BIN-NEXT: - F64
|
|
# BIN-NEXT: ReturnTypes: []
|
|
# BIN-NEXT: - Type: IMPORT
|
|
# BIN-NEXT: Imports:
|
|
# BIN-NEXT: - Module: env
|
|
# BIN-NEXT: Field: __linear_memory
|
|
# BIN-NEXT: Kind: MEMORY
|
|
# BIN-NEXT: Memory:
|
|
# BIN-NEXT: Minimum: 0x0
|
|
# BIN-NEXT: - Type: FUNCTION
|
|
# BIN-NEXT: FunctionTypes: [ 0 ]
|
|
# BIN-NEXT: - Type: TABLE
|
|
# BIN-NEXT: Tables:
|
|
# BIN-NEXT: - Index: 0
|
|
# BIN-NEXT: ElemType: FUNCREF
|
|
# BIN-NEXT: Limits:
|
|
# BIN-NEXT: Minimum: 0x0
|
|
# BIN-NEXT: - Type: CODE
|
|
# BIN-NEXT: Relocations:
|
|
# BIN-NEXT: - Type: R_WASM_TYPE_INDEX_LEB
|
|
# BIN-NEXT: Index: 1
|
|
# BIN-NEXT: Offset: 0x11
|
|
# BIN-NEXT: - Type: R_WASM_TABLE_NUMBER_LEB
|
|
# BIN-NEXT: Index: 1
|
|
# BIN-NEXT: Offset: 0x16
|
|
# BIN-NEXT: Functions:
|
|
# BIN-NEXT: - Index: 0
|
|
# BIN-NEXT: Locals: []
|
|
# BIN-NEXT: Body: 412A440000000000000440410011818080800080808080000B
|
|
# BIN-NEXT: - Type: CUSTOM
|
|
# BIN-NEXT: Name: linking
|
|
# BIN-NEXT: Version: 2
|
|
# BIN-NEXT: SymbolTable:
|
|
# BIN-NEXT: - Index: 0
|
|
# BIN-NEXT: Kind: FUNCTION
|
|
# BIN-NEXT: Name: test0
|
|
# BIN-NEXT: Flags: [ BINDING_LOCAL ]
|
|
# BIN-NEXT: Function: 0
|
|
# BIN-NEXT: - Index: 1
|
|
# BIN-NEXT: Kind: TABLE
|
|
# BIN-NEXT: Name: empty_fref_table
|
|
# BIN-NEXT: Flags: [ BINDING_LOCAL ]
|
|
# BIN-NEXT: Table: 0
|
|
# BIN-NEXT: ...
|