Lines Matching defs:bc_ins

120         auto bc_ins = BytecodeInstruction(code_data.GetInstructions());
121 const auto bc_ins_last = bc_ins.JumpTo(code_data.GetCodeSize());
123 while (bc_ins.GetAddress() < bc_ins_last.GetAddress()) {
124 const size_t count = GetVRegCount(bc_ins);
126 bc_ins = bc_ins.GetNext();
129 if (!CheckVRegIdx(bc_ins, count, valid_regs_num.value())) {
132 bc_ins = bc_ins.GetNext();
233 auto bc_ins = BytecodeInstruction(ins_arr);
234 const auto bc_ins_last = bc_ins.JumpTo(ins_size);
236 while (bc_ins.GetAddress() < bc_ins_last.GetAddress()) {
237 if (!bc_ins.IsPrimaryOpcodeValid()) {
241 if (bc_ins.HasFlag(BytecodeInstruction::Flags::LITERALARRAY_ID)) {
244 size_t idx = bc_ins.GetLiteralIndex();
245 const auto arg_literal_idx = bc_ins.GetId(idx).AsIndex();
249 if (bc_ins.HasFlag(BytecodeInstruction::Flags::METHOD_ID)) {
250 const auto arg_method_idx = bc_ins.GetId().AsIndex();
254 if (bc_ins.HasFlag(BytecodeInstruction::Flags::STRING_ID)) {
255 const auto arg_string_idx = bc_ins.GetId().AsIndex();
259 bc_ins = bc_ins.GetNext();
304 size_t Verifier::GetVRegCount(const BytecodeInstruction &bc_ins)
307 BytecodeInstruction::Format format = bc_ins.GetFormat();
308 while (bc_ins.HasVReg(format, idx)) {
314 bool Verifier::IsRangeInstAndHasInvalidRegIdx(const BytecodeInstruction &bc_ins,
317 ASSERT(bc_ins.IsRangeInstruction());
319 uint64_t reg_idx = bc_ins.GetVReg(FIRST_INDEX);
324 std::optional<uint64_t> max_ins_reg_idx_opt = bc_ins.GetRangeInsLastRegIdx();
348 bool Verifier::CheckVRegIdx(const BytecodeInstruction &bc_ins, const size_t count, uint64_t valid_regs_num)
350 if (bc_ins.IsRangeInstruction() &&
351 IsRangeInstAndHasInvalidRegIdx(bc_ins, count, valid_regs_num)) {
355 uint16_t reg_idx = bc_ins.GetVReg(idx);
401 std::optional<int64_t> Verifier::GetFirstImmFromInstruction(const BytecodeInstruction &bc_ins)
405 const auto format = bc_ins.GetFormat();
406 if (bc_ins.HasImm(format, index)) {
407 first_imm = bc_ins.GetImm64(index);
598 bool Verifier::VerifyJumpInstruction(const BytecodeInstruction &bc_ins, const BytecodeInstruction &bc_ins_last,
603 const auto bc_ins_forward_size = bc_ins_last.GetAddress() - bc_ins.GetAddress();
605 const auto bc_ins_backward_size = bc_ins.GetAddress() - bc_ins_first.GetAddress();
607 if (bc_ins.IsJumpInstruction()) {
608 std::optional<int64_t> immdata = GetFirstImmFromInstruction(bc_ins);
622 const auto bc_ins_dest = bc_ins.JumpTo(immdata.value());
629 << "). incorrect instruction at offset: 0x" << (bc_ins.GetAddress() - ins_arr)
639 bool Verifier::GetIcSlotFromInstruction(const BytecodeInstruction &bc_ins, uint32_t &first_slot_index,
643 if (bc_ins.HasFlag(BytecodeInstruction::Flags::ONE_SLOT)) {
644 first_imm = GetFirstImmFromInstruction(bc_ins);
652 } else if (bc_ins.HasFlag(BytecodeInstruction::Flags::TWO_SLOT)) {
653 first_imm = GetFirstImmFromInstruction(bc_ins);
666 bool Verifier::VerifyCatchBlocks(panda_file::CodeDataAccessor::TryBlock &try_block, const BytecodeInstruction &bc_ins,
677 const auto handler_begin_bc_ins = bc_ins.JumpTo(handler_begin_offset);
678 const auto handler_end_bc_ins = bc_ins.JumpTo(handler_end_offset);
714 bool Verifier::VerifyTryBlocks(panda_file::CodeDataAccessor &code_accessor, const BytecodeInstruction &bc_ins,
720 const auto try_begin_bc_ins = bc_ins.JumpTo(try_block.GetStartPc());
723 const auto try_end_bc_ins = bc_ins.JumpTo(try_block.GetStartPc() + try_block.GetLength());
752 if (!VerifyCatchBlocks(try_block, bc_ins, bc_ins_last)) {
801 auto current_ins = infos.bc_ins;
858 auto bc_ins = BytecodeInstruction(ins_arr);
859 const auto bc_ins_last = bc_ins.JumpTo(ins_size);
860 const auto bc_ins_init = bc_ins; // initial PC value
865 MethodInfos infos = {bc_ins_init, bc_ins, bc_ins_last, method_accessor, method_id,
875 if (!PrecomputeInstructionIndices(bc_ins, bc_ins_last)) {
879 if (!IsMethodBytecodeInstruction(bc_ins)) {
882 if (!VerifyTryBlocks(code_accessor, bc_ins, bc_ins_last)) {