コード例 #1
0
        private void NoteDispatch(IMethodDefinition compileTimeMethod, IMethodDefinition runtimeMethod, ITypeDefinition runtimeType)
        {
            Contract.Requires(GarbageCollectHelper.MethodDefinitionIsUnspecialized(compileTimeMethod));
            Contract.Requires(GarbageCollectHelper.MethodDefinitionIsUnspecialized(runtimeMethod));
            Contract.Requires(GarbageCollectHelper.TypeDefinitionIsUnspecialized(runtimeType));

            // Note: runtimeType may not be type containing runtimeMethod, but it will be a subtype of it.
            // Might want a contract for this.

            if (virtualCallsInDemand.NoteVirtualMethodMayDispatchToMethod(compileTimeMethod, runtimeMethod))
            {
                AddToWorklist(runtimeMethod);

                analysisReasons.NoteMethodReachableForReason(runtimeMethod, analysisReasons.MethodReachedByDispatchAgainstVirtualMethodWithTypeConstructed(compileTimeMethod, runtimeType));
            }
        }