+// Method callee where the dict comes from a type param
+fn trans_param_callee(bcx: @block_ctxt, fld_expr: @ast::expr,
+ base: @ast::expr, iface_id: ast::def_id, n_method: uint,
+ n_param: uint, n_bound: uint) -> lval_maybe_callee {
+ let {bcx, val} = trans_self_arg(bcx, base);
+ let dict = option::get(bcx.fcx.lltyparams[n_param].dicts)[n_bound];
+ trans_vtable_callee(bcx, val, dict, fld_expr, iface_id, n_method)
+}
+
+// Method callee where the dict comes from a boxed iface
+fn trans_iface_callee(bcx: @block_ctxt, fld_expr: @ast::expr, base: @ast::expr,
+ n_method: uint)
+ -> lval_maybe_callee {
+ let tcx = bcx_tcx(bcx);
+ let {bcx, val} = trans_temp_expr(bcx, base);
+ let box_body = GEPi(bcx, val, [0, abi::box_rc_field_body]);
+ let dict = Load(bcx, PointerCast(bcx, GEPi(bcx, box_body, [0, 1]),
+ T_ptr(T_ptr(T_dict()))));
+ // FIXME[impl] I doubt this is alignment-safe
+ let self = PointerCast(bcx, GEPi(bcx, box_body, [0, 2]),
+ T_opaque_cbox_ptr(bcx_ccx(bcx)));
+ let iface_id = alt ty::struct(tcx, ty::expr_ty(tcx, base)) {
+ ty::ty_iface(did, _) { did }
+ };
+ trans_vtable_callee(bcx, self, dict, fld_expr, iface_id, n_method)
+}
+