Changeset 246577 in webkit
- Timestamp:
- Jun 18, 2019 6:18:43 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r246571 r246577 1 2019-06-18 Justin Michaud <justin_michaud@apple.com> 2 3 [WASM-References] Add support for Table.size, grow and fill instructions 4 https://bugs.webkit.org/show_bug.cgi?id=198761 5 6 Reviewed by Yusuke Suzuki. 7 8 * wasm/Builder_WebAssemblyBinary.js: 9 (const.putOp): 10 * wasm/references/table_misc.js: Added. 11 (TableSize.End.End.WebAssembly): 12 (GetLocal.0.GetLocal.1.TableGrow.End.End.WebAssembly): 13 * wasm/wasm.json: 14 1 15 2019-06-18 Justin Michaud <justin_michaud@apple.com> 2 16 -
trunk/JSTests/wasm/Builder_WebAssemblyBinary.js
r245765 r246577 61 61 const putOp = (bin, op) => { 62 62 put(bin, "uint8", op.value); 63 if (WASM.description.opcode[op.name].extendedOp) 64 put(bin, "uint8", WASM.description.opcode[op.name].extendedOp); 63 65 if (op.arguments.length !== 0) 64 66 throw new Error(`Unimplemented: arguments`); // FIXME https://bugs.webkit.org/show_bug.cgi?id=162706 -
trunk/JSTests/wasm/wasm.json
r246571 r246577 70 70 "table.get": { "category": "special", "value": 37, "return": ["anyref"], "parameter": ["i32"], "immediate": [{"name": "table_index", "type": "varuint32"}], "description": "get a table value" }, 71 71 "table.set": { "category": "special", "value": 38, "return": [], "parameter": ["i32", "anyref"], "immediate": [{"name": "table_index", "type": "varuint32"}], "description": "set a table value" }, 72 "table.size": { "category": "exttable", "value": 252, "return": ["i32"], "parameter": [], "immediate": [{"name": "global_index", "type": "varuint32"}], "description": "get the size of a table", "extendedOp": 15 }, 73 "table.grow": { "category": "exttable", "value": 252, "return": ["i32"], "parameter": ["anyref", "i32"], "immediate": [{"name": "global_index", "type": "varuint32"}], "description": "grow a table by the given delta and return the previous size, or -1 if enough space cannot be allocated", "extendedOp": 16 }, 74 "table.fill": { "category": "exttable", "value": 252, "return": ["i32"], "parameter": ["i32", "anyref", "i32"], "immediate": [{"name": "global_index", "type": "varuint32"}], "description": "fill entries [i,i+n) with the given value", "extendedOp": 17 }, 72 75 "call": { "category": "call", "value": 16, "return": ["call"], "parameter": ["call"], "immediate": [{"name": "function_index", "type": "varuint32"}], "description": "call a function by its index" }, 73 76 "call_indirect": { "category": "call", "value": 17, "return": ["call"], "parameter": ["call"], "immediate": [{"name": "type_index", "type": "varuint32"}, {"name": "table_index","type": "varuint32"}],"description": "call a function indirect with an expected signature" }, -
trunk/Source/JavaScriptCore/ChangeLog
r246572 r246577 1 2019-06-18 Justin Michaud <justin_michaud@apple.com> 2 3 [WASM-References] Add support for Table.size, grow and fill instructions 4 https://bugs.webkit.org/show_bug.cgi?id=198761 5 6 Reviewed by Yusuke Suzuki. 7 8 Add support for Table.size, grow and fill instructions. This also required 9 adding support for two-byte opcodes to the ops generator. 10 11 * wasm/WasmAirIRGenerator.cpp: 12 (JSC::Wasm::AirIRGenerator::gAnyref): 13 (JSC::Wasm::AirIRGenerator::tmpForType): 14 (JSC::Wasm::AirIRGenerator::addTableSize): 15 (JSC::Wasm::AirIRGenerator::addTableGrow): 16 (JSC::Wasm::AirIRGenerator::addTableFill): 17 * wasm/WasmB3IRGenerator.cpp: 18 (JSC::Wasm::B3IRGenerator::addTableSize): 19 (JSC::Wasm::B3IRGenerator::addTableGrow): 20 (JSC::Wasm::B3IRGenerator::addTableFill): 21 * wasm/WasmExceptionType.h: 22 * wasm/WasmFormat.h: 23 (JSC::Wasm::TableInformation::wasmType const): 24 * wasm/WasmFunctionParser.h: 25 (JSC::Wasm::FunctionParser<Context>::parseExpression): 26 (JSC::Wasm::FunctionParser<Context>::parseUnreachableExpression): 27 * wasm/WasmInstance.cpp: 28 (JSC::Wasm::doWasmTableGrow): 29 (JSC::Wasm::doWasmTableFill): 30 * wasm/WasmInstance.h: 31 * wasm/WasmTable.cpp: 32 (JSC::Wasm::Table::grow): 33 * wasm/WasmValidate.cpp: 34 (JSC::Wasm::Validate::addTableSize): 35 (JSC::Wasm::Validate::addTableGrow): 36 (JSC::Wasm::Validate::addTableFill): 37 * wasm/generateWasmOpsHeader.py: 38 (opcodeMacroizer): 39 (ExtTableOpType): 40 * wasm/wasm.json: 41 1 42 2019-06-18 Keith Miller <keith_miller@apple.com> 2 43 -
trunk/Source/JavaScriptCore/wasm/WasmAirIRGenerator.cpp
r246571 r246577 240 240 PartialResult WARN_UNUSED_RETURN addTableGet(unsigned, ExpressionType& index, ExpressionType& result); 241 241 PartialResult WARN_UNUSED_RETURN addTableSet(unsigned, ExpressionType& index, ExpressionType& value); 242 PartialResult WARN_UNUSED_RETURN addTableSize(unsigned, ExpressionType& result); 243 PartialResult WARN_UNUSED_RETURN addTableGrow(unsigned, ExpressionType& fill, ExpressionType& delta, ExpressionType& result); 244 PartialResult WARN_UNUSED_RETURN addTableFill(unsigned, ExpressionType& offset, ExpressionType& fill, ExpressionType& count); 242 245 243 246 // Locals … … 362 365 TypedTmp g32() { return { newTmp(B3::GP), Type::I32 }; } 363 366 TypedTmp g64() { return { newTmp(B3::GP), Type::I64 }; } 367 TypedTmp gAnyref() { return { newTmp(B3::GP), Type::Anyref }; } 368 TypedTmp gAnyfunc() { return { newTmp(B3::GP), Type::Anyfunc }; } 364 369 TypedTmp f32() { return { newTmp(B3::FP), Type::F32 }; } 365 370 TypedTmp f64() { return { newTmp(B3::FP), Type::F64 }; } … … 371 376 return g32(); 372 377 case Type::I64: 378 return g64(); 379 case Type::Anyfunc: 380 return gAnyfunc(); 373 381 case Type::Anyref: 374 case Type::Anyfunc: 375 return g64(); 382 return gAnyref(); 376 383 case Type::F32: 377 384 return f32(); … … 509 516 break; 510 517 case Type::I64: 518 case Type::Anyref: 519 case Type::Anyfunc: 511 520 resultType = B3::Int64; 512 521 break; … … 976 985 ASSERT(index.tmp()); 977 986 ASSERT(index.type() == Type::I32); 978 result = tmpForType( Type::Anyref);987 result = tmpForType(m_info.tables[tableIndex].wasmType()); 979 988 980 989 emitCCall(&getWasmTableElement, result, instanceValue(), addConstant(Type::I32, tableIndex), index); … … 1000 1009 emitCheck([&] { 1001 1010 return Inst(BranchTest32, nullptr, Arg::resCond(MacroAssembler::Zero), shouldThrow, shouldThrow); 1011 }, [=] (CCallHelpers& jit, const B3::StackmapGenerationParams&) { 1012 this->emitThrowException(jit, ExceptionType::OutOfBoundsTableAccess); 1013 }); 1014 1015 return { }; 1016 } 1017 1018 auto AirIRGenerator::addTableSize(unsigned tableIndex, ExpressionType& result) -> PartialResult 1019 { 1020 // FIXME: Emit this inline <https://bugs.webkit.org/show_bug.cgi?id=198506>. 1021 result = tmpForType(Type::I32); 1022 1023 int32_t (*doSize)(Instance*, unsigned) = [] (Instance* instance, unsigned tableIndex) -> int32_t { 1024 return instance->table(tableIndex)->length(); 1025 }; 1026 1027 emitCCall(doSize, result, instanceValue(), addConstant(Type::I32, tableIndex)); 1028 1029 return { }; 1030 } 1031 1032 auto AirIRGenerator::addTableGrow(unsigned tableIndex, ExpressionType& fill, ExpressionType& delta, ExpressionType& result) -> PartialResult 1033 { 1034 ASSERT(fill.tmp()); 1035 ASSERT(isSubtype(fill.type(), m_info.tables[tableIndex].wasmType())); 1036 ASSERT(delta.tmp()); 1037 ASSERT(delta.type() == Type::I32); 1038 result = tmpForType(Type::I32); 1039 1040 emitCCall(&doWasmTableGrow, result, instanceValue(), addConstant(Type::I32, tableIndex), fill, delta); 1041 1042 return { }; 1043 } 1044 1045 auto AirIRGenerator::addTableFill(unsigned tableIndex, ExpressionType& offset, ExpressionType& fill, ExpressionType& count) -> PartialResult 1046 { 1047 ASSERT(fill.tmp()); 1048 ASSERT(isSubtype(fill.type(), m_info.tables[tableIndex].wasmType())); 1049 ASSERT(offset.tmp()); 1050 ASSERT(offset.type() == Type::I32); 1051 ASSERT(count.tmp()); 1052 ASSERT(count.type() == Type::I32); 1053 1054 auto result = tmpForType(Type::I32); 1055 emitCCall(&doWasmTableFill, result, instanceValue(), addConstant(Type::I32, tableIndex), offset, fill, count); 1056 1057 emitCheck([&] { 1058 return Inst(BranchTest32, nullptr, Arg::resCond(MacroAssembler::Zero), result, result); 1002 1059 }, [=] (CCallHelpers& jit, const B3::StackmapGenerationParams&) { 1003 1060 this->emitThrowException(jit, ExceptionType::OutOfBoundsTableAccess); -
trunk/Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp
r246571 r246577 193 193 PartialResult WARN_UNUSED_RETURN addTableGet(unsigned, ExpressionType& index, ExpressionType& result); 194 194 PartialResult WARN_UNUSED_RETURN addTableSet(unsigned, ExpressionType& index, ExpressionType& value); 195 195 PartialResult WARN_UNUSED_RETURN addTableSize(unsigned, ExpressionType& result); 196 PartialResult WARN_UNUSED_RETURN addTableGrow(unsigned, ExpressionType& fill, ExpressionType& delta, ExpressionType& result); 197 PartialResult WARN_UNUSED_RETURN addTableFill(unsigned, ExpressionType& offset, ExpressionType& fill, ExpressionType& count); 196 198 // Locals 197 199 PartialResult WARN_UNUSED_RETURN getLocal(uint32_t index, ExpressionType& result); … … 618 620 } 619 621 622 auto B3IRGenerator::addTableSize(unsigned tableIndex, ExpressionType& result) -> PartialResult 623 { 624 // FIXME: Emit this inline <https://bugs.webkit.org/show_bug.cgi?id=198506>. 625 uint32_t (*doSize)(Instance*, unsigned) = [] (Instance* instance, unsigned tableIndex) -> uint32_t { 626 return instance->table(tableIndex)->length(); 627 }; 628 629 result = m_currentBlock->appendNew<CCallValue>(m_proc, toB3Type(I32), origin(), 630 m_currentBlock->appendNew<ConstPtrValue>(m_proc, origin(), tagCFunctionPtr<void*>(doSize, B3CCallPtrTag)), 631 instanceValue(), m_currentBlock->appendNew<Const32Value>(m_proc, origin(), tableIndex)); 632 633 return { }; 634 } 635 636 auto B3IRGenerator::addTableGrow(unsigned tableIndex, ExpressionType& fill, ExpressionType& delta, ExpressionType& result) -> PartialResult 637 { 638 result = m_currentBlock->appendNew<CCallValue>(m_proc, toB3Type(I32), origin(), 639 m_currentBlock->appendNew<ConstPtrValue>(m_proc, origin(), tagCFunctionPtr<void*>(&doWasmTableGrow, B3CCallPtrTag)), 640 instanceValue(), m_currentBlock->appendNew<Const32Value>(m_proc, origin(), tableIndex), fill, delta); 641 642 return { }; 643 } 644 645 auto B3IRGenerator::addTableFill(unsigned tableIndex, ExpressionType& offset, ExpressionType& fill, ExpressionType& count) -> PartialResult 646 { 647 auto result = m_currentBlock->appendNew<CCallValue>(m_proc, toB3Type(I32), origin(), 648 m_currentBlock->appendNew<ConstPtrValue>(m_proc, origin(), tagCFunctionPtr<void*>(&doWasmTableFill, B3CCallPtrTag)), 649 instanceValue(), m_currentBlock->appendNew<Const32Value>(m_proc, origin(), tableIndex), offset, fill, count); 650 651 { 652 CheckValue* check = m_currentBlock->appendNew<CheckValue>(m_proc, Check, origin(), 653 m_currentBlock->appendNew<Value>(m_proc, Equal, origin(), result, m_currentBlock->appendNew<Const32Value>(m_proc, origin(), 0))); 654 655 check->setGenerator([=] (CCallHelpers& jit, const B3::StackmapGenerationParams&) { 656 this->emitExceptionCheck(jit, ExceptionType::OutOfBoundsTableAccess); 657 }); 658 } 659 660 return { }; 661 } 662 620 663 auto B3IRGenerator::getLocal(uint32_t index, ExpressionType& result) -> PartialResult 621 664 { -
trunk/Source/JavaScriptCore/wasm/WasmExceptionType.h
r246504 r246577 34 34 #define FOR_EACH_EXCEPTION(macro) \ 35 35 macro(OutOfBoundsMemoryAccess, "Out of bounds memory access") \ 36 macro(OutOfBoundsTableAccess, 36 macro(OutOfBoundsTableAccess, "Out of bounds table access") \ 37 37 macro(OutOfBoundsCallIndirect, "Out of bounds call_indirect") \ 38 38 macro(NullTableEntry, "call_indirect to a null table entry") \ -
trunk/Source/JavaScriptCore/wasm/WasmFunctionParser.h
r246571 r246577 304 304 } 305 305 306 case ExtTable: { 307 WASM_PARSER_FAIL_IF(!Options::useWebAssemblyReferences(), "references are not enabled"); 308 uint8_t extOp; 309 WASM_PARSER_FAIL_IF(!parseUInt8(extOp), "can't parse table extended opcode"); 310 unsigned tableIndex; 311 WASM_PARSER_FAIL_IF(!parseVarUInt32(tableIndex), "can't parse table index"); 312 313 switch (static_cast<ExtTableOpType>(extOp)) { 314 case ExtTableOpType::TableSize: { 315 ExpressionType result; 316 WASM_TRY_ADD_TO_CONTEXT(addTableSize(tableIndex, result)); 317 m_expressionStack.append(result); 318 break; 319 } 320 case ExtTableOpType::TableGrow: { 321 ExpressionType fill, delta, result; 322 WASM_TRY_POP_EXPRESSION_STACK_INTO(delta, "table.grow"); 323 WASM_TRY_POP_EXPRESSION_STACK_INTO(fill, "table.grow"); 324 WASM_TRY_ADD_TO_CONTEXT(addTableGrow(tableIndex, fill, delta, result)); 325 m_expressionStack.append(result); 326 break; 327 } 328 case ExtTableOpType::TableFill: { 329 ExpressionType offset, fill, count; 330 WASM_TRY_POP_EXPRESSION_STACK_INTO(count, "table.fill"); 331 WASM_TRY_POP_EXPRESSION_STACK_INTO(fill, "table.fill"); 332 WASM_TRY_POP_EXPRESSION_STACK_INTO(offset, "table.fill"); 333 WASM_TRY_ADD_TO_CONTEXT(addTableFill(tableIndex, offset, fill, count)); 334 break; 335 } 336 default: 337 WASM_PARSER_FAIL_IF(true, "invalid extended table op ", extOp); 338 break; 339 } 340 return { }; 341 } 342 306 343 case RefNull: { 307 344 WASM_PARSER_FAIL_IF(!Options::useWebAssemblyReferences(), "references are not enabled"); … … 689 726 } 690 727 728 case ExtTable: 691 729 case TableGet: 692 730 case TableSet: { -
trunk/Source/JavaScriptCore/wasm/WasmInstance.cpp
r246571 r246577 160 160 } 161 161 162 int32_t doWasmTableGrow(Instance* instance, unsigned tableIndex, EncodedJSValue fill, int32_t delta) 163 { 164 ASSERT(tableIndex < instance->module().moduleInformation().tableCount()); 165 auto oldSize = instance->table(tableIndex)->length(); 166 if (delta < 0) 167 return oldSize; 168 auto newSize = instance->table(tableIndex)->grow(delta); 169 if (!newSize || *newSize == oldSize) 170 return -1; 171 172 for (unsigned i = oldSize; i < instance->table(tableIndex)->length(); ++i) 173 setWasmTableElement(instance, tableIndex, i, fill); 174 175 return oldSize; 176 } 177 178 bool doWasmTableFill(Instance* instance, unsigned tableIndex, int32_t unsafeOffset, EncodedJSValue fill, int32_t unsafeCount) 179 { 180 ASSERT(tableIndex < instance->module().moduleInformation().tableCount()); 181 if (unsafeOffset < 0 || unsafeCount < 0) 182 return false; 183 184 unsigned offset = unsafeOffset; 185 unsigned count = unsafeCount; 186 187 if (offset >= instance->table(tableIndex)->length() || offset + count > instance->table(tableIndex)->length()) 188 return false; 189 190 for (unsigned j = 0; j < count; ++j) 191 setWasmTableElement(instance, tableIndex, offset + j, fill); 192 193 return true; 194 } 195 162 196 EncodedJSValue doWasmRefFunc(Instance* instance, uint32_t index) 163 197 { -
trunk/Source/JavaScriptCore/wasm/WasmInstance.h
r246571 r246577 45 45 bool setWasmTableElement(Instance*, unsigned, int32_t, EncodedJSValue encValue); 46 46 EncodedJSValue doWasmRefFunc(Instance*, uint32_t); 47 int32_t doWasmTableGrow(Instance*, unsigned, EncodedJSValue fill, int32_t delta); 48 bool doWasmTableFill(Instance*, unsigned, int32_t offset, EncodedJSValue fill, int32_t count); 47 49 48 50 class Instance : public ThreadSafeRefCounted<Instance>, public CanMakeWeakPtr<Instance> { -
trunk/Source/JavaScriptCore/wasm/WasmValidate.cpp
r246571 r246577 109 109 Result WARN_UNUSED_RETURN addTableGet(unsigned, ExpressionType& index, ExpressionType& result); 110 110 Result WARN_UNUSED_RETURN addTableSet(unsigned, ExpressionType& index, ExpressionType& value); 111 111 Result WARN_UNUSED_RETURN addTableSize(unsigned, ExpressionType& result); 112 Result WARN_UNUSED_RETURN addTableGrow(unsigned, ExpressionType& fill, ExpressionType& delta, ExpressionType& result); 113 Result WARN_UNUSED_RETURN addTableFill(unsigned, ExpressionType& offset, ExpressionType& fill, ExpressionType& count); 112 114 // Locals 113 115 Result WARN_UNUSED_RETURN getLocal(uint32_t index, ExpressionType& result); … … 195 197 WASM_VALIDATOR_FAIL_IF(!isSubtype(value, type), "table.set value to type ", value, " expected ", type); 196 198 RELEASE_ASSERT(m_module.tables[tableIndex].type() == TableElementType::Anyref || m_module.tables[tableIndex].type() == TableElementType::Funcref); 199 200 return { }; 201 } 202 203 auto Validate::addTableSize(unsigned tableIndex, ExpressionType& result) -> Result 204 { 205 result = Type::I32; 206 WASM_VALIDATOR_FAIL_IF(tableIndex >= m_module.tableCount(), "table index ", tableIndex, " is invalid, limit is ", m_module.tableCount()); 207 208 return { }; 209 } 210 211 auto Validate::addTableGrow(unsigned tableIndex, ExpressionType& fill, ExpressionType& delta, ExpressionType& result) -> Result 212 { 213 result = Type::I32; 214 WASM_VALIDATOR_FAIL_IF(tableIndex >= m_module.tableCount(), "table index ", tableIndex, " is invalid, limit is ", m_module.tableCount()); 215 WASM_VALIDATOR_FAIL_IF(!isSubtype(fill, m_module.tables[tableIndex].wasmType()), "table.grow expects fill value of type ", m_module.tables[tableIndex].wasmType(), " got ", fill); 216 WASM_VALIDATOR_FAIL_IF(Type::I32 != delta, "table.grow expects an i32 delta value, got ", delta); 217 218 return { }; 219 } 220 221 auto Validate::addTableFill(unsigned tableIndex, ExpressionType& offset, ExpressionType& fill, ExpressionType& count) -> Result 222 { 223 WASM_VALIDATOR_FAIL_IF(tableIndex >= m_module.tableCount(), "table index ", tableIndex, " is invalid, limit is ", m_module.tableCount()); 224 WASM_VALIDATOR_FAIL_IF(!isSubtype(fill, m_module.tables[tableIndex].wasmType()), "table.fill expects fill value of type ", m_module.tables[tableIndex].wasmType(), " got ", fill); 225 WASM_VALIDATOR_FAIL_IF(Type::I32 != offset, "table.fill expects an i32 offset value, got ", offset); 226 WASM_VALIDATOR_FAIL_IF(Type::I32 != count, "table.fill expects an i32 count value, got ", count); 197 227 198 228 return { }; -
trunk/Source/JavaScriptCore/wasm/generateWasmOpsHeader.py
r245496 r246577 56 56 57 57 58 def opcodeMacroizer(filter ):58 def opcodeMacroizer(filter, opcodeField="value"): 59 59 inc = 0 60 60 for op in wasm.opcodeIterator(filter): … … 62 62 if isSimple(op["opcode"]): 63 63 b3op = op["opcode"]["b3op"] 64 yield cppMacro(op["name"], op["opcode"][ "value"], b3op, inc)64 yield cppMacro(op["name"], op["opcode"][opcodeField], b3op, inc) 65 65 inc += 1 66 66 67 67 defines = ["#define FOR_EACH_WASM_SPECIAL_OP(macro)"] 68 defines.extend([op for op in opcodeMacroizer(lambda op: not (isUnary(op) or isBinary(op) or op["category"] == "control" or op["category"] == "memory" ))])68 defines.extend([op for op in opcodeMacroizer(lambda op: not (isUnary(op) or isBinary(op) or op["category"] == "control" or op["category"] == "memory" or op["category"] == "exttable"))]) 69 69 defines.append("\n\n#define FOR_EACH_WASM_CONTROL_FLOW_OP(macro)") 70 70 defines.extend([op for op in opcodeMacroizer(lambda op: op["category"] == "control")]) … … 81 81 defines.append("\n\n#define FOR_EACH_WASM_MEMORY_STORE_OP(macro)") 82 82 defines.extend([op for op in opcodeMacroizer(lambda op: (op["category"] == "memory" and len(op["return"]) == 0))]) 83 defines.append("\n\n#define FOR_EACH_WASM_EXT_TABLE_OP(macro)") 84 defines.extend([op for op in opcodeMacroizer(lambda op: (op["category"] == "exttable"), "extendedOp")]) 83 85 defines.append("\n\n") 84 86 … … 203 205 FOR_EACH_WASM_BINARY_OP(macro) \\ 204 206 FOR_EACH_WASM_MEMORY_LOAD_OP(macro) \\ 205 FOR_EACH_WASM_MEMORY_STORE_OP(macro) 207 FOR_EACH_WASM_MEMORY_STORE_OP(macro) \\ 208 macro(ExtTable, 0xFC, Oops, 0) 206 209 207 210 #define CREATE_ENUM_VALUE(name, id, b3op, inc) name = id, … … 233 236 enum class StoreOpType : uint8_t { 234 237 FOR_EACH_WASM_MEMORY_STORE_OP(CREATE_ENUM_VALUE) 238 }; 239 240 enum class ExtTableOpType : uint8_t { 241 FOR_EACH_WASM_EXT_TABLE_OP(CREATE_ENUM_VALUE) 235 242 }; 236 243 -
trunk/Source/JavaScriptCore/wasm/wasm.json
r246571 r246577 70 70 "table.get": { "category": "special", "value": 37, "return": ["anyref"], "parameter": ["i32"], "immediate": [{"name": "table_index", "type": "varuint32"}], "description": "get a table value" }, 71 71 "table.set": { "category": "special", "value": 38, "return": [], "parameter": ["i32", "anyref"], "immediate": [{"name": "table_index", "type": "varuint32"}], "description": "set a table value" }, 72 "table.size": { "category": "exttable", "value": 252, "return": ["i32"], "parameter": [], "immediate": [{"name": "table_index", "type": "varuint32"}], "description": "get the size of a table", "extendedOp": 15 }, 73 "table.grow": { "category": "exttable", "value": 252, "return": ["i32"], "parameter": ["anyref", "i32"], "immediate": [{"name": "table_index", "type": "varuint32"}], "description": "grow a table by the given delta and return the previous size, or -1 if enough space cannot be allocated", "extendedOp": 16 }, 74 "table.fill": { "category": "exttable", "value": 252, "return": ["i32"], "parameter": ["i32", "anyref", "i32"], "immediate": [{"name": "table_index", "type": "varuint32"}], "description": "fill entries [i,i+n) with the given value", "extendedOp": 17 }, 72 75 "call": { "category": "call", "value": 16, "return": ["call"], "parameter": ["call"], "immediate": [{"name": "function_index", "type": "varuint32"}], "description": "call a function by its index" }, 73 76 "call_indirect": { "category": "call", "value": 17, "return": ["call"], "parameter": ["call"], "immediate": [{"name": "type_index", "type": "varuint32"}, {"name": "table_index","type": "varuint32"}],"description": "call a function indirect with an expected signature" },
Note: See TracChangeset
for help on using the changeset viewer.