2828#define IMAGE_FILE_MACHINE_ARM64 0xAA64 // ARM64 Little-Endian
2929#endif
3030
31- #if !defined(DACCESS_COMPILE) && !defined(CROSSGEN_COMPILE)
31+ #if !defined(DACCESS_COMPILE)
3232#include " defaultassemblybinder.h"
3333// Helper function in the VM, invoked by the Binder, to invoke the host assembly resolver
3434extern HRESULT RuntimeInvokeHostAssemblyResolver (INT_PTR pManagedAssemblyLoadContextToBindWithin,
3535 BINDER_SPACE::AssemblyName *pAssemblyName,
3636 DefaultAssemblyBinder *pTPABinder,
3737 BINDER_SPACE::Assembly **ppLoadedAssembly);
3838
39- #endif // !defined(DACCESS_COMPILE) && !defined(CROSSGEN_COMPILE)
39+ #endif // !defined(DACCESS_COMPILE)
4040
4141namespace BINDER_SPACE
4242{
@@ -154,7 +154,6 @@ namespace BINDER_SPACE
154154 return hr;
155155 }
156156
157- #ifndef CROSSGEN_COMPILE
158157 HRESULT CreateImageAssembly (IMDInternalImport *pIMetaDataAssemblyImport,
159158 PEKIND PeKind,
160159 PEImage *pPEImage,
@@ -179,7 +178,6 @@ namespace BINDER_SPACE
179178 Exit:
180179 return hr;
181180 }
182- #endif // !CROSSGEN_COMPILE
183181 };
184182
185183 HRESULT AssemblyBinderCommon::TranslatePEToArchitectureType (DWORD *pdwPAFlags, PEKIND *PeKind)
@@ -267,12 +265,10 @@ namespace BINDER_SPACE
267265 // Tracing happens outside the binder lock to avoid calling into managed code within the lock
268266 BinderTracing::ResolutionAttemptedOperation tracer{pAssemblyName, pBinder, 0 /* managedALC*/ , hr};
269267
270- #ifndef CROSSGEN_COMPILE
271268 Retry:
272269 {
273270 // Lock the binding application context
274271 CRITSEC_Holder contextLock (pApplicationContext->GetCriticalSectionCookie ());
275- #endif
276272
277273 if (szCodeBase == NULL )
278274 {
@@ -309,16 +305,13 @@ namespace BINDER_SPACE
309305 // Remember the post-bind version
310306 kContextVersion = pApplicationContext->GetVersion ();
311307
312- #ifndef CROSSGEN_COMPILE
313308 } // lock(pApplicationContext)
314- #endif
315309
316310 Exit:
317311 tracer.TraceBindResult (bindResult);
318312
319313 if (bindResult.HaveResult ())
320314 {
321- #ifndef CROSSGEN_COMPILE
322315 BindResult hostBindResult;
323316
324317 hr = RegisterAndGetHostChosen (pApplicationContext,
@@ -338,17 +331,12 @@ namespace BINDER_SPACE
338331 {
339332 *ppAssembly = hostBindResult.GetAssembly (TRUE /* fAddRef */ );
340333 }
341- #else // CROSSGEN_COMPILE
342-
343- *ppAssembly = bindResult.GetAssembly (TRUE /* fAddRef */ );
344-
345- #endif // CROSSGEN_COMPILE
346334 }
347335
348336 return hr;
349337 }
350338
351- #if !defined(DACCESS_COMPILE) && !defined(CROSSGEN_COMPILE)
339+ #if !defined(DACCESS_COMPILE)
352340 /* static */
353341 HRESULT AssemblyBinderCommon::BindToSystem (BINDER_SPACE::Assembly** ppSystemAssembly, bool fBindToNativeImage )
354342 {
@@ -370,7 +358,7 @@ namespace BINDER_SPACE
370358
371359 return hr;
372360 }
373- #endif // !defined(DACCESS_COMPILE) && !defined(CROSSGEN_COMPILE)
361+ #endif // !defined(DACCESS_COMPILE)
374362
375363 /* static */
376364 HRESULT AssemblyBinderCommon::BindToSystem (SString &systemDirectory,
@@ -673,7 +661,6 @@ namespace BINDER_SPACE
673661 HRESULT hr = S_OK;
674662
675663 bool isTpaListProvided = pApplicationContext->IsTpaListProvided ();
676- #ifndef CROSSGEN_COMPILE
677664 ContextEntry *pContextEntry = NULL ;
678665 hr = FindInExecutionContext (pApplicationContext, pAssemblyName, &pContextEntry);
679666
@@ -705,7 +692,6 @@ namespace BINDER_SPACE
705692 pBindResult->SetResult (pContextEntry);
706693 }
707694 else
708- #endif // !CROSSGEN_COMPILE
709695 if (isTpaListProvided)
710696 {
711697 // BindByTpaList handles setting attempt results on the bind result
@@ -734,7 +720,6 @@ namespace BINDER_SPACE
734720 return hr;
735721 }
736722
737- #ifndef CROSSGEN_COMPILE
738723 /* static */
739724 HRESULT AssemblyBinderCommon::FindInExecutionContext (ApplicationContext *pApplicationContext,
740725 AssemblyName *pAssemblyName,
@@ -763,7 +748,6 @@ namespace BINDER_SPACE
763748 return pContextEntry != NULL ? S_OK : S_FALSE;
764749 }
765750
766- #endif // CROSSGEN_COMPILE
767751
768752 //
769753 // Tests whether a candidate assembly's name matches the requested.
@@ -1300,7 +1284,6 @@ namespace BINDER_SPACE
13001284 return hr;
13011285 }
13021286
1303- #ifndef CROSSGEN_COMPILE
13041287
13051288 /* static */
13061289 HRESULT AssemblyBinderCommon::Register (ApplicationContext *pApplicationContext,
@@ -1416,9 +1399,8 @@ namespace BINDER_SPACE
14161399 return hr;
14171400 }
14181401
1419- #endif // CROSSGEN_COMPILE
14201402
1421- #if !defined(DACCESS_COMPILE) && !defined(CROSSGEN_COMPILE)
1403+ #if !defined(DACCESS_COMPILE)
14221404HRESULT AssemblyBinderCommon::BindUsingHostAssemblyResolver (/* in */ INT_PTR pManagedAssemblyLoadContextToBindWithin,
14231405 /* in */ AssemblyName *pAssemblyName,
14241406 /* in */ DefaultAssemblyBinder *pTPABinder,
@@ -1622,7 +1604,7 @@ HRESULT AssemblyBinderCommon::GetAssemblyIdentity(LPCSTR szTextualIdentity,
16221604 return hr;
16231605}
16241606
1625- #endif // !defined(DACCESS_COMPILE) && !defined(CROSSGEN_COMPILE)
1607+ #endif // !defined(DACCESS_COMPILE)
16261608};
16271609
16281610
0 commit comments