Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/coreclr/inc/clrconfigvalues.h
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,6 @@ CONFIG_DWORD_INFO(INTERNAL_NestedEhOom, W("NestedEhOom"), 0, "")
#define INTERNAL_NoGuiOnAssert_Default 1
RETAIL_CONFIG_DWORD_INFO(INTERNAL_NoGuiOnAssert, W("NoGuiOnAssert"), INTERNAL_NoGuiOnAssert_Default, "")
RETAIL_CONFIG_DWORD_INFO(EXTERNAL_NoProcedureSplitting, W("NoProcedureSplitting"), 0, "")
CONFIG_DWORD_INFO(INTERNAL_NoStringInterning, W("NoStringInterning"), 1, "Disallows string interning. I see no value in it anymore.")
CONFIG_DWORD_INFO(INTERNAL_PauseOnLoad, W("PauseOnLoad"), 0, "Stops in SystemDomain::init. I think it can be removed.")
CONFIG_DWORD_INFO(INTERNAL_PerfAllocsSizeThreshold, W("PerfAllocsSizeThreshold"), 0x3FFFFFFF, "Log facility LF_GCALLOC logs object allocations. This flag controls which ones also log stacktraces. Predates ClrProfiler.")
CONFIG_DWORD_INFO(INTERNAL_PerfNumAllocsThreshold, W("PerfNumAllocsThreshold"), 0x3FFFFFFF, "Log facility LF_GCALLOC logs object allocations. This flag controls which ones also log stacktraces. Predates ClrProfiler.")
Expand Down
11 changes: 0 additions & 11 deletions src/coreclr/inc/corhdr.h
Original file line number Diff line number Diff line change
Expand Up @@ -1683,17 +1683,6 @@ typedef enum CorAttributeTargets
#define DEBUGGABLE_ATTRIBUTE_TYPE_NAME "DebuggableAttribute"


// Keep in sync with CompilationRelaxations.cs
typedef enum CompilationRelaxationsEnum
{
CompilationRelaxations_NoStringInterning = 0x0008,

} CompilationRelaxationEnum;

#define COMPILATIONRELAXATIONS_TYPE_W W("System.Runtime.CompilerServices.CompilationRelaxationsAttribute")
#define COMPILATIONRELAXATIONS_TYPE "System.Runtime.CompilerServices.CompilationRelaxationsAttribute"


// Keep in sync with RuntimeCompatibilityAttribute.cs
#define RUNTIMECOMPATIBILITY_TYPE_W W("System.Runtime.CompilerServices.RuntimeCompatibilityAttribute")
#define RUNTIMECOMPATIBILITY_TYPE "System.Runtime.CompilerServices.RuntimeCompatibilityAttribute"
Expand Down
4 changes: 0 additions & 4 deletions src/coreclr/inc/corinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -931,10 +931,6 @@ enum CorInfoInline
enum CorInfoInlineRestrictions
{
INLINE_RESPECT_BOUNDARY = 0x00000001, // You can inline if there are no calls from the method being inlined
INLINE_NO_CALLEE_LDSTR = 0x00000002, // You can inline only if you guarantee that if inlinee does an ldstr
// inlinee's module will never see that string (by any means).
// This is due to how we implement the NoStringInterningAttribute
// (by reusing the fixup table).
INLINE_SAME_THIS = 0x00000004, // You can inline only if the callee is on the same this reference as caller
};

Expand Down
13 changes: 1 addition & 12 deletions src/coreclr/jit/importer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12216,20 +12216,9 @@ void Compiler::impImportBlockCode(BasicBlock* block)
break;

case CEE_LDSTR:

if (compIsForInlining())
{
if (impInlineInfo->inlineCandidateInfo->dwRestrictions & INLINE_NO_CALLEE_LDSTR)
{
compInlineResult->NoteFatal(InlineObservation::CALLSITE_HAS_LDSTR_RESTRICTION);
return;
}
}

val = getU4LittleEndian(codeAddr);
JITDUMP(" %08X", val);
impPushOnStack(gtNewSconNode(val, info.compScopeHnd), tiRetVal);

break;

case CEE_LDARG:
Expand Down Expand Up @@ -19139,7 +19128,7 @@ void Compiler::impCheckCanInline(GenTreeCall* call,
}

// check for unsupported inlining restrictions
assert((dwRestrictions & ~(INLINE_RESPECT_BOUNDARY | INLINE_NO_CALLEE_LDSTR | INLINE_SAME_THIS)) == 0);
assert((dwRestrictions & ~(INLINE_RESPECT_BOUNDARY | INLINE_SAME_THIS)) == 0);

if (dwRestrictions & INLINE_SAME_THIS)
{
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/jit/inline.def
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ INLINE_OBSERVATION(EXPLICIT_TAIL_PREFIX, bool, "explicit tail prefix",
INLINE_OBSERVATION(GENERIC_DICTIONARY_LOOKUP, bool, "runtime dictionary lookup", FATAL, CALLSITE)
INLINE_OBSERVATION(HAS_CALL_VIA_LDVIRTFTN, bool, "call via ldvirtftn", FATAL, CALLSITE)
INLINE_OBSERVATION(HAS_COMPLEX_HANDLE, bool, "complex handle access", FATAL, CALLSITE)
INLINE_OBSERVATION(HAS_LDSTR_RESTRICTION, bool, "has ldstr VM restriction", FATAL, CALLSITE)
INLINE_OBSERVATION(IMPLICIT_REC_TAIL_CALL, bool, "implicit recursive tail call", FATAL, CALLSITE)
INLINE_OBSERVATION(IS_CALL_TO_HELPER, bool, "target is helper", FATAL, CALLSITE)
INLINE_OBSERVATION(IS_NOT_DIRECT, bool, "target not direct", FATAL, CALLSITE)
Expand Down
4 changes: 0 additions & 4 deletions src/coreclr/tools/Common/JitInterface/CorInfoTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -501,10 +501,6 @@ public enum CorInfoInlineTypeCheckSource
public enum CorInfoInlineRestrictions
{
INLINE_RESPECT_BOUNDARY = 0x00000001, // You can inline if there are no calls from the method being inlined
INLINE_NO_CALLEE_LDSTR = 0x00000002, // You can inline only if you guarantee that if inlinee does an ldstr
// inlinee's module will never see that string (by any means).
// This is due to how we implement the NoStringInterningAttribute
// (by reusing the fixup table).
INLINE_SAME_THIS = 0x00000004, // You can inline only if the callee is on the same this reference as caller
}

Expand Down
71 changes: 1 addition & 70 deletions src/coreclr/vm/ceeload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1596,75 +1596,6 @@ InstrumentedILOffsetMapping Module::GetInstrumentedILOffsetMapping(mdMethodDef t

#ifndef DACCESS_COMPILE


BOOL Module::IsNoStringInterning()
{
CONTRACTL
{
THROWS;
GC_TRIGGERS;
}
CONTRACTL_END

if (!(m_dwPersistedFlags & COMPUTED_STRING_INTERNING))
{
// Default is string interning
BOOL fNoStringInterning = FALSE;

HRESULT hr;

IMDInternalImport *mdImport = GetAssembly()->GetMDImport();
_ASSERTE(mdImport);

mdToken token;
IfFailThrow(mdImport->GetAssemblyFromScope(&token));

const BYTE *pVal;
ULONG cbVal;

hr = mdImport->GetCustomAttributeByName(token,
COMPILATIONRELAXATIONS_TYPE,
(const void**)&pVal, &cbVal);

// Parse the attribute
if (hr == S_OK)
{
CustomAttributeParser cap(pVal, cbVal);
IfFailThrow(cap.SkipProlog());

// Get Flags
UINT32 flags;
IfFailThrow(cap.GetU4(&flags));

if (flags & CompilationRelaxations_NoStringInterning)
{
fNoStringInterning = TRUE;
}
}

#ifdef _DEBUG
static ConfigDWORD g_NoStringInterning;
DWORD dwOverride = g_NoStringInterning.val(CLRConfig::INTERNAL_NoStringInterning);

if (dwOverride == 0)
{
// Disabled
fNoStringInterning = FALSE;
}
else if (dwOverride == 2)
{
// Always true (testing)
fNoStringInterning = TRUE;
}
#endif // _DEBUG

FastInterlockOr(&m_dwPersistedFlags, COMPUTED_STRING_INTERNING |
(fNoStringInterning ? NO_STRING_INTERNING : 0));
}

return !!(m_dwPersistedFlags & NO_STRING_INTERNING);
}

BOOL Module::HasDefaultDllImportSearchPathsAttribute()
{
CONTRACTL
Expand Down Expand Up @@ -3102,7 +3033,7 @@ void Module::InitializeStringData(DWORD token, EEStringData *pstrData, CQuickByt
}


OBJECTHANDLE Module::ResolveStringRef(DWORD token, BaseDomain *pDomain, bool bNeedToSyncWithFixups)
OBJECTHANDLE Module::ResolveStringRef(DWORD token, BaseDomain *pDomain)
{
CONTRACTL
{
Expand Down
14 changes: 3 additions & 11 deletions src/coreclr/vm/ceeload.h
Original file line number Diff line number Diff line change
Expand Up @@ -805,9 +805,8 @@ class Module
// unused = 0x00000001,
COMPUTED_GLOBAL_CLASS = 0x00000002,

// This flag applies to assembly, but it is stored so it can be cached in ngen image
COMPUTED_STRING_INTERNING = 0x00000004,
NO_STRING_INTERNING = 0x00000008,
// unused = 0x00000004,
// unused = 0x00000008,

// This flag applies to assembly, but it is stored so it can be cached in ngen image
COMPUTED_WRAP_EXCEPTIONS = 0x00000010,
Expand Down Expand Up @@ -1400,7 +1399,7 @@ class Module
void InitializeStringData(DWORD token, EEStringData *pstrData, CQuickBytes *pqb);

// Resolving
OBJECTHANDLE ResolveStringRef(DWORD Token, BaseDomain *pDomain, bool bNeedToSyncWithFixups);
OBJECTHANDLE ResolveStringRef(DWORD Token, BaseDomain *pDomain);

CHECK CheckStringRef(RVA rva);

Expand Down Expand Up @@ -2024,13 +2023,6 @@ class Module


public:
//-----------------------------------------------------------------------------------------
// If true, strings only need to be interned at a per module basis, instead of at a
// per appdomain basis, which is the default. Use the module accessor so you don't need
// to touch the metadata in the ngen case
//-----------------------------------------------------------------------------------------
BOOL IsNoStringInterning();

//-----------------------------------------------------------------------------------------
// Returns a BOOL to indicate if we have computed whether compiler has instructed us to
// wrap the non-CLS compliant exceptions or not.
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/jithelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2433,7 +2433,7 @@ OBJECTHANDLE ConstructStringLiteral(CORINFO_MODULE_HANDLE scopeHnd, mdToken meta
_ASSERTE(TypeFromToken(metaTok) == mdtString);

Module* module = GetModule(scopeHnd);
return module->ResolveStringRef(metaTok, module->GetAssembly()->Parent(), false);
return module->ResolveStringRef(metaTok, module->GetAssembly()->Parent());
}

/*********************************************************************/
Expand Down
24 changes: 1 addition & 23 deletions src/coreclr/vm/jitinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7609,23 +7609,6 @@ CorInfoInline CEEInfo::canInline (CORINFO_METHOD_HANDLE hCaller,
}
}

//
// Perform the Cross-Assembly inlining checks
//
{
Module * pCalleeModule = pCallee->GetModule();

// TODO: We can probably be smarter here if the caller is jitted, as we will
// know for sure if the inlinee has really no string interning active (currently
// it's only on in the ngen case (besides requiring the attribute)), but this is getting
// too subtle. Will only do if somebody screams about it, as bugs here are going to
// be tough to find
if ((pOrigCallerModule != pCalleeModule) && pCalleeModule->IsNoStringInterning())
{
dwRestrictions |= INLINE_NO_CALLEE_LDSTR;
}
}

#ifdef PROFILING_SUPPORTED
if (CORProfilerPresent())
{
Expand Down Expand Up @@ -13186,12 +13169,7 @@ BOOL LoadDynamicInfoEntry(Module *currentModule,
return TRUE;
}

// For generic instantiations compiled into the ngen image of some other
// client assembly, we need to ensure that we intern the string
// in the defining assembly.
bool mayNeedToSyncWithFixups = pInfoModule != currentModule;

result = (size_t) pInfoModule->ResolveStringRef(TokenFromRid(rid, mdtString), currentModule->GetDomain(), mayNeedToSyncWithFixups);
result = (size_t) pInfoModule->ResolveStringRef(TokenFromRid(rid, mdtString), currentModule->GetDomain());
}
}
break;
Expand Down