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()
96 bool EntryHook::Apply(lir::CodeIr* code_ir) { in Apply()
97 lir::Bytecode* bytecode = nullptr; in Apply()
143 auto hook_method = code_ir->Alloc<lir::Method>(ir_method_decl, ir_method_decl->orig_index); in Apply()
148 auto args = code_ir->Alloc<lir::VRegRange>(regs - args_count, args_count); in Apply()
151 auto hook_invoke = code_ir->Alloc<lir::Bytecode>(); in Apply()
161 void GenerateShiftParamsCode(lir::CodeIr* code_ir, lir::Instruction* position, dex::u4 shift) { in GenerateShiftParamsCode()
182 auto move = code_ir->Alloc<lir::Bytecode>(); in GenerateShiftParamsCode()
186 move->operands.push_back(code_ir->Alloc<lir::VReg>(reg - shift)); in GenerateShiftParamsCode()
187 move->operands.push_back(code_ir->Alloc<lir::VReg>(reg)); in GenerateShiftParamsCode()
192 move->operands.push_back(code_ir->Alloc<lir::VReg>(reg - shift)); in GenerateShiftParamsCode()
193 move->operands.push_back(code_ir->Alloc<lir::VReg>(reg)); in GenerateShiftParamsCode()
198 move->operands.push_back(code_ir->Alloc<lir::VRegPair>(reg - shift)); in GenerateShiftParamsCode()
199 move->operands.push_back(code_ir->Alloc<lir::VRegPair>(reg)); in GenerateShiftParamsCode()
209 bool EntryHook::InjectArrayParamsHook(lir::CodeIr* code_ir, lir::Bytecode* bytecode) { in InjectArrayParamsHook()
244 auto const_size_op = code_ir->Alloc<lir::Bytecode>(); in InjectArrayParamsHook()
246 const_size_op->operands.push_back(code_ir->Alloc<lir::VReg>(array_size_reg)); in InjectArrayParamsHook()
247 const_size_op->operands.push_back(code_ir->Alloc<lir::Const32>(param_types.size() + !is_static)); in InjectArrayParamsHook()
252 auto allocate_array_op = code_ir->Alloc<lir::Bytecode>(); in InjectArrayParamsHook()
254 allocate_array_op->operands.push_back(code_ir->Alloc<lir::VReg>(array_reg)); in InjectArrayParamsHook()
255 allocate_array_op->operands.push_back(code_ir->Alloc<lir::VReg>(array_size_reg)); in InjectArrayParamsHook()
257 code_ir->Alloc<lir::Type>(obj_array_type, obj_array_type->orig_index)); in InjectArrayParamsHook()
285 auto index_const_op = code_ir->Alloc<lir::Bytecode>(); in InjectArrayParamsHook()
287 index_const_op->operands.push_back(code_ir->Alloc<lir::VReg>(array_index_reg)); in InjectArrayParamsHook()
288 index_const_op->operands.push_back(code_ir->Alloc<lir::Const32>(i++)); in InjectArrayParamsHook()
291 auto aput_op = code_ir->Alloc<lir::Bytecode>(); in InjectArrayParamsHook()
293 aput_op->operands.push_back(code_ir->Alloc<lir::VReg>(src_reg)); in InjectArrayParamsHook()
294 aput_op->operands.push_back(code_ir->Alloc<lir::VReg>(array_reg)); in InjectArrayParamsHook()
295 aput_op->operands.push_back(code_ir->Alloc<lir::VReg>(array_index_reg)); in InjectArrayParamsHook()
309 auto hook_method = code_ir->Alloc<lir::Method>(ir_method_decl, ir_method_decl->orig_index); in InjectArrayParamsHook()
310 auto args = code_ir->Alloc<lir::VRegRange>(array_reg, 1); in InjectArrayParamsHook()
311 auto hook_invoke = code_ir->Alloc<lir::Bytecode>(); in InjectArrayParamsHook()
321 auto cleanup = code_ir->Alloc<lir::Bytecode>(); in InjectArrayParamsHook()
323 cleanup->operands.push_back(code_ir->Alloc<lir::VReg>(i)); in InjectArrayParamsHook()
324 cleanup->operands.push_back(code_ir->Alloc<lir::Const32>(0xFEFEFEFE)); in InjectArrayParamsHook()
335 bool ExitHook::Apply(lir::CodeIr* code_ir) { in Apply()
360 auto hook_method = code_ir->Alloc<lir::Method>(ir_method_decl, ir_method_decl->orig_index); in Apply()
382 reg = bytecode->CastOperand<lir::VReg>(0)->reg; in Apply()
388 reg = bytecode->CastOperand<lir::VReg>(0)->reg; in Apply()
394 reg = bytecode->CastOperand<lir::VRegPair>(0)->base_reg; in Apply()
403 auto args = code_ir->Alloc<lir::VRegRange>(reg, reg_count); in Apply()
404 auto hook_invoke = code_ir->Alloc<lir::Bytecode>(); in Apply()
418 auto move_result = code_ir->Alloc<lir::Bytecode>(); in Apply()
424 auto check_cast = code_ir->Alloc<lir::Bytecode>(); in Apply()
426 check_cast->operands.push_back(code_ir->Alloc<lir::VReg>(reg)); in Apply()
428 code_ir->Alloc<lir::Type>(declared_return_type, declared_return_type->orig_index)); in Apply()
437 bool DetourHook::Apply(lir::CodeIr* code_ir) { in Apply()
454 auto orig_method = bytecode->CastOperand<lir::Method>(1)->ir_method; in Apply()
478 code_ir->Alloc<lir::Method>(ir_method_decl, ir_method_decl->orig_index); in Apply()
517 class RegsRenumberVisitor : public lir::Visitor {
524 virtual bool Visit(lir::Bytecode* bytecode) override { in Visit()
531 virtual bool Visit(lir::DbgInfoAnnotation* dbg_annotation) override { in Visit()
538 virtual bool Visit(lir::VReg* vreg) override { in Visit()
543 virtual bool Visit(lir::VRegPair* vreg_pair) override { in Visit()
548 virtual bool Visit(lir::VRegList* vreg_list) override { in Visit()
555 virtual bool Visit(lir::VRegRange* vreg_range) override { in Visit()
569 void AllocateScratchRegs::RegsRenumbering(lir::CodeIr* code_ir) { in RegsRenumbering()
597 void AllocateScratchRegs::ShiftParams(lir::CodeIr* code_ir) { in ShiftParams()
611 void AllocateScratchRegs::Allocate(lir::CodeIr* code_ir, dex::u4 first_reg, int count) { in Allocate()
627 bool AllocateScratchRegs::Apply(lir::CodeIr* code_ir) { in Apply()
665 lir::CodeIr code_ir(ir_method, dex_ir_); in InstrumentMethod()