public sealed override bool ContainsMethodBody(MethodDesc method, bool unboxingStub)
        {
            if (!_profileGuidedCompileRestrictionSet)
            {
                throw new InternalCompilerErrorException("Called ContainsMethodBody without setting profile guided restriction");
            }

            if (_profileGuidedCompileRestriction != null)
            {
                bool found = false;

                if (!method.HasInstantiation && !method.OwningType.HasInstantiation)
                {
                    // Check only the defining module for non-generics
                    MetadataType mdType = method.OwningType as MetadataType;
                    if (mdType != null)
                    {
                        if (_profileGuidedCompileRestriction.GetDataForModuleDesc(mdType.Module).GetMethodProfileData(method) != null)
                        {
                            found = true;
                        }
                    }
                }
                else
                {
                    // For generics look in the profile data of all modules being compiled
                    foreach (ModuleDesc module in _compilationModuleSet)
                    {
                        if (_profileGuidedCompileRestriction.GetDataForModuleDesc(module).GetMethodProfileData(method) != null)
                        {
                            found = true;
                            break;
                        }
                    }
                }

                if (found == false)
                {
                    return(false);
                }
            }

            if (method is ArrayMethod)
            {
                // TODO-PERF: for now, we never emit native code for array methods as Crossgen ignores
                // them too. At some point we might be able to "exceed Crossgen CQ" by adding this support.
                return(false);
            }

            return((ContainsType(method.OwningType) && VersionsWithMethodBody(method)) || CompileVersionBubbleGenericsIntoCurrentModule(method));
        }
예제 #2
0
 public ReadyToRunRootProvider(EcmaModule module, ProfileDataManager profileDataManager)
 {
     _module      = module;
     _profileData = profileDataManager.GetDataForModuleDesc(module);
 }