Exemple #1
0
MethodCreator::MethodCreator(DexMethod* meth)
    : method(meth)
    , meth_code(meth->get_code()) {
  always_assert_log(meth->is_concrete(),
      "Method must be concrete or use the other ctor");
  load_locals(meth);
  main_block = new MethodBlock(meth_code->main_block(), this);
}
Exemple #2
0
MethodCreator::MethodCreator(DexMethod* meth)
    : method(meth),
      meth_code(MethodTransform::get_new_method(method)),
      out_count(0),
      top_reg(0) {
  always_assert_log(meth->is_concrete(),
                    "Method must be concrete or use the other ctor");
  load_locals(meth);
  main_block = new MethodBlock(meth_code->main_block(), this);
}
Exemple #3
0
MethodCreator::MethodCreator(DexType* cls,
                             DexString* name,
                             DexProto* proto,
                             DexAccessFlags access)
    : method(DexMethod::make_method(cls, name, proto)),
      meth_code(MethodTransform::get_new_method(method)),
      out_count(0),
      top_reg(0) {
  always_assert_log(!method->is_concrete(), "Method already defined");
  method->set_access(access);
  load_locals(method);
  main_block = new MethodBlock(meth_code->main_block(), this);
}
Exemple #4
0
MethodCreator::MethodCreator(DexType* cls,
                             DexString* name,
                             DexProto* proto,
                             DexAccessFlags access,
                             DexAnnotationSet* anno)
    : method(
          static_cast<DexMethod*>(DexMethod::make_method(cls, name, proto))) {
  always_assert_log(!method->is_concrete(), "Method already defined");
  if (anno) {
    method->attach_annotation_set(anno);
  }
  method->make_concrete(
      access, !(access & (ACC_STATIC | ACC_PRIVATE | ACC_CONSTRUCTOR)));
  method->set_code(std::make_unique<IRCode>(method, 0));
  meth_code = method->get_code();
  load_locals(method);
  main_block = new MethodBlock(meth_code->main_block(), this);
}