Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
17 changes: 2 additions & 15 deletions src/coreclr/inc/corinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -928,16 +928,6 @@ enum CorInfoInline
INLINE_NEVER = -2, // This method should never be inlined, regardless of context
};

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
};

enum CorInfoInlineTypeCheck
{
CORINFO_INLINE_TYPECHECK_NONE = 0x00000000, // It's not okay to compare type's vtable with a native type handle
Expand Down Expand Up @@ -1997,18 +1987,15 @@ class ICorStaticInfo
) = 0;

// Decides if you have any limitations for inlining. If everything's OK, it will return
// INLINE_PASS and will fill out pRestrictions with a mask of restrictions the caller of this
// function must respect. If caller passes pRestrictions = NULL, if there are any restrictions
// INLINE_FAIL will be returned
// INLINE_PASS.
//
// The callerHnd must be the immediate caller (i.e. when we have a chain of inlined calls)
//
// The inlined method need not be verified

virtual CorInfoInline canInline (
CORINFO_METHOD_HANDLE callerHnd, /* IN */
CORINFO_METHOD_HANDLE calleeHnd, /* IN */
uint32_t* pRestrictions /* OUT */
CORINFO_METHOD_HANDLE calleeHnd /* IN */
) = 0;

// Reports whether or not a method can be inlined, and why. canInline is responsible for reporting all
Expand Down
3 changes: 1 addition & 2 deletions src/coreclr/inc/icorjitinfoimpl_generated.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ bool getMethodInfo(

CorInfoInline canInline(
CORINFO_METHOD_HANDLE callerHnd,
CORINFO_METHOD_HANDLE calleeHnd,
uint32_t* pRestrictions) override;
CORINFO_METHOD_HANDLE calleeHnd) override;

void reportInliningDecision(
CORINFO_METHOD_HANDLE inlinerHnd,
Expand Down
10 changes: 5 additions & 5 deletions src/coreclr/inc/jiteeversionguid.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ typedef const GUID *LPCGUID;
#define GUID_DEFINED
#endif // !GUID_DEFINED

constexpr GUID JITEEVersionIdentifier = { /* 323185e9-208a-4b35-a413-23f9aac2d5f7 */
0x323185e9,
0x208a,
0x4b35,
{0xa4, 0x13, 0x23, 0xf9, 0xaa, 0xc2, 0xd5, 0xf7}
constexpr GUID JITEEVersionIdentifier = { /* ccb0c159-04b3-47f6-993e-79114c9cbef8 */
0xccb0c159,
0x04b3,
0x47f6,
{0x99, 0x3e, 0x79, 0x11, 0x4c, 0x9c, 0xbe, 0xf8}
};

//////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
5 changes: 2 additions & 3 deletions src/coreclr/jit/ICorJitInfo_API_wrapper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,10 @@ bool WrapICorJitInfo::getMethodInfo(

CorInfoInline WrapICorJitInfo::canInline(
CORINFO_METHOD_HANDLE callerHnd,
CORINFO_METHOD_HANDLE calleeHnd,
uint32_t* pRestrictions)
CORINFO_METHOD_HANDLE calleeHnd)
{
API_ENTER(canInline);
CorInfoInline temp = wrapHnd->canInline(callerHnd, calleeHnd, pRestrictions);
CorInfoInline temp = wrapHnd->canInline(callerHnd, calleeHnd);
API_LEAVE(canInline);
return temp;
}
Expand Down
62 changes: 1 addition & 61 deletions src/coreclr/jit/importer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8645,9 +8645,6 @@ var_types Compiler::impImportCall(OPCODE opcode,
opcodeNames[opcode], callInfo->kind, varTypeName(callRetTyp), structSize);
}
#endif
// This should be checked in impImportBlockCode.
assert(!compIsForInlining() || !(impInlineInfo->inlineCandidateInfo->dwRestrictions & INLINE_RESPECT_BOUNDARY));

sig = &calliSig;
}
else // (opcode != CEE_CALLI)
Expand Down Expand Up @@ -8677,14 +8674,6 @@ var_types Compiler::impImportCall(OPCODE opcode,
#endif
if (compIsForInlining())
{
/* Does this call site have security boundary restrictions? */

if (impInlineInfo->inlineCandidateInfo->dwRestrictions & INLINE_RESPECT_BOUNDARY)
{
compInlineResult->NoteFatal(InlineObservation::CALLSITE_CROSS_BOUNDARY_SECURITY);
return TYP_UNDEF;
}

/* Does the inlinee use StackCrawlMark */

if (mflags & CORINFO_FLG_DONT_INLINE_CALLER)
Expand Down Expand Up @@ -12216,20 +12205,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 @@ -14460,16 +14438,6 @@ void Compiler::impImportBlockCode(BasicBlock* block)
eeGetCallInfo(&resolvedToken, nullptr /* constraint typeRef*/,
combine(CORINFO_CALLINFO_SECURITYCHECKS, CORINFO_CALLINFO_ALLOWINSTPARAM), &callInfo);

if (compIsForInlining())
{
if (impInlineInfo->inlineCandidateInfo->dwRestrictions & INLINE_RESPECT_BOUNDARY)
{
// Check to see if this call violates the boundary.
compInlineResult->NoteFatal(InlineObservation::CALLSITE_CROSS_BOUNDARY_SECURITY);
return;
}
}

mflags = callInfo.methodFlags;

if ((mflags & (CORINFO_FLG_STATIC | CORINFO_FLG_ABSTRACT)) != 0)
Expand Down Expand Up @@ -14659,16 +14627,6 @@ void Compiler::impImportBlockCode(BasicBlock* block)
/* CALLI does not respond to CONSTRAINED */
prefixFlags &= ~PREFIX_CONSTRAINED;

if (compIsForInlining())
{
// CALLI doesn't have a method handle, so assume the worst.
if (impInlineInfo->inlineCandidateInfo->dwRestrictions & INLINE_RESPECT_BOUNDARY)
{
compInlineResult->NoteFatal(InlineObservation::CALLSITE_CROSS_BOUNDARY_CALLI);
return;
}
}

FALLTHROUGH;

case CEE_CALLVIRT:
Expand Down Expand Up @@ -19063,7 +19021,6 @@ void Compiler::impCheckCanInline(GenTreeCall* call,

bool success = eeRunWithErrorTrap<Param>(
[](Param* pParam) {
uint32_t dwRestrictions = 0;
CorInfoInitClassResult initClassResult;

#ifdef DEBUG
Expand Down Expand Up @@ -19119,8 +19076,7 @@ void Compiler::impCheckCanInline(GenTreeCall* call,

/* VM Inline check also ensures that the method is verifiable if needed */
CorInfoInline vmResult;
vmResult = pParam->pThis->info.compCompHnd->canInline(pParam->pThis->info.compMethodHnd, pParam->fncHandle,
&dwRestrictions);
vmResult = pParam->pThis->info.compCompHnd->canInline(pParam->pThis->info.compMethodHnd, pParam->fncHandle);

if (vmResult == INLINE_FAIL)
{
Expand All @@ -19138,21 +19094,6 @@ void Compiler::impCheckCanInline(GenTreeCall* call,
goto _exit;
}

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

if (dwRestrictions & INLINE_SAME_THIS)
{
GenTree* thisArg = pParam->call->AsCall()->gtCallThisArg->GetNode();
assert(thisArg);

if (!pParam->pThis->impIsThis(thisArg))
{
pParam->result->NoteFatal(InlineObservation::CALLSITE_REQUIRES_SAME_THIS);
goto _exit;
}
}

/* Get the method properties */

CORINFO_CLASS_HANDLE clsHandle;
Expand Down Expand Up @@ -19204,7 +19145,6 @@ void Compiler::impCheckCanInline(GenTreeCall* call,
pInfo->clsHandle = clsHandle;
pInfo->exactContextHnd = pParam->exactContextHnd;
pInfo->retExpr = nullptr;
pInfo->dwRestrictions = dwRestrictions;
pInfo->preexistingSpillTemp = BAD_VAR_NUM;
pInfo->clsAttr = clsAttr;
pInfo->methAttr = pParam->methAttr;
Expand Down
4 changes: 0 additions & 4 deletions src/coreclr/jit/inline.def
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,11 @@ INLINE_OBSERVATION(CANT_EMBED_VARARGS_COOKIE, bool, "can't embed varargs cooki
INLINE_OBSERVATION(CANT_CLASS_INIT, bool, "can't class init", FATAL, CALLSITE)
INLINE_OBSERVATION(COMPILATION_ERROR, bool, "compilation error", FATAL, CALLSITE)
INLINE_OBSERVATION(COMPILATION_FAILURE, bool, "failed to compile", FATAL, CALLSITE)
INLINE_OBSERVATION(CROSS_BOUNDARY_CALLI, bool, "cross-boundary calli", FATAL, CALLSITE)
INLINE_OBSERVATION(CROSS_BOUNDARY_SECURITY, bool, "cross-boundary security check", FATAL, CALLSITE)
INLINE_OBSERVATION(EXCEEDS_THRESHOLD, bool, "exceeds profit threshold", FATAL, CALLSITE)
INLINE_OBSERVATION(EXPLICIT_TAIL_PREFIX, bool, "explicit tail prefix", FATAL, CALLSITE)
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 All @@ -162,7 +159,6 @@ INLINE_OBSERVATION(OVER_BUDGET, bool, "inline exceeds budget",
INLINE_OBSERVATION(OVER_INLINE_LIMIT, bool, "limited by JitInlineLimit", FATAL, CALLSITE)
INLINE_OBSERVATION(PIN_IN_TRY_REGION, bool, "within try region, pinned", FATAL, CALLSITE)
INLINE_OBSERVATION(RANDOM_REJECT, bool, "random reject", FATAL, CALLSITE)
INLINE_OBSERVATION(REQUIRES_SAME_THIS, bool, "requires same this", FATAL, CALLSITE)
INLINE_OBSERVATION(RETURN_TYPE_MISMATCH, bool, "return type mismatch", FATAL, CALLSITE)
INLINE_OBSERVATION(STFLD_NEEDS_HELPER, bool, "stfld needs helper", FATAL, CALLSITE)
INLINE_OBSERVATION(TOO_MANY_LOCALS, bool, "too many locals", FATAL, CALLSITE)
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/jit/inline.h
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,6 @@ struct InlineCandidateInfo : public GuardedDevirtualizationCandidateInfo
CORINFO_CLASS_HANDLE clsHandle;
CORINFO_CONTEXT_HANDLE exactContextHnd;
GenTree* retExpr;
DWORD dwRestrictions;
unsigned preexistingSpillTemp;
unsigned clsAttr;
unsigned methAttr;
Expand Down
6 changes: 3 additions & 3 deletions src/coreclr/tools/Common/JitInterface/CorInfoBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ static byte _getMethodInfo(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHO
}

[UnmanagedCallersOnly]
static CorInfoInline _canInline(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* callerHnd, CORINFO_METHOD_STRUCT_* calleeHnd, uint* pRestrictions)
static CorInfoInline _canInline(IntPtr thisHandle, IntPtr* ppException, CORINFO_METHOD_STRUCT_* callerHnd, CORINFO_METHOD_STRUCT_* calleeHnd)
{
var _this = GetThis(thisHandle);
try
{
return _this.canInline(callerHnd, calleeHnd, ref *pRestrictions);
return _this.canInline(callerHnd, calleeHnd);
}
catch (Exception ex)
{
Expand Down Expand Up @@ -2559,7 +2559,7 @@ static IntPtr GetUnmanagedCallbacks()
callbacks[2] = (delegate* unmanaged<IntPtr, IntPtr*, CORINFO_METHOD_STRUCT_*, CorInfoMethodRuntimeFlags, void>)&_setMethodAttribs;
callbacks[3] = (delegate* unmanaged<IntPtr, IntPtr*, CORINFO_METHOD_STRUCT_*, CORINFO_SIG_INFO*, CORINFO_CLASS_STRUCT_*, void>)&_getMethodSig;
callbacks[4] = (delegate* unmanaged<IntPtr, IntPtr*, CORINFO_METHOD_STRUCT_*, CORINFO_METHOD_INFO*, byte>)&_getMethodInfo;
callbacks[5] = (delegate* unmanaged<IntPtr, IntPtr*, CORINFO_METHOD_STRUCT_*, CORINFO_METHOD_STRUCT_*, uint*, CorInfoInline>)&_canInline;
callbacks[5] = (delegate* unmanaged<IntPtr, IntPtr*, CORINFO_METHOD_STRUCT_*, CORINFO_METHOD_STRUCT_*, CorInfoInline>)&_canInline;
callbacks[6] = (delegate* unmanaged<IntPtr, IntPtr*, CORINFO_METHOD_STRUCT_*, CORINFO_METHOD_STRUCT_*, CorInfoInline, byte*, void>)&_reportInliningDecision;
callbacks[7] = (delegate* unmanaged<IntPtr, IntPtr*, CORINFO_METHOD_STRUCT_*, CORINFO_METHOD_STRUCT_*, CORINFO_METHOD_STRUCT_*, byte, byte>)&_canTailCall;
callbacks[8] = (delegate* unmanaged<IntPtr, IntPtr*, CORINFO_METHOD_STRUCT_*, CORINFO_METHOD_STRUCT_*, byte, CorInfoTailCall, byte*, void>)&_reportTailCallDecision;
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1159,7 +1159,7 @@ private bool getMethodInfo(CORINFO_METHOD_STRUCT_* ftn, CORINFO_METHOD_INFO* inf
return Get_CORINFO_METHOD_INFO(method, methodIL, info);
}

private CorInfoInline canInline(CORINFO_METHOD_STRUCT_* callerHnd, CORINFO_METHOD_STRUCT_* calleeHnd, ref uint pRestrictions)
private CorInfoInline canInline(CORINFO_METHOD_STRUCT_* callerHnd, CORINFO_METHOD_STRUCT_* calleeHnd)
{
MethodDesc callerMethod = HandleToObject(callerHnd);
MethodDesc calleeMethod = HandleToObject(calleeHnd);
Expand Down
10 changes: 0 additions & 10 deletions src/coreclr/tools/Common/JitInterface/CorInfoTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -498,16 +498,6 @@ public enum CorInfoInlineTypeCheckSource
CORINFO_INLINE_TYPECHECK_SOURCE_TOKEN = 0x00000001, // Type handle comes from an ldtoken
}

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
}

// If you add more values here, keep it in sync with TailCallTypeMap in ..\vm\ClrEtwAll.man
// and the string enum in CEEInfo::reportTailCallDecision in ..\vm\JITInterface.cpp
public enum CorInfoTailCall
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ FUNCTIONS
void setMethodAttribs( CORINFO_METHOD_HANDLE ftn, CorInfoMethodRuntimeFlags attribs );
void getMethodSig( CORINFO_METHOD_HANDLE ftn, CORINFO_SIG_INFO *sig, CORINFO_CLASS_HANDLE memberParent );
bool getMethodInfo( CORINFO_METHOD_HANDLE ftn, CORINFO_METHOD_INFO* info );
CorInfoInline canInline( CORINFO_METHOD_HANDLE callerHnd, CORINFO_METHOD_HANDLE calleeHnd, uint32_t* pRestrictions );
CorInfoInline canInline( CORINFO_METHOD_HANDLE callerHnd, CORINFO_METHOD_HANDLE calleeHnd);
void reportInliningDecision(CORINFO_METHOD_HANDLE inlinerHnd, CORINFO_METHOD_HANDLE inlineeHnd, CorInfoInline inlineResult, const char * reason);
bool canTailCall( CORINFO_METHOD_HANDLE callerHnd, CORINFO_METHOD_HANDLE declaredCalleeHnd, CORINFO_METHOD_HANDLE exactCalleeHnd, bool fIsTailPrefix );
void reportTailCallDecision(CORINFO_METHOD_HANDLE callerHnd, CORINFO_METHOD_HANDLE calleeHnd, bool fIsTailPrefix, CorInfoTailCall tailCallResult, const char * reason);
Expand Down
Loading