Lines Matching refs:imm
380 const BranchTableImmediate<validate>& imm) in BranchTableIterator() argument
382 start_(imm.start), in BranchTableIterator()
383 pc_(imm.table), in BranchTableIterator()
384 table_count_(imm.table_count) {} in BranchTableIterator()
628 F(GetLocal, Value* result, const LocalIndexImmediate<validate>& imm) \
629 F(SetLocal, const Value& value, const LocalIndexImmediate<validate>& imm) \
631 const LocalIndexImmediate<validate>& imm) \
632 F(GetGlobal, Value* result, const GlobalIndexImmediate<validate>& imm) \
633 F(SetGlobal, const Value& value, const GlobalIndexImmediate<validate>& imm) \
639 F(BrTable, const BranchTableImmediate<validate>& imm, const Value& key) \
641 F(LoadMem, LoadType type, const MemoryAccessImmediate<validate>& imm, \
643 F(StoreMem, StoreType type, const MemoryAccessImmediate<validate>& imm, \
647 F(CallDirect, const CallFunctionImmediate<validate>& imm, \
650 const CallIndirectImmediate<validate>& imm, const Value args[], \
653 F(SimdLaneOp, WasmOpcode opcode, const SimdLaneImmediate<validate>& imm, \
655 F(SimdShiftOp, WasmOpcode opcode, const SimdShiftImmediate<validate>& imm, \
657 F(Simd8x16ShuffleOp, const Simd8x16ShuffleImmediate<validate>& imm, \
661 F(CatchException, const ExceptionIndexImmediate<validate>& imm, \
664 const MemoryAccessImmediate<validate>& imm, Value* result)
779 LocalIndexImmediate<Decoder::kValidate> imm(decoder, pc); in AnalyzeLoopAssignment()
781 imm.index < static_cast<uint32_t>(assigned->length())) { in AnalyzeLoopAssignment()
783 assigned->Add(imm.index); in AnalyzeLoopAssignment()
785 length = 1 + imm.length; in AnalyzeLoopAssignment()
810 LocalIndexImmediate<Decoder::kValidate>& imm) { in Validate() argument
811 if (!VALIDATE(imm.index < total_locals())) { in Validate()
812 errorf(pc + 1, "invalid local index: %u", imm.index); in Validate()
815 imm.type = local_types_ ? local_types_->at(imm.index) : kWasmStmt; in Validate()
819 inline bool Validate(const byte* pc, ExceptionIndexImmediate<validate>& imm) { in Validate() argument
821 imm.index < module_->exceptions.size())) { in Validate()
822 errorf(pc + 1, "Invalid exception index: %u", imm.index); in Validate()
825 imm.exception = &module_->exceptions[imm.index]; in Validate()
829 inline bool Validate(const byte* pc, GlobalIndexImmediate<validate>& imm) { in Validate() argument
830 if (!VALIDATE(module_ != nullptr && imm.index < module_->globals.size())) { in Validate()
831 errorf(pc + 1, "invalid global index: %u", imm.index); in Validate()
834 imm.global = &module_->globals[imm.index]; in Validate()
835 imm.type = imm.global->type; in Validate()
839 inline bool Complete(const byte* pc, CallFunctionImmediate<validate>& imm) { in Complete() argument
841 imm.index < module_->functions.size())) { in Complete()
844 imm.sig = module_->functions[imm.index].sig; in Complete()
848 inline bool Validate(const byte* pc, CallFunctionImmediate<validate>& imm) { in Validate() argument
849 if (Complete(pc, imm)) { in Validate()
852 errorf(pc + 1, "invalid function index: %u", imm.index); in Validate()
856 inline bool Complete(const byte* pc, CallIndirectImmediate<validate>& imm) { in Complete() argument
858 imm.sig_index < module_->signatures.size())) { in Complete()
861 imm.sig = module_->signatures[imm.sig_index]; in Complete()
865 inline bool Validate(const byte* pc, CallIndirectImmediate<validate>& imm) { in Validate() argument
870 if (!Complete(pc, imm)) { in Validate()
871 errorf(pc + 1, "invalid signature index: #%u", imm.sig_index); in Validate()
877 inline bool Validate(const byte* pc, BreakDepthImmediate<validate>& imm, in Validate() argument
879 if (!VALIDATE(imm.depth < control_depth)) { in Validate()
880 errorf(pc + 1, "invalid break depth: %u", imm.depth); in Validate()
886 bool Validate(const byte* pc, BranchTableImmediate<validate>& imm, in Validate() argument
888 if (!VALIDATE(imm.table_count < kV8MaxWasmFunctionSize)) { in Validate()
890 imm.table_count); in Validate()
893 return checkAvailable(imm.table_count); in Validate()
897 SimdLaneImmediate<validate>& imm) { in Validate() argument
918 if (!VALIDATE(imm.lane >= 0 && imm.lane < num_lanes)) { in Validate()
927 SimdShiftImmediate<validate>& imm) { in Validate() argument
949 if (!VALIDATE(imm.shift >= 0 && imm.shift < max_shift)) { in Validate()
958 Simd8x16ShuffleImmediate<validate>& imm) { in Validate() argument
961 max_lane = std::max(max_lane, imm.shuffle[i]); in Validate()
971 inline bool Complete(BlockTypeImmediate<validate>& imm) { in Complete() argument
972 if (imm.type != kWasmVar) return true; in Complete()
973 if (!VALIDATE((module_ && imm.sig_index < module_->signatures.size()))) { in Complete()
976 imm.sig = module_->signatures[imm.sig_index]; in Complete()
980 inline bool Validate(BlockTypeImmediate<validate>& imm) { in Validate() argument
981 if (!Complete(imm)) { in Validate()
983 imm.sig_index, module_ ? module_->signatures.size() : 0); in Validate()
997 MemoryAccessImmediate<validate> imm(decoder, pc, UINT32_MAX); in OpcodeLength()
998 return 1 + imm.length; in OpcodeLength()
1002 BreakDepthImmediate<validate> imm(decoder, pc); in OpcodeLength()
1003 return 1 + imm.length; in OpcodeLength()
1007 GlobalIndexImmediate<validate> imm(decoder, pc); in OpcodeLength()
1008 return 1 + imm.length; in OpcodeLength()
1012 CallFunctionImmediate<validate> imm(decoder, pc); in OpcodeLength()
1013 return 1 + imm.length; in OpcodeLength()
1016 CallIndirectImmediate<validate> imm(decoder, pc); in OpcodeLength()
1017 return 1 + imm.length; in OpcodeLength()
1024 BlockTypeImmediate<validate> imm(kAllWasmFeatures, decoder, pc); in OpcodeLength()
1025 return 1 + imm.length; in OpcodeLength()
1030 ExceptionIndexImmediate<validate> imm(decoder, pc); in OpcodeLength()
1031 return 1 + imm.length; in OpcodeLength()
1037 LocalIndexImmediate<Decoder::kValidate> imm(decoder, pc); in OpcodeLength()
1038 return 1 + imm.length; in OpcodeLength()
1041 BranchTableImmediate<validate> imm(decoder, pc); in OpcodeLength()
1042 BranchTableIterator<validate> iterator(decoder, imm); in OpcodeLength()
1046 ImmI32Immediate<validate> imm(decoder, pc); in OpcodeLength()
1047 return 1 + imm.length; in OpcodeLength()
1050 ImmI64Immediate<validate> imm(decoder, pc); in OpcodeLength()
1051 return 1 + imm.length; in OpcodeLength()
1058 MemoryIndexImmediate<validate> imm(decoder, pc); in OpcodeLength()
1059 return 1 + imm.length; in OpcodeLength()
1084 MemoryAccessImmediate<validate> imm(decoder, pc + 1, UINT32_MAX); in OpcodeLength()
1085 return 2 + imm.length; in OpcodeLength()
1104 MemoryAccessImmediate<validate> imm(decoder, pc + 1, UINT32_MAX); in OpcodeLength()
1105 return 2 + imm.length; in OpcodeLength()
1152 CallFunctionImmediate<validate> imm(this, pc); in StackEffect()
1153 CHECK(Complete(pc, imm)); in StackEffect()
1154 return {imm.sig->parameter_count(), imm.sig->return_count()}; in StackEffect()
1157 CallIndirectImmediate<validate> imm(this, pc); in StackEffect()
1158 CHECK(Complete(pc, imm)); in StackEffect()
1160 return {imm.sig->parameter_count() + 1, in StackEffect()
1161 imm.sig->return_count()}; in StackEffect()
1451 BlockTypeImmediate<validate> imm(this->enabled_, this, this->pc_); in DecodeFunctionBody()
1452 if (!this->Validate(imm)) break; in DecodeFunctionBody()
1453 PopArgs(imm.sig); in DecodeFunctionBody()
1455 SetBlockType(block, imm); in DecodeFunctionBody()
1458 len = 1 + imm.length; in DecodeFunctionBody()
1469 ExceptionIndexImmediate<Decoder::kValidate> imm(this, this->pc_); in DecodeFunctionBody()
1470 len = 1 + imm.length; in DecodeFunctionBody()
1471 if (!this->Validate(this->pc_, imm)) break; in DecodeFunctionBody()
1472 PopArgs(imm.exception->ToFunctionSig()); in DecodeFunctionBody()
1473 CALL_INTERFACE_IF_REACHABLE(Throw, imm, &control_.back(), in DecodeFunctionBody()
1480 BlockTypeImmediate<validate> imm(this->enabled_, this, this->pc_); in DecodeFunctionBody()
1481 if (!this->Validate(imm)) break; in DecodeFunctionBody()
1482 PopArgs(imm.sig); in DecodeFunctionBody()
1484 SetBlockType(try_block, imm); in DecodeFunctionBody()
1485 len = 1 + imm.length; in DecodeFunctionBody()
1493 ExceptionIndexImmediate<Decoder::kValidate> imm(this, this->pc_); in DecodeFunctionBody()
1494 len = 1 + imm.length; in DecodeFunctionBody()
1496 if (!this->Validate(this->pc_, imm)) break; in DecodeFunctionBody()
1516 const WasmExceptionSig* sig = imm.exception->sig; in DecodeFunctionBody()
1522 CALL_INTERFACE_IF_PARENT_REACHABLE(CatchException, imm, c, values); in DecodeFunctionBody()
1533 BlockTypeImmediate<validate> imm(this->enabled_, this, this->pc_); in DecodeFunctionBody()
1534 if (!this->Validate(imm)) break; in DecodeFunctionBody()
1535 PopArgs(imm.sig); in DecodeFunctionBody()
1537 SetBlockType(&control_.back(), imm); in DecodeFunctionBody()
1538 len = 1 + imm.length; in DecodeFunctionBody()
1544 BlockTypeImmediate<validate> imm(this->enabled_, this, this->pc_); in DecodeFunctionBody()
1545 if (!this->Validate(imm)) break; in DecodeFunctionBody()
1547 PopArgs(imm.sig); in DecodeFunctionBody()
1550 SetBlockType(if_block, imm); in DecodeFunctionBody()
1552 len = 1 + imm.length; in DecodeFunctionBody()
1625 BreakDepthImmediate<validate> imm(this, this->pc_); in DecodeFunctionBody()
1626 if (!this->Validate(this->pc_, imm, control_.size())) break; in DecodeFunctionBody()
1627 Control* c = control_at(imm.depth); in DecodeFunctionBody()
1633 len = 1 + imm.length; in DecodeFunctionBody()
1638 BreakDepthImmediate<validate> imm(this, this->pc_); in DecodeFunctionBody()
1641 if (!this->Validate(this->pc_, imm, control_.size())) break; in DecodeFunctionBody()
1642 Control* c = control_at(imm.depth); in DecodeFunctionBody()
1648 len = 1 + imm.length; in DecodeFunctionBody()
1652 BranchTableImmediate<validate> imm(this, this->pc_); in DecodeFunctionBody()
1653 BranchTableIterator<validate> iterator(this, imm); in DecodeFunctionBody()
1656 if (!this->Validate(this->pc_, imm, control_.size())) break; in DecodeFunctionBody()
1688 CALL_INTERFACE(BrTable, imm, key); in DecodeFunctionBody()
1710 ImmI32Immediate<validate> imm(this, this->pc_); in DecodeFunctionBody()
1712 CALL_INTERFACE_IF_REACHABLE(I32Const, value, imm.value); in DecodeFunctionBody()
1713 len = 1 + imm.length; in DecodeFunctionBody()
1717 ImmI64Immediate<validate> imm(this, this->pc_); in DecodeFunctionBody()
1719 CALL_INTERFACE_IF_REACHABLE(I64Const, value, imm.value); in DecodeFunctionBody()
1720 len = 1 + imm.length; in DecodeFunctionBody()
1724 ImmF32Immediate<validate> imm(this, this->pc_); in DecodeFunctionBody()
1726 CALL_INTERFACE_IF_REACHABLE(F32Const, value, imm.value); in DecodeFunctionBody()
1727 len = 1 + imm.length; in DecodeFunctionBody()
1731 ImmF64Immediate<validate> imm(this, this->pc_); in DecodeFunctionBody()
1733 CALL_INTERFACE_IF_REACHABLE(F64Const, value, imm.value); in DecodeFunctionBody()
1734 len = 1 + imm.length; in DecodeFunctionBody()
1745 LocalIndexImmediate<Decoder::kValidate> imm(this, this->pc_); in DecodeFunctionBody()
1746 if (!this->Validate(this->pc_, imm)) break; in DecodeFunctionBody()
1747 auto* value = Push(imm.type); in DecodeFunctionBody()
1748 CALL_INTERFACE_IF_REACHABLE(GetLocal, value, imm); in DecodeFunctionBody()
1749 len = 1 + imm.length; in DecodeFunctionBody()
1753 LocalIndexImmediate<Decoder::kValidate> imm(this, this->pc_); in DecodeFunctionBody()
1754 if (!this->Validate(this->pc_, imm)) break; in DecodeFunctionBody()
1755 auto value = Pop(0, local_type_vec_[imm.index]); in DecodeFunctionBody()
1756 CALL_INTERFACE_IF_REACHABLE(SetLocal, value, imm); in DecodeFunctionBody()
1757 len = 1 + imm.length; in DecodeFunctionBody()
1761 LocalIndexImmediate<Decoder::kValidate> imm(this, this->pc_); in DecodeFunctionBody()
1762 if (!this->Validate(this->pc_, imm)) break; in DecodeFunctionBody()
1763 auto value = Pop(0, local_type_vec_[imm.index]); in DecodeFunctionBody()
1765 CALL_INTERFACE_IF_REACHABLE(TeeLocal, value, result, imm); in DecodeFunctionBody()
1766 len = 1 + imm.length; in DecodeFunctionBody()
1775 GlobalIndexImmediate<validate> imm(this, this->pc_); in DecodeFunctionBody()
1776 len = 1 + imm.length; in DecodeFunctionBody()
1777 if (!this->Validate(this->pc_, imm)) break; in DecodeFunctionBody()
1778 auto* result = Push(imm.type); in DecodeFunctionBody()
1779 CALL_INTERFACE_IF_REACHABLE(GetGlobal, result, imm); in DecodeFunctionBody()
1783 GlobalIndexImmediate<validate> imm(this, this->pc_); in DecodeFunctionBody()
1784 len = 1 + imm.length; in DecodeFunctionBody()
1785 if (!this->Validate(this->pc_, imm)) break; in DecodeFunctionBody()
1786 if (!VALIDATE(imm.global->mutability)) { in DecodeFunctionBody()
1788 imm.index); in DecodeFunctionBody()
1791 auto value = Pop(0, imm.type); in DecodeFunctionBody()
1792 CALL_INTERFACE_IF_REACHABLE(SetGlobal, value, imm); in DecodeFunctionBody()
1866 MemoryIndexImmediate<validate> imm(this, this->pc_); in DecodeFunctionBody()
1867 len = 1 + imm.length; in DecodeFunctionBody()
1880 MemoryIndexImmediate<validate> imm(this, this->pc_); in DecodeFunctionBody()
1882 len = 1 + imm.length; in DecodeFunctionBody()
1887 CallFunctionImmediate<validate> imm(this, this->pc_); in DecodeFunctionBody()
1888 len = 1 + imm.length; in DecodeFunctionBody()
1889 if (!this->Validate(this->pc_, imm)) break; in DecodeFunctionBody()
1891 PopArgs(imm.sig); in DecodeFunctionBody()
1892 auto* returns = PushReturns(imm.sig); in DecodeFunctionBody()
1893 CALL_INTERFACE_IF_REACHABLE(CallDirect, imm, args_.data(), returns); in DecodeFunctionBody()
1897 CallIndirectImmediate<validate> imm(this, this->pc_); in DecodeFunctionBody()
1898 len = 1 + imm.length; in DecodeFunctionBody()
1899 if (!this->Validate(this->pc_, imm)) break; in DecodeFunctionBody()
1901 PopArgs(imm.sig); in DecodeFunctionBody()
1902 auto* returns = PushReturns(imm.sig); in DecodeFunctionBody()
1903 CALL_INTERFACE_IF_REACHABLE(CallIndirect, index, imm, args_.data(), in DecodeFunctionBody()
2010 ImmI32Immediate<Decoder::kNoValidate> imm(this, val.pc); in DecodeFunctionBody()
2011 TRACE_PART("[%d]", imm.value); in DecodeFunctionBody()
2017 LocalIndexImmediate<Decoder::kNoValidate> imm(this, val.pc); in DecodeFunctionBody()
2018 TRACE_PART("[%u]", imm.index); in DecodeFunctionBody()
2023 GlobalIndexImmediate<Decoder::kNoValidate> imm(this, val.pc); in DecodeFunctionBody()
2024 TRACE_PART("[%u]", imm.index); in DecodeFunctionBody()
2061 void SetBlockType(Control* c, BlockTypeImmediate<validate>& imm) { in SetBlockType() argument
2062 DCHECK_EQ(imm.in_arity(), this->args_.size()); in SetBlockType()
2065 InitMerge(&c->end_merge, imm.out_arity(), [pc, &imm](uint32_t i) { in SetBlockType()
2066 return Value::New(pc, imm.out_type(i)); in SetBlockType()
2068 InitMerge(&c->start_merge, imm.in_arity(), in SetBlockType()
2124 MemoryAccessImmediate<validate> imm(this, this->pc_ + prefix_len,
2128 CALL_INTERFACE_IF_REACHABLE(LoadMem, type, imm, index, result);
2129 return imm.length;
2134 MemoryAccessImmediate<validate> imm(this, this->pc_ + prefix_len,
2138 CALL_INTERFACE_IF_REACHABLE(StoreMem, store, imm, index, value);
2139 return imm.length;
2143 SimdLaneImmediate<validate> imm(this, this->pc_); in SimdExtractLane()
2144 if (this->Validate(this->pc_, opcode, imm)) { in SimdExtractLane()
2147 CALL_INTERFACE_IF_REACHABLE(SimdLaneOp, opcode, imm, ArrayVector(inputs), in SimdExtractLane()
2150 return imm.length; in SimdExtractLane()
2154 SimdLaneImmediate<validate> imm(this, this->pc_); in SimdReplaceLane()
2155 if (this->Validate(this->pc_, opcode, imm)) { in SimdReplaceLane()
2160 CALL_INTERFACE_IF_REACHABLE(SimdLaneOp, opcode, imm, ArrayVector(inputs), in SimdReplaceLane()
2163 return imm.length; in SimdReplaceLane()
2167 SimdShiftImmediate<validate> imm(this, this->pc_); in SimdShiftOp()
2168 if (this->Validate(this->pc_, opcode, imm)) { in SimdShiftOp()
2171 CALL_INTERFACE_IF_REACHABLE(SimdShiftOp, opcode, imm, input, result); in SimdShiftOp()
2173 return imm.length; in SimdShiftOp()
2177 Simd8x16ShuffleImmediate<validate> imm(this, this->pc_); in Simd8x16ShuffleOp()
2178 if (this->Validate(this->pc_, imm)) { in Simd8x16ShuffleOp()
2182 CALL_INTERFACE_IF_REACHABLE(Simd8x16ShuffleOp, imm, input0, input1, in Simd8x16ShuffleOp()
2275 MemoryAccessImmediate<validate> imm( in DecodeAtomicOpcode()
2277 len += imm.length; in DecodeAtomicOpcode()
2280 CALL_INTERFACE_IF_REACHABLE(AtomicOp, opcode, vec2vec(args_), imm, in DecodeAtomicOpcode()