Lines Matching refs:operand
258 LocalIndexOperand operand(decoder, pc); in AnalyzeLoopAssignment() local
260 operand.index < static_cast<uint32_t>(assigned->length())) { in AnalyzeLoopAssignment()
262 assigned->Add(operand.index); in AnalyzeLoopAssignment()
264 length = 1 + operand.length; in AnalyzeLoopAssignment()
280 inline bool Validate(const byte* pc, LocalIndexOperand& operand) { in Validate() argument
281 if (operand.index < total_locals()) { in Validate()
283 operand.type = local_types_->at(operand.index); in Validate()
285 operand.type = kWasmStmt; in Validate()
289 error(pc, pc + 1, "invalid local index: %u", operand.index); in Validate()
293 inline bool Validate(const byte* pc, GlobalIndexOperand& operand) { in Validate() argument
294 if (module_ != nullptr && operand.index < module_->globals.size()) { in Validate()
295 operand.global = &module_->globals[operand.index]; in Validate()
296 operand.type = operand.global->type; in Validate()
299 error(pc, pc + 1, "invalid global index: %u", operand.index); in Validate()
303 inline bool Complete(const byte* pc, CallFunctionOperand& operand) { in Complete() argument
304 if (module_ != nullptr && operand.index < module_->functions.size()) { in Complete()
305 operand.sig = module_->functions[operand.index].sig; in Complete()
311 inline bool Validate(const byte* pc, CallFunctionOperand& operand) { in Validate() argument
312 if (Complete(pc, operand)) { in Validate()
315 error(pc, pc + 1, "invalid function index: %u", operand.index); in Validate()
319 inline bool Complete(const byte* pc, CallIndirectOperand& operand) { in Complete() argument
320 if (module_ != nullptr && operand.index < module_->signatures.size()) { in Complete()
321 operand.sig = module_->signatures[operand.index]; in Complete()
327 inline bool Validate(const byte* pc, CallIndirectOperand& operand) { in Validate() argument
332 if (Complete(pc, operand)) { in Validate()
335 error(pc, pc + 1, "invalid signature index: #%u", operand.index); in Validate()
339 inline bool Validate(const byte* pc, BreakDepthOperand& operand, in Validate() argument
341 if (operand.depth < control.size()) { in Validate()
342 operand.target = &control[control.size() - operand.depth - 1]; in Validate()
345 error(pc, pc + 1, "invalid break depth: %u", operand.depth); in Validate()
349 bool Validate(const byte* pc, BranchTableOperand& operand, in Validate() argument
356 SimdLaneOperand& operand) { in Validate() argument
377 if (operand.lane < 0 || operand.lane >= num_lanes) { in Validate()
386 SimdShiftOperand& operand) { in Validate() argument
408 if (operand.shift < 0 || operand.shift >= max_shift) { in Validate()
423 MemoryAccessOperand operand(decoder, pc, UINT32_MAX); in OpcodeLength() local
424 return 1 + operand.length; in OpcodeLength()
428 BreakDepthOperand operand(decoder, pc); in OpcodeLength() local
429 return 1 + operand.length; in OpcodeLength()
433 GlobalIndexOperand operand(decoder, pc); in OpcodeLength() local
434 return 1 + operand.length; in OpcodeLength()
438 CallFunctionOperand operand(decoder, pc); in OpcodeLength() local
439 return 1 + operand.length; in OpcodeLength()
442 CallIndirectOperand operand(decoder, pc); in OpcodeLength() local
443 return 1 + operand.length; in OpcodeLength()
450 BlockTypeOperand operand(decoder, pc); in OpcodeLength() local
451 return 1 + operand.length; in OpcodeLength()
458 LocalIndexOperand operand(decoder, pc); in OpcodeLength() local
459 return 1 + operand.length; in OpcodeLength()
462 BranchTableOperand operand(decoder, pc); in OpcodeLength() local
463 BranchTableIterator iterator(decoder, operand); in OpcodeLength()
467 ImmI32Operand operand(decoder, pc); in OpcodeLength() local
468 return 1 + operand.length; in OpcodeLength()
471 ImmI64Operand operand(decoder, pc); in OpcodeLength() local
472 return 1 + operand.length; in OpcodeLength()
476 MemoryIndexOperand operand(decoder, pc); in OpcodeLength() local
477 return 1 + operand.length; in OpcodeLength()
733 BlockTypeOperand operand(this, pc_); in DecodeFunctionBody() local
737 SetBlockType(&control_.back(), operand); in DecodeFunctionBody()
738 len = 1 + operand.length; in DecodeFunctionBody()
753 BlockTypeOperand operand(this, pc_); in DecodeFunctionBody() local
759 SetBlockType(&control_.back(), operand); in DecodeFunctionBody()
760 len = 1 + operand.length; in DecodeFunctionBody()
765 LocalIndexOperand operand(this, pc_); in DecodeFunctionBody() local
766 len = 1 + operand.length; in DecodeFunctionBody()
793 if (Validate(pc_, operand)) { in DecodeFunctionBody()
797 ssa_env_->locals[operand.index] = exception_as_i32; in DecodeFunctionBody()
804 BlockTypeOperand operand(this, pc_); in DecodeFunctionBody() local
811 SetBlockType(&control_.back(), operand); in DecodeFunctionBody()
812 len = 1 + operand.length; in DecodeFunctionBody()
817 BlockTypeOperand operand(this, pc_); in DecodeFunctionBody() local
829 SetBlockType(&control_.back(), operand); in DecodeFunctionBody()
830 len = 1 + operand.length; in DecodeFunctionBody()
935 BreakDepthOperand operand(this, pc_); in DecodeFunctionBody() local
936 if (Validate(pc_, operand, control_)) { in DecodeFunctionBody()
937 BreakTo(operand.depth); in DecodeFunctionBody()
939 len = 1 + operand.length; in DecodeFunctionBody()
944 BreakDepthOperand operand(this, pc_); in DecodeFunctionBody() local
946 if (ok() && Validate(pc_, operand, control_)) { in DecodeFunctionBody()
952 BreakTo(operand.depth); in DecodeFunctionBody()
955 len = 1 + operand.length; in DecodeFunctionBody()
959 BranchTableOperand operand(this, pc_); in DecodeFunctionBody() local
960 BranchTableIterator iterator(this, operand); in DecodeFunctionBody()
961 if (Validate(pc_, operand, control_.size())) { in DecodeFunctionBody()
966 if (operand.table_count > 0) { in DecodeFunctionBody()
968 TFNode* sw = BUILD(Switch, operand.table_count + 1, key.node); in DecodeFunctionBody()
982 ssa_env_->control = (i == operand.table_count) in DecodeFunctionBody()
1035 ImmI32Operand operand(this, pc_); in DecodeFunctionBody() local
1036 Push(kWasmI32, BUILD(Int32Constant, operand.value)); in DecodeFunctionBody()
1037 len = 1 + operand.length; in DecodeFunctionBody()
1041 ImmI64Operand operand(this, pc_); in DecodeFunctionBody() local
1042 Push(kWasmI64, BUILD(Int64Constant, operand.value)); in DecodeFunctionBody()
1043 len = 1 + operand.length; in DecodeFunctionBody()
1047 ImmF32Operand operand(this, pc_); in DecodeFunctionBody() local
1048 Push(kWasmF32, BUILD(Float32Constant, operand.value)); in DecodeFunctionBody()
1049 len = 1 + operand.length; in DecodeFunctionBody()
1053 ImmF64Operand operand(this, pc_); in DecodeFunctionBody() local
1054 Push(kWasmF64, BUILD(Float64Constant, operand.value)); in DecodeFunctionBody()
1055 len = 1 + operand.length; in DecodeFunctionBody()
1059 LocalIndexOperand operand(this, pc_); in DecodeFunctionBody() local
1060 if (Validate(pc_, operand)) { in DecodeFunctionBody()
1062 Push(operand.type, ssa_env_->locals[operand.index]); in DecodeFunctionBody()
1064 Push(operand.type, nullptr); in DecodeFunctionBody()
1067 len = 1 + operand.length; in DecodeFunctionBody()
1071 LocalIndexOperand operand(this, pc_); in DecodeFunctionBody() local
1072 if (Validate(pc_, operand)) { in DecodeFunctionBody()
1073 Value val = Pop(0, local_type_vec_[operand.index]); in DecodeFunctionBody()
1074 if (ssa_env_->locals) ssa_env_->locals[operand.index] = val.node; in DecodeFunctionBody()
1076 len = 1 + operand.length; in DecodeFunctionBody()
1080 LocalIndexOperand operand(this, pc_); in DecodeFunctionBody() local
1081 if (Validate(pc_, operand)) { in DecodeFunctionBody()
1082 Value val = Pop(0, local_type_vec_[operand.index]); in DecodeFunctionBody()
1083 if (ssa_env_->locals) ssa_env_->locals[operand.index] = val.node; in DecodeFunctionBody()
1086 len = 1 + operand.length; in DecodeFunctionBody()
1094 GlobalIndexOperand operand(this, pc_); in DecodeFunctionBody() local
1095 if (Validate(pc_, operand)) { in DecodeFunctionBody()
1096 Push(operand.type, BUILD(GetGlobal, operand.index)); in DecodeFunctionBody()
1098 len = 1 + operand.length; in DecodeFunctionBody()
1102 GlobalIndexOperand operand(this, pc_); in DecodeFunctionBody() local
1103 if (Validate(pc_, operand)) { in DecodeFunctionBody()
1104 if (operand.global->mutability) { in DecodeFunctionBody()
1105 Value val = Pop(0, operand.type); in DecodeFunctionBody()
1106 BUILD(SetGlobal, operand.index, val.node); in DecodeFunctionBody()
1109 operand.index); in DecodeFunctionBody()
1112 len = 1 + operand.length; in DecodeFunctionBody()
1186 MemoryIndexOperand operand(this, pc_); in DecodeFunctionBody() local
1194 len = 1 + operand.length; in DecodeFunctionBody()
1199 MemoryIndexOperand operand(this, pc_); in DecodeFunctionBody() local
1201 len = 1 + operand.length; in DecodeFunctionBody()
1205 CallFunctionOperand operand(this, pc_); in DecodeFunctionBody() local
1206 if (Validate(pc_, operand)) { in DecodeFunctionBody()
1207 TFNode** buffer = PopArgs(operand.sig); in DecodeFunctionBody()
1209 BUILD(CallDirect, operand.index, buffer, &rets, position()); in DecodeFunctionBody()
1210 PushReturns(operand.sig, rets); in DecodeFunctionBody()
1212 len = 1 + operand.length; in DecodeFunctionBody()
1216 CallIndirectOperand operand(this, pc_); in DecodeFunctionBody() local
1217 if (Validate(pc_, operand)) { in DecodeFunctionBody()
1219 TFNode** buffer = PopArgs(operand.sig); in DecodeFunctionBody()
1222 BUILD(CallIndirect, operand.index, buffer, &rets, position()); in DecodeFunctionBody()
1223 PushReturns(operand.sig, rets); in DecodeFunctionBody()
1225 len = 1 + operand.length; in DecodeFunctionBody()
1313 ImmI32Operand operand(this, val.pc); in DecodeFunctionBody() local
1314 PrintF("[%d]", operand.value); in DecodeFunctionBody()
1318 LocalIndexOperand operand(this, val.pc); in DecodeFunctionBody() local
1319 PrintF("[%u]", operand.index); in DecodeFunctionBody()
1324 LocalIndexOperand operand(this, val.pc); in DecodeFunctionBody() local
1325 PrintF("[%u]", operand.index); in DecodeFunctionBody()
1349 void SetBlockType(Control* c, BlockTypeOperand& operand) { in SetBlockType() argument
1350 c->merge.arity = operand.arity; in SetBlockType()
1352 c->merge.vals.first = {pc_, nullptr, operand.read_entry(0)}; in SetBlockType()
1356 c->merge.vals.array[i] = {pc_, nullptr, operand.read_entry(i)}; in SetBlockType()
1408 MemoryAccessOperand operand(this, pc_, in DecodeLoadMem() local
1412 TFNode* node = BUILD(LoadMem, type, mem_type, index.node, operand.offset, in DecodeLoadMem()
1413 operand.alignment, position()); in DecodeLoadMem()
1415 return 1 + operand.length; in DecodeLoadMem()
1420 MemoryAccessOperand operand(this, pc_, in DecodeStoreMem() local
1424 BUILD(StoreMem, mem_type, index.node, operand.offset, operand.alignment, in DecodeStoreMem()
1426 return 1 + operand.length; in DecodeStoreMem()
1430 SimdLaneOperand operand(this, pc_); in SimdExtractLane() local
1431 if (Validate(pc_, opcode, operand)) { in SimdExtractLane()
1434 TFNode* node = BUILD(SimdLaneOp, opcode, operand.lane, inputs); in SimdExtractLane()
1437 return operand.length; in SimdExtractLane()
1441 SimdLaneOperand operand(this, pc_); in SimdReplaceLane() local
1442 if (Validate(pc_, opcode, operand)) { in SimdReplaceLane()
1446 TFNode* node = BUILD(SimdLaneOp, opcode, operand.lane, inputs); in SimdReplaceLane()
1449 return operand.length; in SimdReplaceLane()
1453 SimdShiftOperand operand(this, pc_); in SimdShiftOp() local
1454 if (Validate(pc_, opcode, operand)) { in SimdShiftOp()
1457 TFNode* node = BUILD(SimdShiftOp, opcode, operand.shift, inputs); in SimdShiftOp()
1460 return operand.length; in SimdShiftOp()
2107 BlockTypeOperand operand(&i, i.pc()); in PrintRawWasmCode() local
2109 for (unsigned i = 0; i < operand.arity; i++) { in PrintRawWasmCode()
2110 os << " " << WasmOpcodes::TypeName(operand.read_entry(i)); in PrintRawWasmCode()
2120 BreakDepthOperand operand(&i, i.pc()); in PrintRawWasmCode() local
2121 os << " // depth=" << operand.depth; in PrintRawWasmCode()
2125 BreakDepthOperand operand(&i, i.pc()); in PrintRawWasmCode() local
2126 os << " // depth=" << operand.depth; in PrintRawWasmCode()
2130 BranchTableOperand operand(&i, i.pc()); in PrintRawWasmCode() local
2131 os << " // entries=" << operand.table_count; in PrintRawWasmCode()
2135 CallIndirectOperand operand(&i, i.pc()); in PrintRawWasmCode() local
2136 os << " // sig #" << operand.index; in PrintRawWasmCode()
2137 if (decoder.Complete(i.pc(), operand)) { in PrintRawWasmCode()
2138 os << ": " << *operand.sig; in PrintRawWasmCode()
2143 CallFunctionOperand operand(&i, i.pc()); in PrintRawWasmCode() local
2144 os << " // function #" << operand.index; in PrintRawWasmCode()
2145 if (decoder.Complete(i.pc(), operand)) { in PrintRawWasmCode()
2146 os << ": " << *operand.sig; in PrintRawWasmCode()