public override GenericDictionaryCell GetDictionaryCell() { ushort slot; if (!LazyVTableResolver.TryGetInterfaceSlotNumberFromMethod(Method, out slot)) { Environment.FailFast("Unable to get interface slot number for method"); } return(GenericDictionaryCell.CreateInterfaceCallCell(Method.OwningType, slot)); }
/// <summary> /// Given a virtual method decl, return its VTable slot if the method is used on its containing type. /// Return -1 if the virtual method is not used. /// </summary> public static int GetVirtualMethodSlot(NodeFactory factory, MethodDesc method, TypeDesc implType) { Debug.Assert(method.IsVirtual); if (method.OwningType.IsInterface) { ushort slot; if (!LazyVTableResolver.TryGetInterfaceSlotNumberFromMethod(method, out slot)) { Environment.FailFast("Unable to get interface slot number for method"); } return(slot); } else { return(LazyVTableResolver.VirtualMethodToSlotIndex(method)); } }