summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kotas <jkotas@microsoft.com>2018-06-15 15:44:36 -0700
committerGitHub <noreply@github.com>2018-06-15 15:44:36 -0700
commit6bb3f84d42b9756c5fa18158db8f724d57796296 (patch)
tree2ae71f9f6aa18f40dab879c82c80794359e42aaf
parent13954f2b3072866be61c273d17f7b4fd2d1e6099 (diff)
downloadcoreclr-6bb3f84d42b9756c5fa18158db8f724d57796296.tar.gz
coreclr-6bb3f84d42b9756c5fa18158db8f724d57796296.tar.bz2
coreclr-6bb3f84d42b9756c5fa18158db8f724d57796296.zip
Delete bitrotten appdomain agility checks (#18489)
Fixes #18484
-rw-r--r--src/vm/appdomain.cpp2
-rw-r--r--src/vm/array.cpp7
-rw-r--r--src/vm/class.cpp474
-rw-r--r--src/vm/class.h94
-rw-r--r--src/vm/field.h21
-rw-r--r--src/vm/methodtablebuilder.cpp7
-rw-r--r--src/vm/methodtablebuilder.h1
-rw-r--r--src/vm/typehandle.cpp95
-rw-r--r--src/vm/typehandle.h8
9 files changed, 1 insertions, 708 deletions
diff --git a/src/vm/appdomain.cpp b/src/vm/appdomain.cpp
index 3766ed528a..3ca7ec7e24 100644
--- a/src/vm/appdomain.cpp
+++ b/src/vm/appdomain.cpp
@@ -2774,8 +2774,6 @@ void SystemDomain::LoadBaseSystemClasses()
g_pExecutionEngineExceptionClass = MscorlibBinder::GetException(kExecutionEngineException);
g_pThreadAbortExceptionClass = MscorlibBinder::GetException(kThreadAbortException);
-
- // used by gc to handle predefined agility checking
g_pThreadClass = MscorlibBinder::GetClass(CLASS__THREAD);
#ifdef FEATURE_COMINTEROP
diff --git a/src/vm/array.cpp b/src/vm/array.cpp
index b9e7d6e27a..5761b01660 100644
--- a/src/vm/array.cpp
+++ b/src/vm/array.cpp
@@ -432,13 +432,6 @@ MethodTable* Module::CreateArrayMethodTable(TypeHandle elemTypeHnd, CorElementTy
pClass->SetArrayElementType (elemType);
pClass->SetMethodTable (pMT);
-#if defined(_DEBUG)
- // Non-covariant arrays of agile types are agile
- if (elemType != ELEMENT_TYPE_CLASS && elemTypeHnd.IsAppDomainAgile())
- pClass->SetAppDomainAgile();
- pClass->SetAppDomainAgilityDone();
-#endif
-
// Fill In the method table
pClass->SetNumMethods(numVirtuals + numNonVirtualSlots);
diff --git a/src/vm/class.cpp b/src/vm/class.cpp
index 4375a340cd..fe7fe7e8a7 100644
--- a/src/vm/class.cpp
+++ b/src/vm/class.cpp
@@ -1042,480 +1042,6 @@ CorElementType EEClass::ComputeInternalCorElementTypeForValueType(MethodTable *
return ELEMENT_TYPE_VALUETYPE;
}
-#if defined(_DEBUG)
-//*******************************************************************************
-void EEClass::GetPredefinedAgility(Module *pModule, mdTypeDef td,
- BOOL *pfIsAgile, BOOL *pfCheckAgile)
-{
-
- CONTRACTL
- {
- NOTHROW;
- GC_NOTRIGGER;
- FORBID_FAULT;
- }
- CONTRACTL_END
-
- //
- // There are 4 settings possible:
- // IsAgile CheckAgile
- // F F (default) Use normal type logic to determine agility
- // T F "Proxy" Treated as agile even though may not be.
- // F T "Maybe" Not agile, but specific instances can be made agile.
- // T T "Force" All instances are forced agile, even though not typesafe.
- //
- // Also, note that object arrays of agile or maybe agile types are made maybe agile.
- //
-
- static const struct PredefinedAgility
- {
- const char *name;
- BOOL isAgile;
- BOOL checkAgile;
- }
-
- // Matches based on name with the first records having higher precedence than subsequent ones
- // so that when there is an ambiguity, the first one will be used:
- // System.Globalization.CultureNotFoundException
- // comes before
- // System.Globalization.*
- //
- // although System.Globalization.CultureNotFoundException matches both records, the first
- // is the one that will be used
- agility[] =
- {
- // The Thread leak across context boundaries.
- // We manage the leaks manually
- { g_ThreadClassName, TRUE, FALSE },
-
- // The SharedStatics class is a container for process-wide data
- { g_SharedStaticsClassName, FALSE, TRUE },
-
- // The extra dot at the start is to accomodate the string comparison logic below
- // when there is no namespace for a type
- {".StringMaker", FALSE, TRUE },
-
- {g_StringBufferClassName, FALSE, TRUE },
-
- { "System.ActivationArguments", FALSE, TRUE },
- { "System.AppDomainSetup" , FALSE, TRUE },
- { "System.AppDomainInitializerInfo", FALSE, TRUE },
-
- // Make all containers maybe agile
- { "System.Collections.*", FALSE, TRUE },
- { "System.Collections.Generic.*", FALSE, TRUE },
-
- // Make all globalization objects agile except for System.Globalization.CultureNotFoundException
- // The exception inherits from ArgumentException so needs the same agility
- // this must come before the more general declaration below so that it will match first
- { "System.Globalization.CultureNotFoundException", FALSE, FALSE },
- // We have CultureInfo objects on thread. Because threads leak across
- // app domains, we have to be prepared for CultureInfo to leak across.
- // CultureInfo exposes all of the other globalization objects, so we
- // just make the entire namespace app domain agile.
- { "System.Globalization.*", FALSE, TRUE },
-
- // Remoting structures for legally smuggling messages across app domains
- { "System.Runtime.Remoting.Messaging.SmuggledMethodCallMessage", FALSE, TRUE },
- { "System.Runtime.Remoting.Messaging.SmuggledMethodReturnMessage", FALSE, TRUE },
- { "System.Runtime.Remoting.Messaging.SmuggledObjRef", FALSE, TRUE},
- { "System.Runtime.Remoting.ObjRef", FALSE, TRUE },
- { "System.Runtime.Remoting.ChannelInfo", FALSE, TRUE },
- { "System.Runtime.Remoting.Channels.CrossAppDomainData", FALSE, TRUE },
-
- // Remoting cached data structures are all in mscorlib
- { "System.Runtime.Remoting.Metadata.RemotingCachedData", FALSE, TRUE },
- { "System.Runtime.Remoting.Metadata.RemotingFieldCachedData", FALSE, TRUE },
- { "System.Runtime.Remoting.Metadata.RemotingParameterCachedData", FALSE, TRUE },
- { "System.Runtime.Remoting.Metadata.RemotingMethodCachedData", FALSE, TRUE },
- { "System.Runtime.Remoting.Metadata.RemotingTypeCachedData", FALSE, TRUE },
- { "System.Runtime.Remoting.Metadata.SoapAttribute", FALSE, TRUE },
- { "System.Runtime.Remoting.Metadata.SoapFieldAttribute", FALSE, TRUE },
- { "System.Runtime.Remoting.Metadata.SoapMethodAttribute",FALSE, TRUE },
- { "System.Runtime.Remoting.Metadata.SoapParameterAttribute", FALSE, TRUE },
- { "System.Runtime.Remoting.Metadata.SoapTypeAttribute", FALSE, TRUE },
-
- // Reflection types
- { g_ReflectionMemberInfoName, FALSE, TRUE },
- { g_TypeClassName, FALSE, TRUE },
- { g_ReflectionClassName, FALSE, TRUE },
- { g_ReflectionConstructorInfoName, FALSE, TRUE },
- { g_ReflectionConstructorName, FALSE, TRUE },
- { g_ReflectionEventInfoName, FALSE, TRUE },
- { g_ReflectionEventName, FALSE, TRUE },
- { g_ReflectionFieldInfoName, FALSE, TRUE },
- { g_ReflectionFieldName, FALSE, TRUE },
- { g_MethodBaseName, FALSE, TRUE },
- { g_ReflectionMethodInfoName, FALSE, TRUE },
- { g_ReflectionMethodName, FALSE, TRUE },
- { g_ReflectionPropertyInfoName, FALSE, TRUE },
- { g_ReflectionPropInfoName, FALSE, TRUE },
- { g_ReflectionParamInfoName, FALSE, TRUE },
- { g_ReflectionParamName, FALSE, TRUE },
-
- { "System.RuntimeType+RuntimeTypeCache", FALSE, TRUE },
- { "System.RuntimeType+RuntimeTypeCache+MemberInfoCache`1", FALSE, TRUE },
- { "System.RuntimeType+RuntimeTypeCache+MemberInfoCache`1+Filter", FALSE, TRUE },
- { "System.Reflection.CerHashtable`2", FALSE, TRUE },
- { "System.Reflection.CerHashtable`2+Table", FALSE, TRUE },
- { "System.Reflection.RtFieldInfo", FALSE, TRUE },
- { "System.Reflection.MdFieldInfo", FALSE, TRUE },
- { "System.Signature", FALSE, TRUE },
- { "System.Reflection.MetadataImport", FALSE, TRUE },
-
- // LogSwitches are agile even though we can't prove it
- // <TODO>@todo: do they need really to be?</TODO>
- { "System.Diagnostics.LogSwitch", FALSE, TRUE },
-
- // There is a process global PermissionTokenFactory
- { "System.Security.PermissionToken", FALSE, TRUE },
- { g_PermissionTokenFactoryName, FALSE, TRUE },
-
- // Mark all the exceptions we throw agile. This makes
- // most BVTs pass even though exceptions leak
- //
- // Note that making exception checked automatically
- // makes a bunch of subclasses checked as well.
- //
- // Pre-allocated exceptions
- { g_ExceptionClassName, FALSE, TRUE },
- { g_OutOfMemoryExceptionClassName, FALSE, TRUE },
- { g_StackOverflowExceptionClassName, FALSE, TRUE },
- { g_ExecutionEngineExceptionClassName, FALSE, TRUE },
-
- // SecurityDocument contains pointers and other agile types
- { "System.Security.SecurityDocument", TRUE, TRUE },
-
- // BinaryFormatter smuggles these across appdomains.
- { "System.Runtime.Serialization.Formatters.Binary.BinaryObjectWithMap", TRUE, FALSE},
- { "System.Runtime.Serialization.Formatters.Binary.BinaryObjectWithMapTyped", TRUE, FALSE},
-
- { NULL }
- };
-
- if (pModule == SystemDomain::SystemModule())
- {
- while (TRUE)
- {
- LPCUTF8 pszName;
- LPCUTF8 pszNamespace;
- HRESULT hr;
- mdTypeDef tdEnclosing;
-
- if (FAILED(pModule->GetMDImport()->GetNameOfTypeDef(td, &pszName, &pszNamespace)))
- {
- break;
- }
-
- // We rely the match algorithm matching the first items in the list before subsequent ones
- // so that when there is an ambiguity, the first one will be used:
- // System.Globalization.CultureNotFoundException
- // comes before
- // System.Globalization.*
- //
- // although System.Globalization.CultureNotFoundException matches both records, the first
- // is the one that will be used
- const PredefinedAgility *p = agility;
- while (p->name != NULL)
- {
- SIZE_T length = strlen(pszNamespace);
- if (strncmp(pszNamespace, p->name, length) == 0
- && (strcmp(pszName, p->name + length + 1) == 0
- || strcmp("*", p->name + length + 1) == 0))
- {
- *pfIsAgile = p->isAgile;
- *pfCheckAgile = p->checkAgile;
- return;
- }
-
- p++;
- }
-
- // Perhaps we have a nested type like 'bucket' that is supposed to be
- // agile or checked agile by virtue of being enclosed in a type like
- // hashtable, which is itself inside "System.Collections".
- tdEnclosing = mdTypeDefNil;
- hr = pModule->GetMDImport()->GetNestedClassProps(td, &tdEnclosing);
- if (SUCCEEDED(hr))
- {
- BAD_FORMAT_NOTHROW_ASSERT(tdEnclosing != td && TypeFromToken(tdEnclosing) == mdtTypeDef);
- td = tdEnclosing;
- }
- else
- break;
- }
- }
-
- *pfIsAgile = FALSE;
- *pfCheckAgile = FALSE;
-}
-
-//*******************************************************************************
-void EEClass::SetAppDomainAgileAttribute(MethodTable * pMT)
-{
- CONTRACTL
- {
- THROWS;
- GC_TRIGGERS;
- INJECT_FAULT(COMPlusThrowOM());
- // PRECONDITION(!IsAppDomainAgilityDone());
- }
- CONTRACTL_END
-
- EEClass * pClass = pMT->GetClass();
-
- //
- // The most general case for provably a agile class is
- // (1) No instance fields of non-sealed or non-agile types
- // (2) Class is in system domain (its type must be not unloadable
- // & loaded in all app domains)
- // (3) The class can't have a finalizer
- // (4) The class can't be a COMClass
- //
-
- _ASSERTE(!pClass->IsAppDomainAgilityDone());
-
- BOOL fCheckAgile = FALSE;
- BOOL fAgile = FALSE;
- BOOL fFieldsAgile = TRUE;
- WORD nFields = 0;
-
- if (!pMT->GetModule()->IsSystem())
- {
- //
- // No types outside of the system domain can even think about
- // being agile
- //
-
- goto exit;
- }
-
- if (pMT->IsComObjectType())
- {
- //
- // No COM type is agile, as there is domain specific stuff in the sync block
- //
-
- goto exit;
- }
-
- if (pMT->IsInterface())
- {
- //
- // Don't mark interfaces agile
- //
-
- goto exit;
- }
-
- if (pMT->ContainsGenericVariables())
- {
- // Types containing formal type parameters aren't agile
- goto exit;
- }
-
- //
- // See if we need agile checking in the class
- //
-
- GetPredefinedAgility(pMT->GetModule(), pMT->GetCl(),
- &fAgile, &fCheckAgile);
-
- if (pMT->HasFinalizer())
- {
- if (!fAgile && !fCheckAgile)
- {
- //
- // If we're finalizable, we need domain affinity. Otherwise, we may appear
- // to a particular app domain not to call the finalizer (since it may run
- // in a different domain.)
- //
- // Note: do not change this assumption. The eager finalizaton code for
- // appdomain unloading assumes that no obects other than those in mscorlib
- // can be agile and finalizable
- //
- goto exit;
- }
- else
- {
-
- // Note that a finalizable object will be considered potentially agile if it has one of the two
- // predefined agility bits set. This will cause an assert in the eager finalization code if you add
- // a finalizer to such a class - we don't want to have them as we can't run them eagerly and running
- // them after we've cleared the roots/handles means it can't do much safely. Right now thread is the
- // only one we allow.
- _ASSERTE(g_pThreadClass == NULL || pMT->IsAgileAndFinalizable());
- }
- }
-
- //
- // Now see if the type is "naturally agile" - that is, it's type structure
- // guarantees agility.
- //
-
- if (pMT->GetParentMethodTable() != NULL)
- {
- EEClass * pParentClass = pMT->GetParentMethodTable()->GetClass();
-
- //
- // Make sure our parent was computed. This should only happen
- // when we are prejitting - otherwise it is computed for each
- // class as its loaded.
- //
-
- _ASSERTE(pParentClass->IsAppDomainAgilityDone());
-
- if (!pParentClass->IsAppDomainAgile())
- {
- fFieldsAgile = FALSE;
- if (fCheckAgile)
- _ASSERTE(pParentClass->IsCheckAppDomainAgile());
- }
-
- //
- // To save having to list a lot of trivial (layout-wise) subclasses,
- // automatically check a subclass if its parent is checked and
- // it introduces no new fields.
- //
-
- if (!fCheckAgile
- && pParentClass->IsCheckAppDomainAgile()
- && pClass->GetNumInstanceFields() == pParentClass->GetNumInstanceFields())
- fCheckAgile = TRUE;
- }
-
- nFields = pMT->GetNumInstanceFields()
- - (pMT->GetParentMethodTable() == NULL ? 0 : pMT->GetParentMethodTable()->GetNumInstanceFields());
-
- if (fFieldsAgile || fCheckAgile)
- {
- FieldDesc *pFD = pClass->GetFieldDescList();
- FieldDesc *pFDEnd = pFD + nFields;
- while (pFD < pFDEnd)
- {
- switch (pFD->GetFieldType())
- {
- case ELEMENT_TYPE_CLASS:
- {
- //
- // There is a bit of a problem in computing the classes which are naturally agile -
- // we don't want to load types of non-value type fields. So for now we'll
- // err on the side of conservatism and not allow any non-value type fields other than
- // the forced agile types listed above.
- //
-
- MetaSig sig(pFD);
- CorElementType type = sig.NextArg();
- SigPointer sigPtr = sig.GetArgProps();
-
- //
- // Don't worry about strings
- //
-
- if (type == ELEMENT_TYPE_STRING)
- break;
-
- // Find our field's token so we can proceed cautiously
- mdToken token = mdTokenNil;
-
- if (type == ELEMENT_TYPE_CLASS)
- IfFailThrow(sigPtr.GetToken(&token));
-
- //
- // First, a special check to see if the field is of our own type.
- //
-
- if (token == pMT->GetCl() && pMT->IsSealed())
- break;
-
- //
- // Now, look for the field's TypeHandle.
- //
- // <TODO>@todo: there is some ifdef'd code here to to load the type if it's
- // not already loading. This code has synchronization problems, as well
- // as triggering more aggressive loading than normal. So it's disabled
- // for now.
- // </TODO>
-
- TypeHandle th;
-#if 0
- if (TypeFromToken(token) == mdTypeDef
- && GetClassLoader()->FindUnresolvedClass(GetModule, token) == NULL)
- th = pFD->GetFieldTypeHandleThrowing();
- else
-#endif // 0
- th = pFD->LookupFieldTypeHandle();
-
- //
- // See if the referenced type is agile. Note that there is a reasonable
- // chance that the type hasn't been loaded yet. If this is the case,
- // we just have to assume that it's not agile, since we can't trigger
- // extra loads here (for fear of circular recursion.)
- //
- // If you have an agile class which runs into this problem, you can solve it by
- // setting the type manually to be agile.
- //
-
- if (th.IsNull()
- || !th.IsAppDomainAgile()
- || (!th.IsTypeDesc()
- && !th.AsMethodTable()->IsSealed()))
- {
- //
- // Treat the field as non-agile.
- //
-
- fFieldsAgile = FALSE;
- if (fCheckAgile)
- pFD->SetDangerousAppDomainAgileField();
- }
- }
-
- break;
-
- case ELEMENT_TYPE_VALUETYPE:
- {
- TypeHandle th;
-
- {
- // Loading a non-self-ref valuetype field.
- OVERRIDE_TYPE_LOAD_LEVEL_LIMIT(CLASS_LOADED);
-
- th = pFD->GetApproxFieldTypeHandleThrowing();
- }
-
- _ASSERTE(!th.IsNull());
-
- if (!th.IsAppDomainAgile())
- {
- fFieldsAgile = FALSE;
- if (fCheckAgile)
- pFD->SetDangerousAppDomainAgileField();
- }
- }
-
- break;
-
- default:
- break;
- }
-
- pFD++;
- }
- }
-
- if (fFieldsAgile || fAgile)
- pClass->SetAppDomainAgile();
-
- if (fCheckAgile && !fFieldsAgile)
- pClass->SetCheckAppDomainAgile();
-
-exit:
- LOG((LF_CLASSLOADER, LL_INFO1000, "CLASSLOADER: AppDomainAgileAttribute for %s is %d\n", pClass->GetDebugClassName(), pClass->IsAppDomainAgile()));
- pClass->SetAppDomainAgilityDone();
-}
-#endif // defined(_DEBUG)
-
//*******************************************************************************
//
// Debugger notification
diff --git a/src/vm/class.h b/src/vm/class.h
index 7533e9c02c..58b0c01e80 100644
--- a/src/vm/class.h
+++ b/src/vm/class.h
@@ -1796,100 +1796,8 @@ public:
#if defined(_DEBUG)
public:
enum{
- AUXFLAG_APP_DOMAIN_AGILE = 0x00000001,
- AUXFLAG_CHECK_APP_DOMAIN_AGILE = 0x00000002,
- AUXFLAG_APP_DOMAIN_AGILITY_DONE = 0x00000004,
- AUXFLAG_DESTROYED = 0x00000008, // The Destruct() method has already been called on this class
+ AUXFLAG_DESTROYED = 0x00000008, // The Destruct() method has already been called on this class
};
-
- inline DWORD GetAuxFlagsRaw()
- {
- LIMITED_METHOD_CONTRACT;
- return m_wAuxFlags;
- }
- inline DWORD* GetAuxFlagsPtr()
- {
- LIMITED_METHOD_CONTRACT;
- return (DWORD*)(&m_wAuxFlags);
- }
- inline void SetAuxFlags(DWORD flag)
- {
- LIMITED_METHOD_CONTRACT;
- m_wAuxFlags |= (WORD)flag;
- }
-
- // This flag is set (in a checked build only?) for classes whose
- // instances are always app domain agile. This can
- // be either because of type system guarantees or because
- // the class is explicitly marked.
- inline BOOL IsAppDomainAgile()
- {
- LIMITED_METHOD_CONTRACT;
- return (m_wAuxFlags & AUXFLAG_APP_DOMAIN_AGILE);
- }
- inline void SetAppDomainAgile()
- {
- LIMITED_METHOD_CONTRACT;
- m_wAuxFlags |= AUXFLAG_APP_DOMAIN_AGILE;
- }
- // This flag is set in a checked build for classes whose
- // instances may be marked app domain agile, but agility
- // isn't guaranteed by type safety. The JIT will compile
- // in extra checks to field assignment on some fields
- // in such a class.
- inline BOOL IsCheckAppDomainAgile()
- {
- LIMITED_METHOD_CONTRACT;
- return (m_wAuxFlags & AUXFLAG_CHECK_APP_DOMAIN_AGILE);
- }
-
- inline void SetCheckAppDomainAgile()
- {
- LIMITED_METHOD_CONTRACT;
- m_wAuxFlags |= AUXFLAG_CHECK_APP_DOMAIN_AGILE;
- }
-
- // This flag is set in a checked build to indicate that the
- // appdomain agility for a class had been set. This is used
- // for debugging purposes to make sure that we don't allocate
- // an object before the agility is set.
- inline BOOL IsAppDomainAgilityDone()
- {
- LIMITED_METHOD_CONTRACT;
- return (m_wAuxFlags & AUXFLAG_APP_DOMAIN_AGILITY_DONE);
- }
- inline void SetAppDomainAgilityDone()
- {
- LIMITED_METHOD_CONTRACT;
- m_wAuxFlags |= AUXFLAG_APP_DOMAIN_AGILITY_DONE;
- }
- //
- // This predicate checks whether or not the class is "naturally"
- // app domain agile - that is:
- // (1) it is in the system domain
- // (2) all the fields are app domain agile
- // (3) it has no finalizer
- //
- // Or, this also returns true for a proxy type which is allowed
- // to have cross app domain refs.
- //
- inline BOOL IsTypesafeAppDomainAgile()
- {
- LIMITED_METHOD_CONTRACT;
- return IsAppDomainAgile() && !IsCheckAppDomainAgile();
- }
- //
- // This predictate tests whether any instances are allowed
- // to be app domain agile.
- //
- inline BOOL IsNeverAppDomainAgile()
- {
- LIMITED_METHOD_CONTRACT;
- return !IsAppDomainAgile() && !IsCheckAppDomainAgile();
- }
- static void SetAppDomainAgileAttribute(MethodTable * pMT);
-
- static void GetPredefinedAgility(Module *pModule, mdTypeDef td, BOOL *pfIsAgile, BOOL *pfIsCheckAgile);
#endif // defined(_DEBUG)
//-------------------------------------------------------------
diff --git a/src/vm/field.h b/src/vm/field.h
index 8d5b17fb71..4962fce618 100644
--- a/src/vm/field.h
+++ b/src/vm/field.h
@@ -80,9 +80,6 @@ class FieldDesc
#endif
#ifdef _DEBUG
- struct {
- unsigned m_isDangerousAppDomainAgileField : 1;
- };
LPUTF8 m_debugName;
#endif
@@ -106,8 +103,6 @@ public:
m_type = sourceField.m_type;
#ifdef _DEBUG
- m_isDangerousAppDomainAgileField = sourceField.m_isDangerousAppDomainAgileField;
-
m_debugName = sourceField.m_debugName;
#endif // _DEBUG
}
@@ -313,22 +308,6 @@ public:
);
}
-#if defined(_DEBUG)
- BOOL IsDangerousAppDomainAgileField()
- {
- LIMITED_METHOD_CONTRACT;
-
- return m_isDangerousAppDomainAgileField;
- }
-
- void SetDangerousAppDomainAgileField()
- {
- LIMITED_METHOD_CONTRACT;
-
- m_isDangerousAppDomainAgileField = TRUE;
- }
-#endif
-
BOOL IsRVA() const // Has an explicit RVA associated with it
{
LIMITED_METHOD_DAC_CONTRACT;
diff --git a/src/vm/methodtablebuilder.cpp b/src/vm/methodtablebuilder.cpp
index bbed188b62..63ea7a107d 100644
--- a/src/vm/methodtablebuilder.cpp
+++ b/src/vm/methodtablebuilder.cpp
@@ -1920,13 +1920,6 @@ MethodTableBuilder::BuildMethodTableThrowing(
SetFinalizationSemantics();
-#if defined(_DEBUG)
- // Figure out if we're domain agile..
- // Note that this checks a bunch of field directly on the class & method table,
- // so it needs to come late in the game.
- EEClass::SetAppDomainAgileAttribute(pMT);
-#endif
-
// Allocate dynamic slot if necessary
if (bmtProp->fDynamicStatics)
{
diff --git a/src/vm/methodtablebuilder.h b/src/vm/methodtablebuilder.h
index 3054432c35..a2275af24f 100644
--- a/src/vm/methodtablebuilder.h
+++ b/src/vm/methodtablebuilder.h
@@ -230,7 +230,6 @@ private:
BOOL HasExplicitSize() { WRAPPER_NO_CONTRACT; return GetHalfBakedClass()->HasExplicitSize(); }
#ifdef _DEBUG
- BOOL IsAppDomainAgilityDone() { WRAPPER_NO_CONTRACT; return GetHalfBakedClass()->IsAppDomainAgilityDone(); }
LPCUTF8 GetDebugClassName() { WRAPPER_NO_CONTRACT; return GetHalfBakedClass()->GetDebugClassName(); }
#endif // _DEBUG
Assembly *GetAssembly() { WRAPPER_NO_CONTRACT; return GetModule()->GetAssembly(); }
diff --git a/src/vm/typehandle.cpp b/src/vm/typehandle.cpp
index c8c6362dd6..405be60543 100644
--- a/src/vm/typehandle.cpp
+++ b/src/vm/typehandle.cpp
@@ -1442,101 +1442,6 @@ OBJECTREF TypeHandle::GetManagedClassObjectFast() const
#endif // #ifndef DACCESS_COMPILE
-#if defined(_DEBUG)
-
-BOOL TypeHandle::IsAppDomainAgile() const
-{
- LIMITED_METHOD_CONTRACT;
-
- if (!IsTypeDesc())
- {
- MethodTable *pMT = AsMethodTable();
- return pMT->GetClass()->IsAppDomainAgile();
- }
- else if (IsArray())
- {
- TypeHandle th = AsArray()->GetArrayElementTypeHandle();
- return th.IsArrayOfElementsAppDomainAgile();
- }
- else
- {
- // <TODO>@todo: consider other types of type handles agile?</TODO>
- return FALSE;
- }
-}
-
-BOOL TypeHandle::IsCheckAppDomainAgile() const
-{
- LIMITED_METHOD_CONTRACT;
-
- if (!IsTypeDesc())
- {
- MethodTable *pMT = AsMethodTable();
- return pMT->GetClass()->IsCheckAppDomainAgile();
- }
- else if (IsArray())
- {
- TypeHandle th = AsArray()->GetArrayElementTypeHandle();
- return th.IsArrayOfElementsCheckAppDomainAgile();
- }
- else
- {
- // <TODO>@todo: consider other types of type handles agile?</TODO>
- return FALSE;
- }
-}
-
-BOOL TypeHandle::IsArrayOfElementsAppDomainAgile() const
-{
- LIMITED_METHOD_CONTRACT;
-
- if (!IsTypeDesc())
- {
- MethodTable *pMT = AsMethodTable();
- return (pMT->GetClass()->IsSealed()) && pMT->GetClass()->IsAppDomainAgile();
- }
- else
- if (IsArray())
- {
- return AsArray()->GetArrayElementTypeHandle().IsArrayOfElementsAppDomainAgile();
- }
- else
- {
- // I'm not sure how to prove a typedesc is sealed, so
- // just bail and return FALSE here rather than recursing.
-
- return FALSE;
- }
-}
-
-BOOL TypeHandle::IsArrayOfElementsCheckAppDomainAgile() const
-{
- LIMITED_METHOD_CONTRACT;
-
- if (!IsTypeDesc())
- {
- MethodTable *pMT = AsMethodTable();
- return (pMT->GetClass()->IsAppDomainAgile()
- && (pMT->GetClass()->IsSealed()) == 0)
- || pMT->GetClass()->IsCheckAppDomainAgile();
- }
- else
- if (IsArray())
- {
- return AsArray()->GetArrayElementTypeHandle().IsArrayOfElementsCheckAppDomainAgile();
- }
- else
- {
- // I'm not sure how to prove a typedesc is sealed, so
- // just bail and return FALSE here rather than recursing.
-
- return FALSE;
- }
-}
-
-#endif // defined(_DEBUG)
-
-
BOOL TypeHandle::IsByRef() const
{
LIMITED_METHOD_CONTRACT;
diff --git a/src/vm/typehandle.h b/src/vm/typehandle.h
index 5cb9eaa7a6..c8f0747d6a 100644
--- a/src/vm/typehandle.h
+++ b/src/vm/typehandle.h
@@ -574,14 +574,6 @@ public:
INDEBUGIMPL(BOOL Verify();) // DEBUGGING Make certain this is a valid type handle
-#if defined(_DEBUG)
- BOOL IsAppDomainAgile() const;
- BOOL IsCheckAppDomainAgile() const;
-
- BOOL IsArrayOfElementsAppDomainAgile() const;
- BOOL IsArrayOfElementsCheckAppDomainAgile() const;
-#endif
-
#ifdef DACCESS_COMPILE
void EnumMemoryRegions(CLRDataEnumMemoryFlags flags);
#endif