Lines Matching refs:imm
665 const BranchTableImmediate<validate>& imm) in BranchTableIterator() argument
667 start_(imm.start), in BranchTableIterator()
668 pc_(imm.table), in BranchTableIterator()
669 table_count_(imm.table_count) {} in BranchTableIterator()
964 F(LocalGet, Value* result, const LocalIndexImmediate<validate>& imm) \
965 F(LocalSet, const Value& value, const LocalIndexImmediate<validate>& imm) \
967 const LocalIndexImmediate<validate>& imm) \
970 F(GlobalGet, Value* result, const GlobalIndexImmediate<validate>& imm) \
971 F(GlobalSet, const Value& value, const GlobalIndexImmediate<validate>& imm) \
973 const TableIndexImmediate<validate>& imm) \
975 const TableIndexImmediate<validate>& imm) \
981 F(BrTable, const BranchTableImmediate<validate>& imm, const Value& key) \
983 F(LoadMem, LoadType type, const MemoryAccessImmediate<validate>& imm, \
986 const MemoryAccessImmediate<validate>& imm, const Value& index, \
989 const MemoryAccessImmediate<validate>& imm, const uint8_t laneidx, \
991 F(StoreMem, StoreType type, const MemoryAccessImmediate<validate>& imm, \
993 F(StoreLane, StoreType type, const MemoryAccessImmediate<validate>& imm, \
997 F(CallDirect, const CallFunctionImmediate<validate>& imm, \
1000 const CallIndirectImmediate<validate>& imm, const Value args[], \
1006 F(ReturnCall, const CallFunctionImmediate<validate>& imm, \
1009 const CallIndirectImmediate<validate>& imm, const Value args[]) \
1012 F(SimdLaneOp, WasmOpcode opcode, const SimdLaneImmediate<validate>& imm, \
1014 F(S128Const, const Simd128Immediate<validate>& imm, Value* result) \
1015 F(Simd8x16ShuffleOp, const Simd128Immediate<validate>& imm, \
1017 F(Throw, const ExceptionIndexImmediate<validate>& imm, \
1021 const ExceptionIndexImmediate<validate>& imm, uint32_t depth, \
1024 const MemoryAccessImmediate<validate>& imm, Value* result) \
1026 F(MemoryInit, const MemoryInitImmediate<validate>& imm, const Value& dst, \
1028 F(DataDrop, const DataDropImmediate<validate>& imm) \
1029 F(MemoryCopy, const MemoryCopyImmediate<validate>& imm, const Value& dst, \
1031 F(MemoryFill, const MemoryIndexImmediate<validate>& imm, const Value& dst, \
1033 F(TableInit, const TableInitImmediate<validate>& imm, Vector<Value> args) \
1034 F(ElemDrop, const ElemDropImmediate<validate>& imm) \
1035 F(TableCopy, const TableCopyImmediate<validate>& imm, Vector<Value> args) \
1036 F(TableGrow, const TableIndexImmediate<validate>& imm, const Value& value, \
1038 F(TableSize, const TableIndexImmediate<validate>& imm, Value* result) \
1039 F(TableFill, const TableIndexImmediate<validate>& imm, const Value& start, \
1041 F(StructNewWithRtt, const StructIndexImmediate<validate>& imm, \
1043 F(StructNewDefault, const StructIndexImmediate<validate>& imm, \
1049 F(ArrayNewWithRtt, const ArrayIndexImmediate<validate>& imm, \
1052 F(ArrayNewDefault, const ArrayIndexImmediate<validate>& imm, \
1055 const ArrayIndexImmediate<validate>& imm, const Value& index, \
1058 const ArrayIndexImmediate<validate>& imm, const Value& index, \
1064 F(RttCanon, const HeapTypeImmediate<validate>& imm, Value* result) \
1065 F(RttSub, const HeapTypeImmediate<validate>& imm, const Value& parent, \
1202 LocalIndexImmediate<validate> imm(decoder, pc + 1);
1204 imm.index < static_cast<uint32_t>(assigned->length())) {
1206 assigned->Add(imm.index);
1208 length = 1 + imm.length;
1234 inline bool Validate(const byte* pc, LocalIndexImmediate<validate>& imm) {
1235 if (!VALIDATE(imm.index < num_locals())) {
1236 DecodeError(pc, "invalid local index: %u", imm.index);
1242 inline bool Complete(ExceptionIndexImmediate<validate>& imm) {
1243 if (!VALIDATE(imm.index < module_->exceptions.size())) return false;
1244 imm.exception = &module_->exceptions[imm.index];
1248 inline bool Validate(const byte* pc, ExceptionIndexImmediate<validate>& imm) {
1249 if (!Complete(imm)) {
1250 DecodeError(pc, "Invalid exception index: %u", imm.index);
1256 inline bool Validate(const byte* pc, GlobalIndexImmediate<validate>& imm) {
1257 if (!VALIDATE(imm.index < module_->globals.size())) {
1258 DecodeError(pc, "invalid global index: %u", imm.index);
1261 imm.global = &module_->globals[imm.index];
1262 imm.type = imm.global->type;
1266 inline bool Complete(StructIndexImmediate<validate>& imm) {
1267 if (!VALIDATE(module_->has_struct(imm.index))) return false;
1268 imm.struct_type = module_->struct_type(imm.index);
1272 inline bool Validate(const byte* pc, StructIndexImmediate<validate>& imm) {
1273 if (Complete(imm)) return true;
1274 DecodeError(pc, "invalid struct index: %u", imm.index);
1278 inline bool Validate(const byte* pc, FieldIndexImmediate<validate>& imm) {
1279 if (!Validate(pc, imm.struct_index)) return false;
1280 if (!VALIDATE(imm.index < imm.struct_index.struct_type->field_count())) {
1281 DecodeError(pc + imm.struct_index.length, "invalid field index: %u",
1282 imm.index);
1288 inline bool Complete(ArrayIndexImmediate<validate>& imm) {
1289 if (!VALIDATE(module_->has_array(imm.index))) return false;
1290 imm.array_type = module_->array_type(imm.index);
1294 inline bool Validate(const byte* pc, ArrayIndexImmediate<validate>& imm) {
1295 if (!Complete(imm)) {
1296 DecodeError(pc, "invalid array index: %u", imm.index);
1312 inline bool Complete(CallFunctionImmediate<validate>& imm) {
1313 if (!VALIDATE(imm.index < module_->functions.size())) return false;
1314 imm.sig = module_->functions[imm.index].sig;
1315 if (imm.sig->return_count() > 1) {
1321 inline bool Validate(const byte* pc, CallFunctionImmediate<validate>& imm) {
1322 if (!Complete(imm)) {
1323 DecodeError(pc, "invalid function index: %u", imm.index);
1329 inline bool Complete(CallIndirectImmediate<validate>& imm) {
1330 if (!VALIDATE(module_->has_signature(imm.sig_index))) return false;
1331 imm.sig = module_->signature(imm.sig_index);
1332 if (imm.sig->return_count() > 1) {
1338 inline bool Validate(const byte* pc, CallIndirectImmediate<validate>& imm) {
1339 if (!VALIDATE(imm.table_index < module_->tables.size())) {
1343 ValueType table_type = module_->tables[imm.table_index].type;
1347 imm.table_index);
1350 if (!Complete(imm)) {
1351 DecodeError(pc, "invalid signature index: #%u", imm.sig_index);
1356 ValueType immediate_type = ValueType::Ref(imm.sig_index, kNonNullable);
1361 imm.sig_index, imm.table_index);
1366 inline bool Validate(const byte* pc, BranchDepthImmediate<validate>& imm,
1368 if (!VALIDATE(imm.depth < control_depth)) {
1369 DecodeError(pc, "invalid branch depth: %u", imm.depth);
1375 inline bool Validate(const byte* pc, BranchTableImmediate<validate>& imm,
1377 if (!VALIDATE(imm.table_count <= kV8MaxWasmFunctionBrTableSize)) {
1379 imm.table_count);
1382 return checkAvailable(imm.table_count);
1386 BranchOnExceptionImmediate<validate>& imm,
1388 return Validate(pc, imm.depth, control_size) &&
1389 Validate(pc + imm.depth.length, imm.index);
1393 SimdLaneImmediate<validate>& imm) {
1422 if (!VALIDATE(imm.lane >= 0 && imm.lane < num_lanes)) {
1430 inline bool Validate(const byte* pc, Simd128Immediate<validate>& imm) {
1433 max_lane = std::max(max_lane, imm.value[i]);
1443 inline bool Complete(BlockTypeImmediate<validate>& imm) {
1444 if (imm.type != kWasmBottom) return true;
1445 if (!VALIDATE(module_->has_signature(imm.sig_index))) return false;
1446 imm.sig = module_->signature(imm.sig_index);
1447 if (imm.sig->return_count() > 1) {
1453 inline bool Validate(const byte* pc, BlockTypeImmediate<validate>& imm) {
1454 if (!Complete(imm)) {
1456 imm.sig_index, module_->types.size());
1462 inline bool Validate(const byte* pc, FunctionIndexImmediate<validate>& imm) {
1463 if (!VALIDATE(imm.index < module_->functions.size())) {
1464 DecodeError(pc, "invalid function index: %u", imm.index);
1467 if (!VALIDATE(module_->functions[imm.index].declared)) {
1468 DecodeError(pc, "undeclared reference to function #%u", imm.index);
1474 inline bool Validate(const byte* pc, MemoryIndexImmediate<validate>& imm) {
1482 inline bool Validate(const byte* pc, MemoryInitImmediate<validate>& imm) {
1483 if (!VALIDATE(imm.data_segment_index <
1485 DecodeError(pc, "invalid data segment index: %u", imm.data_segment_index);
1488 if (!Validate(pc + imm.length - imm.memory.length, imm.memory))
1493 inline bool Validate(const byte* pc, DataDropImmediate<validate>& imm) {
1494 if (!VALIDATE(imm.index < module_->num_declared_data_segments)) {
1495 DecodeError(pc, "invalid data segment index: %u", imm.index);
1501 inline bool Validate(const byte* pc, MemoryCopyImmediate<validate>& imm) {
1502 return Validate(pc, imm.memory_src) &&
1503 Validate(pc + imm.memory_src.length, imm.memory_dst);
1506 inline bool Validate(const byte* pc, TableIndexImmediate<validate>& imm) {
1507 if (!VALIDATE(imm.index < module_->tables.size())) {
1508 DecodeError(pc, "invalid table index: %u", imm.index);
1514 inline bool Validate(const byte* pc, TableInitImmediate<validate>& imm) {
1515 if (!VALIDATE(imm.elem_segment_index < module_->elem_segments.size())) {
1517 imm.elem_segment_index);
1520 if (!Validate(pc + imm.length - imm.table.length, imm.table)) {
1523 ValueType elem_type = module_->elem_segments[imm.elem_segment_index].type;
1524 if (!VALIDATE(IsSubtypeOf(elem_type, module_->tables[imm.table.index].type,
1526 DecodeError(pc, "table %u is not a super-type of %s", imm.table.index,
1533 inline bool Validate(const byte* pc, ElemDropImmediate<validate>& imm) {
1534 if (!VALIDATE(imm.index < module_->elem_segments.size())) {
1535 DecodeError(pc, "invalid element segment index: %u", imm.index);
1541 inline bool Validate(const byte* pc, TableCopyImmediate<validate>& imm) {
1542 if (!Validate(pc, imm.table_src)) return false;
1543 if (!Validate(pc + imm.table_src.length, imm.table_dst)) return false;
1544 ValueType src_type = module_->tables[imm.table_src.index].type;
1546 src_type, module_->tables[imm.table_dst.index].type, module_))) {
1547 DecodeError(pc, "table %u is not a super-type of %s", imm.table_dst.index,
1554 inline bool Validate(const byte* pc, HeapTypeImmediate<validate>& imm) {
1555 if (!VALIDATE(!imm.type.is_bottom())) {
1559 if (!VALIDATE(imm.type.is_generic() ||
1560 module_->has_type(imm.type.ref_index()))) {
1561 DecodeError(pc, "Type index %u is out of bounds", imm.type.ref_index());
1575 MemoryAccessImmediate<validate> imm(decoder, pc + 1, UINT32_MAX);
1576 return 1 + imm.length;
1580 BranchDepthImmediate<validate> imm(decoder, pc + 1);
1581 return 1 + imm.length;
1585 GlobalIndexImmediate<validate> imm(decoder, pc + 1);
1586 return 1 + imm.length;
1590 TableIndexImmediate<validate> imm(decoder, pc + 1);
1591 return 1 + imm.length;
1595 CallFunctionImmediate<validate> imm(decoder, pc + 1);
1596 return 1 + imm.length;
1600 CallIndirectImmediate<validate> imm(WasmFeatures::All(), decoder,
1602 return 1 + imm.length;
1609 BlockTypeImmediate<validate> imm(WasmFeatures::All(), decoder, pc + 1);
1610 return 1 + imm.length;
1614 BlockTypeImmediate<validate> imm(WasmFeatures::All(), decoder, pc + 1);
1617 decoder->DecodeLocals(decoder->pc() + 1 + imm.length,
1619 return 1 + imm.length + (locals_result ? locals_length : 0);
1623 ExceptionIndexImmediate<validate> imm(decoder, pc + 1);
1624 return 1 + imm.length;
1628 BranchOnExceptionImmediate<validate> imm(decoder, pc + 1);
1629 return 1 + imm.length;
1633 BranchDepthImmediate<validate> imm(decoder, pc + 1);
1634 return 1 + imm.length;
1640 LocalIndexImmediate<validate> imm(decoder, pc + 1);
1641 return 1 + imm.length;
1644 SelectTypeImmediate<validate> imm(WasmFeatures::All(), decoder, pc + 1);
1645 return 1 + imm.length;
1648 BranchTableImmediate<validate> imm(decoder, pc + 1);
1649 BranchTableIterator<validate> iterator(decoder, imm);
1653 ImmI32Immediate<validate> imm(decoder, pc + 1);
1654 return 1 + imm.length;
1657 ImmI64Immediate<validate> imm(decoder, pc + 1);
1658 return 1 + imm.length;
1661 HeapTypeImmediate<validate> imm(WasmFeatures::All(), decoder, pc + 1);
1662 return 1 + imm.length;
1668 FunctionIndexImmediate<validate> imm(decoder, pc + 1);
1669 return 1 + imm.length;
1673 MemoryIndexImmediate<validate> imm(decoder, pc + 1);
1674 return 1 + imm.length;
1694 MemoryInitImmediate<validate> imm(decoder, pc + length);
1695 return length + imm.length;
1698 DataDropImmediate<validate> imm(decoder, pc + length);
1699 return length + imm.length;
1702 MemoryCopyImmediate<validate> imm(decoder, pc + length);
1703 return length + imm.length;
1706 MemoryIndexImmediate<validate> imm(decoder, pc + length);
1707 return length + imm.length;
1710 TableInitImmediate<validate> imm(decoder, pc + length);
1711 return length + imm.length;
1714 ElemDropImmediate<validate> imm(decoder, pc + length);
1715 return length + imm.length;
1718 TableCopyImmediate<validate> imm(decoder, pc + length);
1719 return length + imm.length;
1724 TableIndexImmediate<validate> imm(decoder, pc + length);
1725 return length + imm.length;
1748 MemoryAccessImmediate<validate> imm(decoder, pc + length,
1750 return length + imm.length;
1760 MemoryAccessImmediate<validate> imm(decoder, pc + length,
1763 return length + imm.length + 1;
1783 MemoryAccessImmediate<validate> imm(decoder, pc + length,
1785 return length + imm.length;
1805 StructIndexImmediate<validate> imm(decoder, pc + length);
1806 return length + imm.length;
1812 FieldIndexImmediate<validate> imm(decoder, pc + length);
1813 return length + imm.length;
1822 ArrayIndexImmediate<validate> imm(decoder, pc + length);
1823 return length + imm.length;
1826 BranchDepthImmediate<validate> imm(decoder, pc + length);
1827 return length + imm.length;
1833 HeapTypeImmediate<validate> imm(WasmFeatures::All(), decoder,
1835 return length + imm.length;
1906 CallFunctionImmediate<validate> imm(this, pc + 1);
1907 CHECK(Complete(imm));
1908 return {imm.sig->parameter_count(), imm.sig->return_count()};
1911 CallIndirectImmediate<validate> imm(this->enabled_, this, pc + 1);
1912 CHECK(Complete(imm));
1914 return {imm.sig->parameter_count() + 1,
1915 imm.sig->return_count()};
1918 ExceptionIndexImmediate<validate> imm(this, pc + 1);
1919 CHECK(Complete(imm));
1920 DCHECK_EQ(0, imm.exception->sig->return_count());
1921 return {imm.exception->sig->parameter_count(), 0};
1992 StructIndexImmediate<validate> imm(this, this->pc_ + 2);
1993 this->Complete(imm);
1994 return {imm.struct_type->field_count() + 1, 1};
2299 BlockTypeImmediate<validate> imm(this->enabled_, this, this->pc_ + 1);
2300 if (!this->Validate(this->pc_ + 1, imm)) return 0;
2301 ArgVector args = PopArgs(imm.sig);
2303 SetBlockType(block, imm, args.begin());
2306 return 1 + imm.length;
2319 ExceptionIndexImmediate<validate> imm(this, this->pc_ + 1);
2320 if (!this->Validate(this->pc_ + 1, imm)) return 0;
2321 ArgVector args = PopArgs(imm.exception->ToFunctionSig());
2322 CALL_INTERFACE_IF_REACHABLE(Throw, imm, VectorOf(args));
2324 return 1 + imm.length;
2329 BlockTypeImmediate<validate> imm(this->enabled_, this, this->pc_ + 1);
2330 if (!this->Validate(this->pc_ + 1, imm)) return 0;
2331 ArgVector args = PopArgs(imm.sig);
2333 SetBlockType(try_block, imm, args.begin());
2336 return 1 + imm.length;
2367 BranchOnExceptionImmediate<validate> imm(this, this->pc_ + 1);
2368 if (!this->Validate(this->pc() + 1, imm, control_.size())) return 0;
2369 Control* c = control_at(imm.depth.depth);
2371 const WasmExceptionSig* sig = imm.index.exception->sig;
2383 CALL_INTERFACE(BrOnException, exception, imm.index, imm.depth.depth,
2392 return 1 + imm.length;
2397 BranchDepthImmediate<validate> imm(this, this->pc_ + 1);
2398 if (!this->Validate(this->pc_ + 1, imm, control_.size())) return 0;
2401 Control* c = control_at(imm.depth);
2416 CALL_INTERFACE(BrOnNull, ref_object, imm.depth);
2430 return 1 + imm.length;
2435 BlockTypeImmediate<validate> imm(this->enabled_, this, this->pc_ + 1);
2436 if (!this->Validate(this->pc_ + 1, imm)) return 0;
2441 if (!this->DecodeLocals(this->pc() + 1 + imm.length, &locals_length, 0)) {
2446 PopArgs(static_cast<uint32_t>(imm.in_arity()),
2448 ArgVector args = PopArgs(imm.sig);
2450 SetBlockType(let_block, imm, args.begin());
2454 return 1 + imm.length + locals_length;
2458 BlockTypeImmediate<validate> imm(this->enabled_, this, this->pc_ + 1);
2459 if (!this->Validate(this->pc_ + 1, imm)) return 0;
2460 ArgVector args = PopArgs(imm.sig);
2462 SetBlockType(&control_.back(), imm, args.begin());
2465 return 1 + imm.length;
2469 BlockTypeImmediate<validate> imm(this->enabled_, this, this->pc_ + 1);
2470 if (!this->Validate(this->pc_ + 1, imm)) return 0;
2472 ArgVector args = PopArgs(imm.sig);
2475 SetBlockType(if_block, imm, args.begin());
2478 return 1 + imm.length;
2565 SelectTypeImmediate<validate> imm(this->enabled_, this, this->pc_ + 1);
2568 Value fval = Pop(1, imm.type);
2569 Value tval = Pop(0, imm.type);
2570 Value* result = Push(imm.type);
2572 return 1 + imm.length;
2576 BranchDepthImmediate<validate> imm(this, this->pc_ + 1);
2577 if (!this->Validate(this->pc_ + 1, imm, control_.size())) return 0;
2578 Control* c = control_at(imm.depth);
2581 if (imm.depth == control_.size() - 1) {
2591 return 1 + imm.length;
2595 BranchDepthImmediate<validate> imm(this, this->pc_ + 1);
2596 if (!this->Validate(this->pc_ + 1, imm, control_.size())) return 0;
2599 Control* c = control_at(imm.depth);
2602 CALL_INTERFACE(BrIf, cond, imm.depth);
2607 return 1 + imm.length;
2611 BranchTableImmediate<validate> imm(this, this->pc_ + 1);
2612 BranchTableIterator<validate> iterator(this, imm);
2615 if (!this->Validate(this->pc_ + 1, imm, control_.size())) return 0;
2650 CALL_INTERFACE(BrTable, imm, key);
2687 ImmI32Immediate<validate> imm(this, this->pc_ + 1);
2689 CALL_INTERFACE_IF_REACHABLE(I32Const, value, imm.value);
2690 return 1 + imm.length;
2694 ImmI64Immediate<validate> imm(this, this->pc_ + 1);
2696 CALL_INTERFACE_IF_REACHABLE(I64Const, value, imm.value);
2697 return 1 + imm.length;
2701 ImmF32Immediate<validate> imm(this, this->pc_ + 1);
2703 CALL_INTERFACE_IF_REACHABLE(F32Const, value, imm.value);
2704 return 1 + imm.length;
2708 ImmF64Immediate<validate> imm(this, this->pc_ + 1);
2710 CALL_INTERFACE_IF_REACHABLE(F64Const, value, imm.value);
2711 return 1 + imm.length;
2716 HeapTypeImmediate<validate> imm(this->enabled_, this, this->pc_ + 1);
2717 if (!this->Validate(this->pc_ + 1, imm)) return 0;
2718 ValueType type = ValueType::Ref(imm.type, kNullable);
2721 return 1 + imm.length;
2752 FunctionIndexImmediate<validate> imm(this, this->pc_ + 1);
2753 if (!this->Validate(this->pc_ + 1, imm)) return 0;
2755 ? this->module_->functions[imm.index].sig_index
2758 CALL_INTERFACE_IF_REACHABLE(RefFunc, imm.index, value);
2759 return 1 + imm.length;
2791 LocalIndexImmediate<validate> imm(this, this->pc_ + 1);
2792 if (!this->Validate(this->pc_ + 1, imm)) return 0;
2793 Value* value = Push(this->local_type(imm.index));
2794 CALL_INTERFACE_IF_REACHABLE(LocalGet, value, imm);
2795 return 1 + imm.length;
2799 LocalIndexImmediate<validate> imm(this, this->pc_ + 1);
2800 if (!this->Validate(this->pc_ + 1, imm)) return 0;
2801 Value value = Pop(0, this->local_type(imm.index));
2802 CALL_INTERFACE_IF_REACHABLE(LocalSet, value, imm);
2803 return 1 + imm.length;
2807 LocalIndexImmediate<validate> imm(this, this->pc_ + 1);
2808 if (!this->Validate(this->pc_ + 1, imm)) return 0;
2809 Value value = Pop(0, this->local_type(imm.index));
2811 CALL_INTERFACE_IF_REACHABLE(LocalTee, value, result, imm);
2812 return 1 + imm.length;
2822 GlobalIndexImmediate<validate> imm(this, this->pc_ + 1);
2823 if (!this->Validate(this->pc_ + 1, imm)) return 0;
2824 Value* result = Push(imm.type);
2825 CALL_INTERFACE_IF_REACHABLE(GlobalGet, result, imm);
2826 return 1 + imm.length;
2830 GlobalIndexImmediate<validate> imm(this, this->pc_ + 1);
2831 if (!this->Validate(this->pc_ + 1, imm)) return 0;
2832 if (!VALIDATE(imm.global->mutability)) {
2833 this->DecodeError("immutable global #%u cannot be assigned", imm.index);
2836 Value value = Pop(0, imm.type);
2837 CALL_INTERFACE_IF_REACHABLE(GlobalSet, value, imm);
2838 return 1 + imm.length;
2843 TableIndexImmediate<validate> imm(this, this->pc_ + 1);
2844 if (!this->Validate(this->pc_ + 1, imm)) return 0;
2846 Value* result = Push(this->module_->tables[imm.index].type);
2847 CALL_INTERFACE_IF_REACHABLE(TableGet, index, result, imm);
2848 return 1 + imm.length;
2853 TableIndexImmediate<validate> imm(this, this->pc_ + 1);
2854 if (!this->Validate(this->pc_ + 1, imm)) return 0;
2855 Value value = Pop(1, this->module_->tables[imm.index].type);
2857 CALL_INTERFACE_IF_REACHABLE(TableSet, index, value, imm);
2858 return 1 + imm.length;
2897 MemoryIndexImmediate<validate> imm(this, this->pc_ + 1);
2905 return 1 + imm.length;
2910 MemoryIndexImmediate<validate> imm(this, this->pc_ + 1);
2913 return 1 + imm.length;
2917 CallFunctionImmediate<validate> imm(this, this->pc_ + 1);
2918 if (!this->Validate(this->pc_ + 1, imm)) return 0;
2919 ArgVector args = PopArgs(imm.sig);
2920 Value* returns = PushReturns(imm.sig);
2921 CALL_INTERFACE_IF_REACHABLE(CallDirect, imm, args.begin(), returns);
2922 return 1 + imm.length;
2926 CallIndirectImmediate<validate> imm(this->enabled_, this, this->pc_ + 1);
2927 if (!this->Validate(this->pc_ + 1, imm)) return 0;
2929 ArgVector args = PopArgs(imm.sig);
2930 Value* returns = PushReturns(imm.sig);
2931 CALL_INTERFACE_IF_REACHABLE(CallIndirect, index, imm, args.begin(),
2933 return 1 + imm.length;
2938 CallFunctionImmediate<validate> imm(this, this->pc_ + 1);
2939 if (!this->Validate(this->pc_ + 1, imm)) return 0;
2940 if (!VALIDATE(this->CanReturnCall(imm.sig))) {
2945 ArgVector args = PopArgs(imm.sig);
2946 CALL_INTERFACE_IF_REACHABLE(ReturnCall, imm, args.begin());
2948 return 1 + imm.length;
2953 CallIndirectImmediate<validate> imm(this->enabled_, this, this->pc_ + 1);
2954 if (!this->Validate(this->pc_ + 1, imm)) return 0;
2955 if (!VALIDATE(this->CanReturnCall(imm.sig))) {
2962 ArgVector args = PopArgs(imm.sig);
2963 CALL_INTERFACE_IF_REACHABLE(ReturnCallIndirect, index, imm, args.begin());
2965 return 1 + imm.length;
3224 void SetBlockType(Control* c, BlockTypeImmediate<validate>& imm,
3227 InitMerge(&c->end_merge, imm.out_arity(), [pc, &imm](uint32_t i) {
3228 return Value{pc, imm.out_type(i)};
3230 InitMerge(&c->start_merge, imm.in_arity(),
3294 MemoryAccessImmediate<validate> imm(this, this->pc_ + prefix_len,
3299 CALL_INTERFACE_IF_REACHABLE(LoadMem, type, imm, index, result);
3300 return prefix_len + imm.length;
3309 MemoryAccessImmediate<validate> imm(this, this->pc_ + opcode_length,
3314 CALL_INTERFACE_IF_REACHABLE(LoadTransform, type, transform, imm, index,
3316 return opcode_length + imm.length;
3350 MemoryAccessImmediate<validate> imm(this, this->pc_ + prefix_len,
3355 CALL_INTERFACE_IF_REACHABLE(StoreMem, store, imm, index, value);
3356 return prefix_len + imm.length;
3451 Simd128Immediate<validate> imm(this, this->pc_ + opcode_length);
3453 CALL_INTERFACE_IF_REACHABLE(S128Const, imm, result);
3459 SimdLaneImmediate<validate> imm(this, this->pc_ + opcode_length);
3460 if (this->Validate(this->pc_ + opcode_length, opcode, imm)) {
3463 CALL_INTERFACE_IF_REACHABLE(SimdLaneOp, opcode, imm, ArrayVector(inputs),
3466 return opcode_length + imm.length;
3471 SimdLaneImmediate<validate> imm(this, this->pc_ + opcode_length);
3472 if (this->Validate(this->pc_ + opcode_length, opcode, imm)) {
3478 CALL_INTERFACE_IF_REACHABLE(SimdLaneOp, opcode, imm, ArrayVector(inputs),
3481 return opcode_length + imm.length;
3485 Simd128Immediate<validate> imm(this, this->pc_ + opcode_length);
3486 if (this->Validate(this->pc_ + opcode_length, imm)) {
3490 CALL_INTERFACE_IF_REACHABLE(Simd8x16ShuffleOp, imm, input0, input1,
3621 StructIndexImmediate<validate> imm(this, this->pc_ + opcode_length);
3622 if (!this->Validate(this->pc_ + opcode_length, imm)) return 0;
3623 Value rtt = Pop(imm.struct_type->field_count());
3633 rtt.type.heap_representation() == imm.index)) {
3637 imm.index, rtt.type.heap_type().name().c_str());
3640 ArgVector args = PopArgs(imm.struct_type);
3641 Value* value = Push(ValueType::Ref(imm.index, kNonNullable));
3642 CALL_INTERFACE_IF_REACHABLE(StructNewWithRtt, imm, rtt, args.begin(),
3644 return opcode_length + imm.length;
3647 StructIndexImmediate<validate> imm(this, this->pc_ + opcode_length);
3648 if (!this->Validate(this->pc_ + opcode_length, imm)) return 0;
3650 for (uint32_t i = 0; i < imm.struct_type->field_count(); i++) {
3651 ValueType ftype = imm.struct_type->field(i);
3656 imm.index, ftype.name().c_str(), i);
3671 rtt.type.heap_representation() == imm.index)) {
3675 imm.index, rtt.type.heap_type().name().c_str());
3678 Value* value = Push(ValueType::Ref(imm.index, kNonNullable));
3679 CALL_INTERFACE_IF_REACHABLE(StructNewDefault, imm, rtt, value);
3680 return opcode_length + imm.length;
3734 ArrayIndexImmediate<validate> imm(this, this->pc_ + opcode_length);
3735 if (!this->Validate(this->pc_ + opcode_length, imm)) return 0;
3747 rtt.type.heap_representation() == imm.index)) {
3752 imm.index, rtt.type.heap_type().name().c_str());
3756 Value initial_value = Pop(0, imm.array_type->element_type().Unpacked());
3757 Value* value = Push(ValueType::Ref(imm.index, kNonNullable));
3758 CALL_INTERFACE_IF_REACHABLE(ArrayNewWithRtt, imm, length, initial_value,
3760 return opcode_length + imm.length;
3763 ArrayIndexImmediate<validate> imm(this, this->pc_ + opcode_length);
3764 if (!this->Validate(this->pc_ + opcode_length, imm)) return 0;
3765 if (!VALIDATE(imm.array_type->element_type().is_defaultable())) {
3769 imm.index, imm.array_type->element_type().name().c_str());
3783 rtt.type.heap_representation() == imm.index)) {
3787 imm.index, rtt.type.heap_type().name().c_str());
3791 Value* value = Push(ValueType::Ref(imm.index, kNonNullable));
3792 CALL_INTERFACE_IF_REACHABLE(ArrayNewDefault, imm, length, rtt, value);
3793 return opcode_length + imm.length;
3797 ArrayIndexImmediate<validate> imm(this, this->pc_ + opcode_length);
3798 if (!this->Validate(this->pc_ + opcode_length, imm)) return 0;
3799 if (!VALIDATE(imm.array_type->element_type().is_packed())) {
3806 Value array_obj = Pop(0, ValueType::Ref(imm.index, kNullable));
3807 Value* value = Push(imm.array_type->element_type().Unpacked());
3808 CALL_INTERFACE_IF_REACHABLE(ArrayGet, array_obj, imm, index,
3810 return opcode_length + imm.length;
3813 ArrayIndexImmediate<validate> imm(this, this->pc_ + opcode_length);
3814 if (!this->Validate(this->pc_ + opcode_length, imm)) return 0;
3815 if (!VALIDATE(!imm.array_type->element_type().is_packed())) {
3822 Value array_obj = Pop(0, ValueType::Ref(imm.index, kNullable));
3823 Value* value = Push(imm.array_type->element_type());
3824 CALL_INTERFACE_IF_REACHABLE(ArrayGet, array_obj, imm, index, true,
3826 return opcode_length + imm.length;
3829 ArrayIndexImmediate<validate> imm(this, this->pc_ + opcode_length);
3830 if (!this->Validate(this->pc_ + opcode_length, imm)) return 0;
3831 if (!VALIDATE(imm.array_type->mutability())) {
3835 Value value = Pop(2, imm.array_type->element_type().Unpacked());
3837 Value array_obj = Pop(0, ValueType::Ref(imm.index, kNullable));
3838 CALL_INTERFACE_IF_REACHABLE(ArraySet, array_obj, imm, index, value);
3839 return opcode_length + imm.length;
3842 ArrayIndexImmediate<validate> imm(this, this->pc_ + opcode_length);
3843 if (!this->Validate(this->pc_ + opcode_length, imm)) return 0;
3844 Value array_obj = Pop(0, ValueType::Ref(imm.index, kNullable));
3847 return opcode_length + imm.length;
3868 HeapTypeImmediate<validate> imm(this->enabled_, this,
3870 if (!this->Validate(this->pc_ + opcode_length, imm)) return 0;
3871 Value* value = Push(ValueType::Rtt(imm.type, 1));
3872 CALL_INTERFACE_IF_REACHABLE(RttCanon, imm, value);
3873 return opcode_length + imm.length;
3882 HeapTypeImmediate<validate> imm(this->enabled_, this,
3884 if (!this->Validate(this->pc_ + opcode_length, imm)) return 0;
3892 IsSubtypeOf(ValueType::Ref(imm.type, kNonNullable),
3900 Push(ValueType::Rtt(imm.type, parent.type.depth() + 1));
3901 CALL_INTERFACE_IF_REACHABLE(RttSub, imm, parent, value);
3903 return opcode_length + imm.length;
4062 MemoryAccessImmediate<validate> imm(
4070 CALL_INTERFACE_IF_REACHABLE(AtomicOp, opcode, VectorOf(args), imm, result);
4071 return opcode_length + imm.length;
4093 MemoryInitImmediate<validate> imm(this, this->pc_ + opcode_length);
4094 if (!this->Validate(this->pc_ + opcode_length, imm)) return 0;
4098 CALL_INTERFACE_IF_REACHABLE(MemoryInit, imm, dst, src, size);
4099 return opcode_length + imm.length;
4102 DataDropImmediate<validate> imm(this, this->pc_ + opcode_length);
4103 if (!this->Validate(this->pc_ + opcode_length, imm)) return 0;
4104 CALL_INTERFACE_IF_REACHABLE(DataDrop, imm);
4105 return opcode_length + imm.length;
4108 MemoryCopyImmediate<validate> imm(this, this->pc_ + opcode_length);
4109 if (!this->Validate(this->pc_ + opcode_length, imm)) return 0;
4113 CALL_INTERFACE_IF_REACHABLE(MemoryCopy, imm, dst, src, size);
4114 return opcode_length + imm.length;
4117 MemoryIndexImmediate<validate> imm(this, this->pc_ + opcode_length);
4118 if (!this->Validate(this->pc_ + opcode_length, imm)) return 0;
4122 CALL_INTERFACE_IF_REACHABLE(MemoryFill, imm, dst, value, size);
4123 return opcode_length + imm.length;
4126 TableInitImmediate<validate> imm(this, this->pc_ + opcode_length);
4127 if (!this->Validate(this->pc_ + opcode_length, imm)) return 0;
4129 CALL_INTERFACE_IF_REACHABLE(TableInit, imm, VectorOf(args));
4130 return opcode_length + imm.length;
4133 ElemDropImmediate<validate> imm(this, this->pc_ + opcode_length);
4134 if (!this->Validate(this->pc_ + opcode_length, imm)) return 0;
4135 CALL_INTERFACE_IF_REACHABLE(ElemDrop, imm);
4136 return opcode_length + imm.length;
4139 TableCopyImmediate<validate> imm(this, this->pc_ + opcode_length);
4140 if (!this->Validate(this->pc_ + opcode_length, imm)) return 0;
4142 CALL_INTERFACE_IF_REACHABLE(TableCopy, imm, VectorOf(args));
4143 return opcode_length + imm.length;
4146 TableIndexImmediate<validate> imm(this, this->pc_ + opcode_length);
4147 if (!this->Validate(this->pc_ + opcode_length, imm)) return 0;
4149 Value value = Pop(0, this->module_->tables[imm.index].type);
4151 CALL_INTERFACE_IF_REACHABLE(TableGrow, imm, value, delta, result);
4152 return opcode_length + imm.length;
4155 TableIndexImmediate<validate> imm(this, this->pc_ + opcode_length);
4156 if (!this->Validate(this->pc_ + opcode_length, imm)) return 0;
4158 CALL_INTERFACE_IF_REACHABLE(TableSize, imm, result);
4159 return opcode_length + imm.length;
4162 TableIndexImmediate<validate> imm(this, this->pc_ + opcode_length);
4163 if (!this->Validate(this->pc_ + opcode_length, imm)) return 0;
4165 Value value = Pop(1, this->module_->tables[imm.index].type);
4167 CALL_INTERFACE_IF_REACHABLE(TableFill, imm, start, value, count);
4168 return opcode_length + imm.length;