Exemplo n.º 1
0
mdMethodDef Binder::GetMethodDef(BinderMethodID id)
{
    _ASSERTE(id != METHOD__NIL);
    _ASSERTE(id <= m_cMethodRIDs);
    if (m_pMethodRIDs[id-1] == 0)
        LookupMethod(id);
    return TokenFromRid(m_pMethodRIDs[id-1], mdtMethodDef);
}
Exemplo n.º 2
0
MethodDesc *Binder::FetchMethod(BinderMethodID id)
{
    THROWSCOMPLUSEXCEPTION();

    _ASSERTE(id != METHOD__NIL);
    _ASSERTE(id <= m_cMethodRIDs);

    MethodDesc *pMD;

    if (m_pMethodRIDs[id-1] == 0)
        pMD = LookupMethod(id);
    else
    {
        pMD = RawGetMethod(id);
        pMD->GetMethodTable()->CheckRestore();
    }

    // Initialize the sig here where it's safe.  (Otherwise it would typically happen
    // during a MethodDesc::Call.)
    m_methodDescriptions[id-1].sig->GetBinarySig();

    return pMD;
}
Exemplo n.º 3
0
bool Executor::ExecFuncall(MethodFrame *frame,
			   Insn *insn) {
  Object *obj;
  Method *callee_method = LookupMethod(frame, insn, &obj);
  if (!callee_method) {
    return true;
  }
  CHECK(callee_method);
  vector<Value> args;
  for (size_t i = 0; i < insn->src_regs_.size(); ++i) {
    args.push_back(frame->reg_values_[insn->src_regs_[i]->id_]);
  }
  if (callee_method->method_fn_) {
    // native
    callee_method->method_fn_(thr_, obj, args);
    if (!thr_->IsRunnable()) {
      return true;
    }
  } else {
    SetupCallee(obj, callee_method, args);
    return true;
  }
  return false;
}