本文整理汇总了C++中DexInstruction类的典型用法代码示例。如果您正苦于以下问题:C++ DexInstruction类的具体用法?C++ DexInstruction怎么用?C++ DexInstruction使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DexInstruction类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: always_assert
void MethodBlock::load_const(Location& loc, DexType* value) {
always_assert(!loc.is_wide());
DexInstruction* load = new DexOpcodeType(OPCODE_CONST_CLASS, value);
load->set_dest(reg_num(loc));
loc.type = get_class_type();
push_instruction(load);
}
示例2: always_assert
void MethodBlock::binop_2addr(DexOpcode op,
const Location& dest,
const Location& src) {
always_assert(OPCODE_ADD_INT_2ADDR <= op && op <= OPCODE_REM_DOUBLE_2ADDR);
always_assert(dest.type == src.type);
DexInstruction* insn = new DexInstruction(op);
insn->set_src(0, reg_num(dest));
insn->set_src(1, reg_num(src));
push_instruction(insn);
}
示例3: code
std::unique_ptr<DexCode>& MethodCreator::to_code() {
std::unique_ptr<DexCode> code(new DexCode());
code->set_registers_size(top_reg);
code->set_ins_size(ins_count());
code->set_outs_size(out_count);
method->set_code(std::move(code));
for (auto& mi : *meth_code->m_fmethod) {
if (mi.type == MFLOW_OPCODE) {
DexInstruction* insn = mi.insn;
if (insn->dests_size() && !insn->dest_is_src()) {
insn->set_dest(get_real_reg_num(insn->dest()));
}
for (int i = 0; i < static_cast<int>(insn->srcs_size()); i++) {
insn->set_src(i, get_real_reg_num(insn->src(i)));
}
}
}
while (!meth_code->try_sync())
;
return method->get_code();
}