diff options
Diffstat (limited to 'src/zap/zapper.cpp')
-rw-r--r-- | src/zap/zapper.cpp | 139 |
1 files changed, 3 insertions, 136 deletions
diff --git a/src/zap/zapper.cpp b/src/zap/zapper.cpp index 626e1a0f1e..d6d03d65b1 100644 --- a/src/zap/zapper.cpp +++ b/src/zap/zapper.cpp @@ -53,12 +53,8 @@ extern "C" HRESULT STDMETHODCALLTYPE InitializeFusion(); #include "shlwapi.h" #pragma warning(pop) -#ifndef CLR_STANDALONE_BINDER extern const WCHAR g_pwBaseLibrary[]; extern bool g_fAllowNativeImages; -#ifdef MDIL -bool g_fIsNGenEmbedILProcess; -#endif #if defined(FEATURE_CORECLR) || defined(CROSSGEN_COMPILE) bool g_fNGenMissingDependenciesOk; #endif @@ -66,7 +62,6 @@ bool g_fNGenWinMDResilient; #if !defined(CROSSGEN_COMPILE) && !defined(FEATURE_CORECLR) extern int g_ningenState; #endif -#endif #ifdef FEATURE_READYTORUN_COMPILER bool g_fReadyToRunCompilation; @@ -88,7 +83,6 @@ void Zapper::ReportEventNGEN(WORD wType, DWORD dwEventID, LPCWSTR format, ...) SString message; message.Printf(W(".NET Runtime Optimization Service (%s) - %s"), VER_FILEVERSION_STR_L, s.GetUnicode()); -#ifndef BINDER // Note: We are using the same event log source as the ngen service. This may become problem // if we ever want to split the ngen service from the rest of the .NET Framework. ClrReportEvent(W(".NET Runtime Optimization Service"), @@ -97,8 +91,7 @@ void Zapper::ReportEventNGEN(WORD wType, DWORD dwEventID, LPCWSTR format, ...) dwEventID, // event identifier NULL, // no user security identifier message.GetUnicode()); -#endif - + // Output the message to the logger as well. if (wType == EVENTLOG_WARNING_TYPE) Warning(W("%s\n"), s.GetUnicode()); @@ -147,7 +140,6 @@ static HRESULT GetAssemblyName( // For side by side issues, it's best to use the exported API calls to generate a // Zapper Object instead of creating one on your own. -#ifndef CLR_STANDALONE_BINDER #if defined(FEATURE_CORECLR) || defined(CROSSGEN_COMPILE) STDAPI NGenWorker(LPCWSTR pwzFilename, DWORD dwFlags, LPCWSTR pwzPlatformAssembliesPaths, LPCWSTR pwzTrustedPlatformAssemblies, LPCWSTR pwzPlatformResourceRoots, LPCWSTR pwzAppPaths, LPCWSTR pwzOutputFilename=NULL, LPCWSTR pwzPlatformWinmdPaths=NULL, ICorSvcLogger *pLogger = NULL) @@ -217,20 +209,6 @@ STDAPI NGenWorker(LPCWSTR pwzFilename, DWORD dwFlags, LPCWSTR pwzPlatformAssembl if (pwzPlatformWinmdPaths != nullptr) zap->SetPlatformWinmdPaths(pwzPlatformWinmdPaths); -#ifdef MDIL - if (dwFlags & NGENWORKER_FLAGS_CREATEMDIL) - zap->SetCompilerFlag(CORJIT_FLG_MDIL); - - if (dwFlags & NGENWORKER_FLAGS_MINIMAL_MDIL) - zap->SetCompilerFlag(CORJIT_FLG_MINIMAL_MDIL); - - if (dwFlags & NGENWORKER_FLAGS_NOMDIL) - zap->SetCompilerFlag(CORJIT_FLG_NO_MDIL); - - g_fIsNGenEmbedILProcess = !!(dwFlags & NGENWORKER_FLAGS_EMBEDMDIL); - zap->SetEmbedMDIL(!!(dwFlags & NGENWORKER_FLAGS_EMBEDMDIL)); -#endif - zap->SetForceFullTrust(!!(dwFlags & NGENWORKER_FLAGS_FULLTRUSTDOMAIN)); #ifdef FEATURE_LEGACYNETCF @@ -416,7 +394,6 @@ STDAPI_(BOOL) LegacyNGenCompile(HANDLE hZapper, LPCWSTR path) }// NGenCompile #endif // FEATURE_CORECLR || CROSSGEN_COMPILE -#endif // CLR_STANDALONE_BINDER /* --------------------------------------------------------------------------- * * Options class @@ -565,11 +542,7 @@ Zapper::Zapper(NGenOptions *pOptions, bool fromDllHost) } else { -#ifdef CLR_STANDALONE_BINDER - zo->m_repositoryFlags = RepositoryDefault; -#else zo->m_repositoryFlags = (RepositoryFlags)REGUTIL::GetConfigDWORD_DontUse_(CLRConfig::EXTERNAL_RepositoryFlags, RepositoryDefault); -#endif // CLR_STANDALONE_BINDER } // The default location of the repository is "repository" folder under framework version directory @@ -703,10 +676,6 @@ void Zapper::Init(ZapperOptions *pOptions, bool fFreeZapperOptions) #endif m_fForceFullTrust = false; - -#ifdef MDIL - m_fEmbedMDIL = false; -#endif } // LoadAndInitializeJITForNgen: load the JIT dll into the process, and initialize it (call the UtilCode initialization function, @@ -720,7 +689,6 @@ void Zapper::Init(ZapperOptions *pOptions, bool fFreeZapperOptions) // It is NULL if the JIT returns a NULL interface pointer, or if the JIT-EE interface GUID is mismatched. // // Note that both *phJit and *ppICorJitCompiler will be non-NULL on success. On failure, an exception is thrown. -#ifndef BINDER void Zapper::LoadAndInitializeJITForNgen(LPCWSTR pwzJitName, OUT HINSTANCE* phJit, OUT ICorJitCompiler** ppICorJitCompiler) { _ASSERTE(phJit != NULL); @@ -813,18 +781,13 @@ void Zapper::LoadAndInitializeJITForNgen(LPCWSTR pwzJitName, OUT HINSTANCE* phJi // The JIT has loaded and passed the version identifier test, so publish the JIT interface to the caller. *ppICorJitCompiler = pICorJitCompiler; } -#endif // !BINDER -#ifdef BINDER -void Zapper::InitEE(BOOL fForceDebug, BOOL fForceProfile, BOOL fForceInstrument, ICorCompileInfo *compileInfo, ICorDynamicInfo *dynamicInfo) -#else void Zapper::InitEE(BOOL fForceDebug, BOOL fForceProfile, BOOL fForceInstrument) -#endif { if (m_pEECompileInfo != NULL) return; -#if defined(FEATURE_COMINTEROP) && !defined(BINDER) +#if defined(FEATURE_COMINTEROP) // // Initialize COM // @@ -840,12 +803,7 @@ void Zapper::InitEE(BOOL fForceDebug, BOOL fForceProfile, BOOL fForceInstrument) // Get EE compiler interface and initialize the EE // -#ifdef BINDER - _ASSERTE(dynamicInfo != NULL && compileInfo != NULL); - m_pEECompileInfo = compileInfo; -#else m_pEECompileInfo = GetCompileInfo(); -#endif if (m_pOpt->m_statOptions) IfFailThrow(m_pEECompileInfo->SetVerboseLevel (CORCOMPILE_STATS)); @@ -879,13 +837,8 @@ void Zapper::InitEE(BOOL fForceDebug, BOOL fForceProfile, BOOL fForceInstrument) } #endif // ALLOW_LOCAL_WORKER -#ifdef BINDER - m_pEEJitInfo = dynamicInfo; -#else m_pEEJitInfo = GetZapJitInfo(); -#endif -#ifndef BINDER // // Get JIT interface // @@ -963,7 +916,6 @@ void Zapper::InitEE(BOOL fForceDebug, BOOL fForceProfile, BOOL fForceInstrument) LoadAndInitializeJITForNgen(altName, &m_hAltJITCompiler, &m_alternateJit); } #endif // ALLOW_SXS_JIT_NGEN -#endif // BINDER } Zapper::~Zapper() @@ -2031,10 +1983,6 @@ void ZapperSetAppCompatWP8(ICorCompilationDomain *pDomain); void Zapper::CreateCompilationDomain() { -#ifdef BINDER - _ASSERTE(!"not reachable"); -#else - #if defined(CROSSGEN_COMPILE) && !defined(FEATURE_CORECLR) // Platform assemblies paths have to be set before appdomain is setup so that // mscorlib.dll can be loaded from them. @@ -2054,32 +2002,12 @@ void Zapper::CreateCompilationDomain() // collect the assembly dependencies for use in the version info, as // well as isolating the compilation code. -#ifdef MDIL - MDILCompilationFlags mdilFlags = MDILCompilationFlags_None; - if (m_pOpt->m_compilerFlags & CORJIT_FLG_MDIL) - mdilFlags = (MDILCompilationFlags)(mdilFlags | MDILCompilationFlags_CreateMDIL); - - if (m_pOpt->m_compilerFlags & CORJIT_FLG_MINIMAL_MDIL) - mdilFlags = (MDILCompilationFlags)(mdilFlags | MDILCompilationFlags_MinimalMDIL); - - if (m_pOpt->m_compilerFlags & CORJIT_FLG_NO_MDIL) - mdilFlags = (MDILCompilationFlags)(mdilFlags | MDILCompilationFlags_NoMDIL); - - IfFailThrow(m_pEECompileInfo->CreateDomain(&m_pDomain, - CreateAssemblyEmitter(), - fForceDebug, - fForceProfile, - fForceInstrument, - m_fForceFullTrust, - mdilFlags)); -#else IfFailThrow(m_pEECompileInfo->CreateDomain(&m_pDomain, CreateAssemblyEmitter(), fForceDebug, fForceProfile, fForceInstrument, m_fForceFullTrust)); -#endif #ifdef CROSSGEN_COMPILE IfFailThrow(m_pDomain->SetPlatformWinmdPaths(m_platformWinmdPaths)); @@ -2102,8 +2030,6 @@ void Zapper::CreateCompilationDomain() ZapperSetAppCompatWP8(m_pDomain); } #endif - -#endif // BINDER } void Zapper::CreateDependenciesLookupDomain() @@ -2338,7 +2264,7 @@ void Zapper::ComputeDependenciesInCurrentDomain(LPCWSTR pAssemblyString, CORCOMP } else { -#if defined(FEATURE_HOSTED_BINDER) && defined(FEATURE_APPX) && !defined(CLR_STANDALONE_BINDER) && !defined(FEATURE_CORECLR) +#if defined(FEATURE_HOSTED_BINDER) && defined(FEATURE_APPX) && !defined(FEATURE_CORECLR) if (m_pOpt->m_fAutoNGen) { // Make sure we're not been spoofed into loading an assembly that might be unsafe to load. @@ -2380,7 +2306,6 @@ void Zapper::ComputeDependenciesInCurrentDomain(LPCWSTR pAssemblyString, CORCOMP IfFailThrow(hr); } -#ifndef BINDER #ifndef FEATURE_CORECLR if (m_pOpt->m_fAutoNGen && !m_pEECompileInfo->SupportsAutoNGen(hAssembly)) { @@ -2388,7 +2313,6 @@ void Zapper::ComputeDependenciesInCurrentDomain(LPCWSTR pAssemblyString, CORCOMP ThrowHR(E_FAIL); } #endif // FEATURE_CORECLR -#endif // BINDER // // Check if we have a native image already, and if so get its GUID @@ -2616,9 +2540,6 @@ HRESULT Zapper::Compile(LPCWSTR string, CORCOMPILE_NGEN_SIGNATURE * pNativeImage HRESULT hr = S_OK; - -#if !defined(CLR_STANDALONE_BINDER) - bool fMscorlib = false; LPCWSTR fileName = PathFindFileName(string); if (fileName != NULL && SString::_wcsicmp(fileName, g_pwBaseLibrary) == 0) @@ -2653,22 +2574,6 @@ HRESULT Zapper::Compile(LPCWSTR string, CORCOMPILE_NGEN_SIGNATURE * pNativeImage } #endif -#if defined (MDIL) - if (fMscorlib) - { - if ((m_pOpt->m_compilerFlags & CORJIT_FLG_MDIL) != 0) // we are generating MDIL - { - // - // Disallow use of native images to force MDIL generation for mscorlib - // - g_fAllowNativeImages = false; - } - } -#endif - -#endif // !CLR_STANDALONE_BINDER - - // the errors in CreateCompilationDomain are fatal - propogate them up CreateCompilationDomain(); @@ -2810,14 +2715,6 @@ void Zapper::CompileInCurrentDomain(__in LPCWSTR string, CORCOMPILE_NGEN_SIGNATU // CompileAssembly(pNativeImageSig); -#ifdef MDIL - if (!m_pOpt->m_silent && (m_pOpt->m_compilerFlags & CORJIT_FLG_MDIL)) - { - GetSvcLogger()->Printf(W("MDIL image %s generated successfully.\n"), GetOutputFileName().GetUnicode()); - goto Exit; - } -#endif - goto Exit; // Avoid warning about unreferenced label Exit: @@ -3623,11 +3520,6 @@ void Zapper::CompileAssembly(CORCOMPILE_NGEN_SIGNATURE * pNativeImageSig) CompileNonManifestModules(hashAlgId, hFiles); #endif // FEATURE_MULTIMODULE_ASSEMBLIES -#ifdef MDIL - if (m_pOpt->m_compilerFlags & CORJIT_FLG_MDIL) - return; -#endif - // // Record the version info // @@ -3811,9 +3703,6 @@ void Zapper::CompileNonManifestModules(ULONG hashAlgId, SArray<HANDLE> &hFiles) NewHolder<ZapImage> pModule; pModule = CompileModule(hModule, NULL); -#ifdef MDIL - if (!(m_pOpt->m_compilerFlags & CORJIT_FLG_MDIL)) -#endif { SString strFileNameWithoutExt(strFileName); SString::CIterator fileNameIterator = strFileNameWithoutExt.End(); @@ -3830,9 +3719,6 @@ void Zapper::CompileNonManifestModules(ULONG hashAlgId, SArray<HANDLE> &hFiles) } } -#ifdef MDIL - if (!(m_pOpt->m_compilerFlags & CORJIT_FLG_MDIL)) -#endif { NewArrayHolder<BYTE> pbHashValue; DWORD cbHashValue; @@ -3900,13 +3786,6 @@ ZapImage * Zapper::CompileModule(CORINFO_MODULE_HANDLE hModule, module->Compile(); -#ifdef MDIL - if (m_pOpt->m_compilerFlags & CORJIT_FLG_MDIL) - { - return NULL; - } -#endif - if (IsReadyToRunCompilation()) { return module.Extract(); @@ -4186,18 +4065,6 @@ void Zapper::SetAppCompatWP8(bool val) } #endif -#ifdef MDIL -void Zapper::SetEmbedMDIL(bool val) -{ - m_fEmbedMDIL = val; -} - -void Zapper::SetCompilerFlag(DWORD val) -{ - m_pOpt->m_compilerFlags |= val; -} -#endif - void Zapper::SetForceFullTrust(bool val) { m_fForceFullTrust = val; |