Summary: Associated with D56338.
Reviewers: aheejin, aardappel
Subscribers: dschuff, sbc100, jgravelle-google, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D56339
llvm-svn: 350610
; CHECK-NEXT: FunctionTypes: [ 0, 0 ]
; CHECK-NEXT: - Type: TABLE
; CHECK-NEXT: Tables:
-; CHECK-NEXT: - ElemType: ANYFUNC
+; CHECK-NEXT: - ElemType: FUNCREF
; CHECK-NEXT: Limits:
; CHECK-NEXT: Flags: [ HAS_MAX ]
; CHECK-NEXT: Initial: 0x00000001
; CHECK-NEXT: FunctionTypes: [ 3, 0, 3, 1, 3, 4 ]
; CHECK-NEXT: - Type: TABLE
; CHECK-NEXT: Tables:
-; CHECK-NEXT: - ElemType: ANYFUNC
+; CHECK-NEXT: - ElemType: FUNCREF
; CHECK-NEXT: Limits:
; CHECK-NEXT: Flags: [ HAS_MAX ]
; CHECK-NEXT: Initial: 0x00000003
# CHECK: - Type: TABLE
# CHECK-NEXT: Tables:
-# CHECK-NEXT: - ElemType: ANYFUNC
+# CHECK-NEXT: - ElemType: FUNCREF
# CHECK-NEXT: Limits:
# CHECK-NEXT: Flags: [ HAS_MAX ]
# CHECK-NEXT: Initial: 0x00000001
# CHECK-NEXT: Field: __indirect_function_table
# CHECK-NEXT: Kind: TABLE
# CHECK-NEXT: Table:
-# CHECK-NEXT: ElemType: ANYFUNC
+# CHECK-NEXT: ElemType: FUNCREF
# CHECK-NEXT: Limits:
# CHECK-NEXT: Initial: 0x00000001
; CHECK-NEXT: FunctionTypes: [ 0, 1, 0 ]
; CHECK-NEXT: - Type: TABLE
; CHECK-NEXT: Tables:
-; CHECK-NEXT: - ElemType: ANYFUNC
+; CHECK-NEXT: - ElemType: FUNCREF
; CHECK-NEXT: Limits:
; CHECK-NEXT: Flags: [ HAS_MAX ]
; CHECK-NEXT: Initial: 0x00000001
; CHECK-NEXT: 1, 1, 1 ]
; CHECK-NEXT: - Type: TABLE
; CHECK-NEXT: Tables:
-; CHECK-NEXT: - ElemType: ANYFUNC
+; CHECK-NEXT: - ElemType: FUNCREF
; CHECK-NEXT: Limits:
; CHECK-NEXT: Flags: [ HAS_MAX ]
; CHECK-NEXT: Initial: 0x00000007
; RELOC-NEXT: 0, 0 ]
; RELOC-NEXT: - Type: TABLE
; RELOC-NEXT: Tables:
-; RELOC-NEXT: - ElemType: ANYFUNC
+; RELOC-NEXT: - ElemType: FUNCREF
; RELOC-NEXT: Limits:
; RELOC-NEXT: Flags: [ HAS_MAX ]
; RELOC-NEXT: Initial: 0x00000007
; CHECK-NEXT: FunctionTypes: [ 2, 1, 1 ]
; CHECK-NEXT: - Type: TABLE
; CHECK-NEXT: Tables:
-; CHECK-NEXT: - ElemType: ANYFUNC
+; CHECK-NEXT: - ElemType: FUNCREF
; CHECK-NEXT: Limits:
; CHECK-NEXT: Flags: [ HAS_MAX ]
; CHECK-NEXT: Initial: 0x00000004
; CHECK-NEXT: Field: __indirect_function_table
; CHECK-NEXT: Kind: TABLE
; CHECK-NEXT: Table:
-; CHECK-NEXT: ElemType: ANYFUNC
+; CHECK-NEXT: ElemType: FUNCREF
; CHECK-NEXT: Limits:
; CHECK-NEXT: Initial: 0x00000002
; CHECK-NEXT: - Module: env
; CHECK: - Type: ELEM
; CHECK-NEXT: Segments:
; CHECK-NEXT: - Offset:
-; CHECK-NEXT: Opcode: GET_GLOBAL
+; CHECK-NEXT: Opcode: GLOBAL_GET
; CHECK-NEXT: Index: 2
; CHECK-NEXT: Functions: [ 2, 0 ]
; CHECK-NEXT: - SectionOffset: 6
; CHECK-NEXT: MemoryIndex: 0
; CHECK-NEXT: Offset:
-; CHECK-NEXT: Opcode: GET_GLOBAL
+; CHECK-NEXT: Opcode: GLOBAL_GET
; CHECK-NEXT: Index: 1
; CHECK-NEXT: Content: '0000000001000000'
; CHECK-NEXT: FunctionTypes: [ 0 ]
; CHECK-NEXT: - Type: TABLE
; CHECK-NEXT: Tables:
-; CHECK-NEXT: - ElemType: ANYFUNC
+; CHECK-NEXT: - ElemType: FUNCREF
; CHECK-NEXT: Limits:
; CHECK-NEXT: Flags: [ HAS_MAX ]
; CHECK-NEXT: Initial: 0x00000001
; CHECK-NEXT: FunctionTypes: [ 0, 0, 0, 1, 2 ]
; CHECK-NEXT: - Type: TABLE
; CHECK-NEXT: Tables:
-; CHECK-NEXT: - ElemType: ANYFUNC
+; CHECK-NEXT: - ElemType: FUNCREF
; CHECK-NEXT: Limits:
; CHECK-NEXT: Flags: [ HAS_MAX ]
; CHECK-NEXT: Initial: 0x00000001
; CHECK-NEXT: FunctionTypes: [ 0, 1, 0, 1, 1, 1, 1, 1 ]
; CHECK-NEXT: - Type: TABLE
; CHECK-NEXT: Tables:
-; CHECK-NEXT: - ElemType: ANYFUNC
+; CHECK-NEXT: - ElemType: FUNCREF
; CHECK-NEXT: Limits:
; CHECK-NEXT: Flags: [ HAS_MAX ]
; CHECK-NEXT: Initial: 0x00000003
; CHECK-NEXT: FunctionTypes: [ 0, 0, 1, 1, 1, 1, 1 ]
; CHECK-NEXT: - Type: TABLE
; CHECK-NEXT: Tables:
-; CHECK-NEXT: - ElemType: ANYFUNC
+; CHECK-NEXT: - ElemType: FUNCREF
; CHECK-NEXT: Limits:
; CHECK-NEXT: Flags: [ HAS_MAX ]
; CHECK-NEXT: Initial: 0x00000002
; RELOC-NEXT: FunctionTypes: [ 0, 1, 1, 1, 1, 1 ]
; RELOC-NEXT: - Type: TABLE
; RELOC-NEXT: Tables:
-; RELOC-NEXT: - ElemType: ANYFUNC
+; RELOC-NEXT: - ElemType: FUNCREF
; RELOC-NEXT: Limits:
; RELOC-NEXT: Flags: [ HAS_MAX ]
; RELOC-NEXT: Initial: 0x00000002
; CHECK-NEXT: FunctionTypes: [ 0, 0, 1, 1, 1 ]
; CHECK-NEXT: - Type: TABLE
; CHECK-NEXT: Tables:
-; CHECK-NEXT: - ElemType: ANYFUNC
+; CHECK-NEXT: - ElemType: FUNCREF
; CHECK-NEXT: Limits:
; CHECK-NEXT: Flags: [ HAS_MAX ]
; CHECK-NEXT: Initial: 0x00000002
; CHECK-NEXT: FunctionTypes: [ 0, 1, 1, 0 ]
; CHECK-NEXT: - Type: TABLE
; CHECK-NEXT: Tables:
-; CHECK-NEXT: - ElemType: ANYFUNC
+; CHECK-NEXT: - ElemType: FUNCREF
; CHECK-NEXT: Limits:
; CHECK-NEXT: Flags: [ HAS_MAX ]
; CHECK-NEXT: Initial: 0x00000001
if (Config->Pic) {
assert(Segments.size() <= 1 &&
"Currenly only a single data segment is supported in PIC mode");
- InitExpr.Opcode = WASM_OPCODE_GET_GLOBAL;
+ InitExpr.Opcode = WASM_OPCODE_GLOBAL_GET;
InitExpr.Value.Global = WasmSym::MemoryBase->getGlobalIndex();
} else {
InitExpr.Opcode = WASM_OPCODE_I32_CONST;
Import.Module = "env";
Import.Field = kFunctionTableName;
Import.Kind = WASM_EXTERNAL_TABLE;
- Import.Table.ElemType = WASM_TYPE_ANYFUNC;
+ Import.Table.ElemType = WASM_TYPE_FUNCREF;
Import.Table.Limits = {0, TableSize, 0};
writeImport(OS, Import);
}
writeUleb128(OS, 1, "table count");
WasmLimits Limits = {WASM_LIMITS_FLAG_HAS_MAX, TableSize, TableSize};
- writeTableType(OS, WasmTable{WASM_TYPE_ANYFUNC, Limits});
+ writeTableType(OS, WasmTable{WASM_TYPE_FUNCREF, Limits});
}
void Writer::createExportSection() {
writeUleb128(OS, 0, "table index");
WasmInitExpr InitExpr;
if (Config->Pic) {
- InitExpr.Opcode = WASM_OPCODE_GET_GLOBAL;
+ InitExpr.Opcode = WASM_OPCODE_GLOBAL_GET;
InitExpr.Value.Global = WasmSym::TableBase->getGlobalIndex();
} else {
InitExpr.Opcode = WASM_OPCODE_I32_CONST;
case WASM_OPCODE_I64_CONST:
writeSleb128(OS, InitExpr.Value.Int64, "literal (i64)");
break;
- case WASM_OPCODE_GET_GLOBAL:
+ case WASM_OPCODE_GLOBAL_GET:
writeUleb128(OS, InitExpr.Value.Global, "literal (global index)");
break;
default:
}
void wasm::writeTableType(raw_ostream &OS, const llvm::wasm::WasmTable &Type) {
- writeU8(OS, WASM_TYPE_ANYFUNC, "table type");
+ writeU8(OS, WASM_TYPE_FUNCREF, "table type");
writeLimits(OS, Type.Limits);
}