Lines Matching refs:lir

24 struct BytecodeConvertingVisitor : public lir::Visitor {
25 lir::Bytecode* out = nullptr;
26 bool Visit(lir::Bytecode* bytecode) { in Visit()
32 void BoxValue(lir::Bytecode* bytecode, in BoxValue()
33 lir::CodeIr* code_ir, in BoxValue()
79 auto boxing_method = code_ir->Alloc<lir::Method>(ir_method_decl, ir_method_decl->orig_index); in BoxValue()
81 auto args = code_ir->Alloc<lir::VRegRange>(src_reg, 1 + is_wide); in BoxValue()
82 auto boxing_invoke = code_ir->Alloc<lir::Bytecode>(); in BoxValue()
88 auto move_result = code_ir->Alloc<lir::Bytecode>(); in BoxValue()
90 move_result->operands.push_back(code_ir->Alloc<lir::VReg>(dst_reg)); in BoxValue()
101 bool EntryHook::Apply(lir::CodeIr* code_ir) { in Apply()
102 lir::Bytecode* bytecode = nullptr; in Apply()
148 auto hook_method = code_ir->Alloc<lir::Method>(ir_method_decl, ir_method_decl->orig_index); in Apply()
153 auto args = code_ir->Alloc<lir::VRegRange>(regs - args_count, args_count); in Apply()
156 auto hook_invoke = code_ir->Alloc<lir::Bytecode>(); in Apply()
166 void GenerateShiftParamsCode(lir::CodeIr* code_ir, lir::Instruction* position, dex::u4 shift) { in GenerateShiftParamsCode()
187 auto move = code_ir->Alloc<lir::Bytecode>(); in GenerateShiftParamsCode()
191 move->operands.push_back(code_ir->Alloc<lir::VReg>(reg - shift)); in GenerateShiftParamsCode()
192 move->operands.push_back(code_ir->Alloc<lir::VReg>(reg)); in GenerateShiftParamsCode()
197 move->operands.push_back(code_ir->Alloc<lir::VReg>(reg - shift)); in GenerateShiftParamsCode()
198 move->operands.push_back(code_ir->Alloc<lir::VReg>(reg)); in GenerateShiftParamsCode()
203 move->operands.push_back(code_ir->Alloc<lir::VRegPair>(reg - shift)); in GenerateShiftParamsCode()
204 move->operands.push_back(code_ir->Alloc<lir::VRegPair>(reg)); in GenerateShiftParamsCode()
214 bool EntryHook::InjectArrayParamsHook(lir::CodeIr* code_ir, lir::Bytecode* bytecode) { in InjectArrayParamsHook()
245 auto const_size_op = code_ir->Alloc<lir::Bytecode>(); in InjectArrayParamsHook()
247 const_size_op->operands.push_back(code_ir->Alloc<lir::VReg>(array_size_reg)); in InjectArrayParamsHook()
248 const_size_op->operands.push_back(code_ir->Alloc<lir::Const32>( in InjectArrayParamsHook()
254 auto allocate_array_op = code_ir->Alloc<lir::Bytecode>(); in InjectArrayParamsHook()
256 allocate_array_op->operands.push_back(code_ir->Alloc<lir::VReg>(array_reg)); in InjectArrayParamsHook()
257 allocate_array_op->operands.push_back(code_ir->Alloc<lir::VReg>(array_size_reg)); in InjectArrayParamsHook()
259 code_ir->Alloc<lir::Type>(obj_array_type, obj_array_type->orig_index)); in InjectArrayParamsHook()
282 auto const_str_op = code_ir->Alloc<lir::Bytecode>(); in InjectArrayParamsHook()
284 const_str_op->operands.push_back(code_ir->Alloc<lir::VReg>(value_reg)); // dst in InjectArrayParamsHook()
287 code_ir->Alloc<lir::String>(method_label, method_label->orig_index)); // src in InjectArrayParamsHook()
299 auto index_const_op = code_ir->Alloc<lir::Bytecode>(); in InjectArrayParamsHook()
301 index_const_op->operands.push_back(code_ir->Alloc<lir::VReg>(array_index_reg)); in InjectArrayParamsHook()
302 index_const_op->operands.push_back(code_ir->Alloc<lir::Const32>(i++)); in InjectArrayParamsHook()
305 auto aput_op = code_ir->Alloc<lir::Bytecode>(); in InjectArrayParamsHook()
307 aput_op->operands.push_back(code_ir->Alloc<lir::VReg>(src_reg)); in InjectArrayParamsHook()
308 aput_op->operands.push_back(code_ir->Alloc<lir::VReg>(array_reg)); in InjectArrayParamsHook()
309 aput_op->operands.push_back(code_ir->Alloc<lir::VReg>(array_index_reg)); in InjectArrayParamsHook()
327 auto hook_method = code_ir->Alloc<lir::Method>(ir_method_decl, ir_method_decl->orig_index); in InjectArrayParamsHook()
328 auto args = code_ir->Alloc<lir::VRegRange>(array_reg, 1); in InjectArrayParamsHook()
329 auto hook_invoke = code_ir->Alloc<lir::Bytecode>(); in InjectArrayParamsHook()
339 auto cleanup = code_ir->Alloc<lir::Bytecode>(); in InjectArrayParamsHook()
341 cleanup->operands.push_back(code_ir->Alloc<lir::VReg>(i)); in InjectArrayParamsHook()
342 cleanup->operands.push_back(code_ir->Alloc<lir::Const32>(0xFEFEFEFE)); in InjectArrayParamsHook()
353 bool ExitHook::Apply(lir::CodeIr* code_ir) { in Apply()
382 auto hook_method = code_ir->Alloc<lir::Method>(ir_method_decl, ir_method_decl->orig_index); in Apply()
403 reg = bytecode->CastOperand<lir::VReg>(0)->reg; in Apply()
409 reg = bytecode->CastOperand<lir::VReg>(0)->reg; in Apply()
415 reg = bytecode->CastOperand<lir::VRegPair>(0)->base_reg; in Apply()
438 auto move_op = code_ir->Alloc<lir::Bytecode>(); in Apply()
442 move_op->operands.push_back(code_ir->Alloc<lir::VReg>(reg + 1)); in Apply()
443 move_op->operands.push_back(code_ir->Alloc<lir::VReg>(reg)); in Apply()
447 move_op->operands.push_back(code_ir->Alloc<lir::VReg>(reg + 1)); in Apply()
448 move_op->operands.push_back(code_ir->Alloc<lir::VReg>(reg)); in Apply()
452 move_op->operands.push_back(code_ir->Alloc<lir::VRegPair>(reg + 1)); in Apply()
453 move_op->operands.push_back(code_ir->Alloc<lir::VRegPair>(reg)); in Apply()
469 auto const_str_op = code_ir->Alloc<lir::Bytecode>(); in Apply()
471 const_str_op->operands.push_back(code_ir->Alloc<lir::VReg>(scratch_reg)); // dst in Apply()
472 …const_str_op->operands.push_back(code_ir->Alloc<lir::String>(method_label, method_label->orig_inde… in Apply()
477 ? code_ir->Alloc<lir::VRegRange>(scratch_reg, reg_count + 1) in Apply()
478 : code_ir->Alloc<lir::VRegRange>(reg, reg_count); in Apply()
479 auto hook_invoke = code_ir->Alloc<lir::Bytecode>(); in Apply()
493 auto move_result = code_ir->Alloc<lir::Bytecode>(); in Apply()
499 auto check_cast = code_ir->Alloc<lir::Bytecode>(); in Apply()
501 check_cast->operands.push_back(code_ir->Alloc<lir::VReg>(reg)); in Apply()
503 code_ir->Alloc<lir::Type>(declared_return_type, declared_return_type->orig_index)); in Apply()
512 bool DetourHook::Apply(lir::CodeIr* code_ir) { in Apply()
529 auto orig_method = bytecode->CastOperand<lir::Method>(1)->ir_method; in Apply()
553 code_ir->Alloc<lir::Method>(ir_method_decl, ir_method_decl->orig_index); in Apply()
592 class RegsRenumberVisitor : public lir::Visitor {
599 virtual bool Visit(lir::Bytecode* bytecode) override { in Visit()
606 virtual bool Visit(lir::DbgInfoAnnotation* dbg_annotation) override { in Visit()
613 virtual bool Visit(lir::VReg* vreg) override { in Visit()
618 virtual bool Visit(lir::VRegPair* vreg_pair) override { in Visit()
623 virtual bool Visit(lir::VRegList* vreg_list) override { in Visit()
630 virtual bool Visit(lir::VRegRange* vreg_range) override { in Visit()
644 void AllocateScratchRegs::RegsRenumbering(lir::CodeIr* code_ir) { in RegsRenumbering()
672 void AllocateScratchRegs::ShiftParams(lir::CodeIr* code_ir) { in ShiftParams()
686 void AllocateScratchRegs::Allocate(lir::CodeIr* code_ir, dex::u4 first_reg, int count) { in Allocate()
702 bool AllocateScratchRegs::Apply(lir::CodeIr* code_ir) { in Apply()
740 lir::CodeIr code_ir(ir_method, dex_ir_); in InstrumentMethod()