`CORINFO_CALLINFO_ATYPICAL_CALLSITE` was added a few years ago to support code generators that don't emit calls via `call [rel32]` form. It is now unused (LLILC was the only consumer) so we can remove it.
CORINFO_HELP_COUNT,
};
-#define CORINFO_HELP_READYTORUN_ATYPICAL_CALLSITE 0x40000000
-
//This describes the signature for a helper method.
enum CorInfoHelpSig
{
CORINFO_ACCESS_SET = 0x0200, // Field set (stfld)
CORINFO_ACCESS_ADDRESS = 0x0400, // Field address (ldflda)
CORINFO_ACCESS_INIT_ARRAY = 0x0800, // Field use for InitializeArray
- CORINFO_ACCESS_ATYPICAL_CALLSITE = 0x4000, // Atypical callsite that cannot be disassembled by delay loading helper
+ // UNUSED = 0x4000,
CORINFO_ACCESS_INLINECHECK= 0x8000, // Return fieldFlags and fieldAccessor only. Used by JIT64 during inlining.
};
CORINFO_CALLINFO_VERIFICATION = 0x0008, // Gets extra verification information.
CORINFO_CALLINFO_SECURITYCHECKS = 0x0010, // Perform security checks.
CORINFO_CALLINFO_LDFTN = 0x0020, // Resolving target of LDFTN
- CORINFO_CALLINFO_ATYPICAL_CALLSITE = 0x0040, // Atypical callsite that cannot be disassembled by delay loading helper
+ // UNUSED = 0x0040,
};
enum CorInfoIsAccessAllowedResult
CORINFO_CALLINFO_VERIFICATION = 0x0008, // Gets extra verification information.
CORINFO_CALLINFO_SECURITYCHECKS = 0x0010, // Perform security checks.
CORINFO_CALLINFO_LDFTN = 0x0020, // Resolving target of LDFTN
- CORINFO_CALLINFO_ATYPICAL_CALLSITE = 0x0040, // Atypical callsite that cannot be disassembled by delay loading helper
+ // UNUSED = 0x0040,
}
// Bit-twiddling of contexts assumes word-alignment of method handles and type handles
CORINFO_ACCESS_SET = 0x0200, // Field set (stfld)
CORINFO_ACCESS_ADDRESS = 0x0400, // Field address (ldflda)
CORINFO_ACCESS_INIT_ARRAY = 0x0800, // Field use for InitializeArray
- CORINFO_ACCESS_ATYPICAL_CALLSITE = 0x4000, // Atypical callsite that cannot be disassembled by delay loading helper
+ // UNUSED = 0x4000,
CORINFO_ACCESS_INLINECHECK = 0x8000, // Return fieldFlags and fieldAccessor only. Used by JIT64 during inlining.
}
case CORINFO_CALL_KIND.CORINFO_VIRTUALCALL_LDVIRTFTN:
if (!pResult->exactContextNeedsRuntimeLookup)
{
- bool atypicalCallsite = (flags & CORINFO_CALLINFO_FLAGS.CORINFO_CALLINFO_ATYPICAL_CALLSITE) != 0;
pResult->codePointerOrStubLookup.constLookup = CreateConstLookupToSymbol(
_compilation.NodeFactory.DynamicHelperCell(
ComputeMethodWithToken(targetMethod, ref pResolvedToken, constrainedType: null, unboxing: false),
}
// Create the delay load helper
- ReadyToRunHelper helperNum = GetDelayLoadHelperForDynamicHelper(
- (CORCOMPILE_FIXUP_BLOB_KIND)(pCell->GetKind() & ~CORINFO_HELP_READYTORUN_ATYPICAL_CALLSITE));
-
- ZapNode * pDelayLoadHelper = m_pImage->GetImportTable()->GetPlacedIndirectHelperThunk(helperNum, (PVOID)(SIZE_T)m_dwIndex,
- (pCell->GetKind() & CORINFO_HELP_READYTORUN_ATYPICAL_CALLSITE) ? pCell : NULL);
+ ReadyToRunHelper helperNum = GetDelayLoadHelperForDynamicHelper(pCell->GetKind());
+ ZapNode * pDelayLoadHelper = m_pImage->GetImportTable()->GetPlacedIndirectHelperThunk(helperNum, (PVOID)(SIZE_T)m_dwIndex);
pCell->SetDelayLoadHelper(pDelayLoadHelper);
SigBuilder sigBuilder;
- sigBuilder.AppendData(kind & ~CORINFO_HELP_READYTORUN_ATYPICAL_CALLSITE);
+ sigBuilder.AppendData(kind);
- if ((kind & ~CORINFO_HELP_READYTORUN_ATYPICAL_CALLSITE) == ENCODE_DICTIONARY_LOOKUP_THISOBJ)
+ if (kind == ENCODE_DICTIONARY_LOOKUP_THISOBJ)
{
CORINFO_CLASS_HANDLE hClassContext = GetJitInfo()->getMethodClass(containingMethod);
GetCompileInfo()->EncodeClass(m_pImage->GetModuleHandle(), hClassContext, &sigBuilder, this, EncodeModuleHelper);
{
SigBuilder sigBuilder;
- sigBuilder.AppendData(kind & ~CORINFO_HELP_READYTORUN_ATYPICAL_CALLSITE);
+ sigBuilder.AppendData(kind);
GetCompileInfo()->EncodeClass(m_pImage->GetModuleHandle(), handle, &sigBuilder, this, EncodeModuleHelper);
pImport->SetBlob(GetBlob(&sigBuilder));
{
SigBuilder sigBuilder;
- EncodeMethod((CORCOMPILE_FIXUP_BLOB_KIND)(kind & ~CORINFO_HELP_READYTORUN_ATYPICAL_CALLSITE),
- handle, &sigBuilder, pResolvedToken);
+ EncodeMethod(kind, handle, &sigBuilder, pResolvedToken);
if (delegateType != NULL)
{
- _ASSERTE((CORCOMPILE_FIXUP_BLOB_KIND)(kind & ~CORINFO_HELP_READYTORUN_ATYPICAL_CALLSITE) == ENCODE_DELEGATE_CTOR);
+ _ASSERTE(kind == ENCODE_DELEGATE_CTOR);
GetCompileInfo()->EncodeClass(m_pImage->GetModuleHandle(), delegateType, &sigBuilder, this, EncodeModuleHelper);
}
{
SigBuilder sigBuilder;
- EncodeField((CORCOMPILE_FIXUP_BLOB_KIND)(kind & ~CORINFO_HELP_READYTORUN_ATYPICAL_CALLSITE),
- handle, &sigBuilder, pResolvedToken);
+ EncodeField(kind, handle, &sigBuilder, pResolvedToken);
return GetImportForSignature<ZapDynamicHelperCell, ZapNodeType_DynamicHelperCell>((void *)(uintptr_t)((kind << 1) | 1), &sigBuilder);
}
{
DWORD SaveWorker(ZapWriter * pZapWriter);
- ZapNode * m_pCell;
-
public:
- void SetCell(ZapNode * pCell)
- {
- m_pCell = pCell;
- }
-
ReadyToRunHelper GetReadyToRunHelper()
{
return (ReadyToRunHelper)((DWORD)(SIZE_T)GetHandle() & ~READYTORUN_HELPER_FLAG_VSD);
#elif defined(TARGET_AMD64)
if (IsDelayLoadHelper())
{
- if (m_pCell != NULL)
- {
- // lea rax, [pCell]
- *p++ = 0x48;
- *p++ = 0x8D;
- *p++ = 0x05;
- if (pImage != NULL)
- pImage->WriteReloc(buffer, (int)(p - buffer), m_pCell, 0, IMAGE_REL_BASED_REL32);
- p += 4;
- }
- else
if (IsVSD())
{
// mov rax, r11
return pImport;
}
-ZapNode * ZapImportTable::GetPlacedIndirectHelperThunk(ReadyToRunHelper helperNum, PVOID pArg, ZapNode * pCell)
+ZapNode * ZapImportTable::GetPlacedIndirectHelperThunk(ReadyToRunHelper helperNum, PVOID pArg)
{
- ZapNode * pImport;
- if (pCell != NULL)
- {
- ZapIndirectHelperThunk * pIndirectHelperThunk = new (m_pImage->GetHeap()) ZapIndirectHelperThunk();
- pIndirectHelperThunk->SetHandle((void *)helperNum);
- pIndirectHelperThunk->SetHandle2(pArg);
- pIndirectHelperThunk->SetCell(pCell);
- pImport = pIndirectHelperThunk;
- }
- else
- {
- pImport = GetImport<ZapIndirectHelperThunk, ZapNodeType_IndirectHelperThunk>((void *)helperNum, pArg);
- }
+ ZapNode * pImport = GetImport<ZapIndirectHelperThunk, ZapNodeType_IndirectHelperThunk>((void *)helperNum, pArg);
if (!pImport->IsPlaced())
PlaceIndirectHelperThunk(pImport);
#if defined(TARGET_ARM)
ZapImport * GetDictionaryLookupCell(CORCOMPILE_FIXUP_BLOB_KIND kind, CORINFO_METHOD_HANDLE containingMethod, CORINFO_RESOLVED_TOKEN * pResolvedToken, CORINFO_LOOKUP_KIND * pLookup);
#ifdef FEATURE_READYTORUN_COMPILER
- ZapNode * GetPlacedIndirectHelperThunk(ReadyToRunHelper helperNum, PVOID pArg = NULL, ZapNode * pCell = NULL);
+ ZapNode * GetPlacedIndirectHelperThunk(ReadyToRunHelper helperNum, PVOID pArg = NULL);
ZapNode * GetIndirectHelperThunk(ReadyToRunHelper helperNum, PVOID pArg = NULL);
void PlaceIndirectHelperThunk(ZapNode * pImport);
ZapImport * pImport;
- if (flags & (CORINFO_CALLINFO_LDFTN | CORINFO_CALLINFO_ATYPICAL_CALLSITE))
+ if (flags & CORINFO_CALLINFO_LDFTN)
{
pImport = m_pImage->GetImportTable()->GetMethodImport(ENCODE_METHOD_ENTRY, pResult->hMethod, pResolvedToken, pConstrainedResolvedToken);
#ifdef FEATURE_READYTORUN_COMPILER
if (IsReadyToRunCompilation() && !pResult->exactContextNeedsRuntimeLookup)
{
- DWORD fAtypicalCallsite = (flags & CORINFO_CALLINFO_ATYPICAL_CALLSITE) ? CORINFO_HELP_READYTORUN_ATYPICAL_CALLSITE : 0;
-
- ZapImport * pImport = m_pImage->GetImportTable()->GetDynamicHelperCell(
- (CORCOMPILE_FIXUP_BLOB_KIND)(ENCODE_VIRTUAL_ENTRY | fAtypicalCallsite), pResult->hMethod, pResolvedToken);
+ ZapImport * pImport = m_pImage->GetImportTable()->GetDynamicHelperCell(ENCODE_VIRTUAL_ENTRY, pResult->hMethod, pResolvedToken);
pResult->codePointerLookup.constLookup.accessType = IAT_PVALUE;
pResult->codePointerLookup.constLookup.addr = pImport;
ThrowHR(E_NOTIMPL);
}
- DWORD fAtypicalCallsite = (flags & CORINFO_ACCESS_ATYPICAL_CALLSITE) ? CORINFO_HELP_READYTORUN_ATYPICAL_CALLSITE : 0;
-
switch (pResult->fieldAccessor)
{
case CORINFO_FIELD_INSTANCE:
UNREACHABLE_MSG("Unexpected static helper");
}
- ZapImport * pImport = m_pImage->GetImportTable()->GetDynamicHelperCell(
- (CORCOMPILE_FIXUP_BLOB_KIND)(kind | fAtypicalCallsite), pResolvedToken->hClass);
+ ZapImport * pImport = m_pImage->GetImportTable()->GetDynamicHelperCell(kind, pResolvedToken->hClass);
pResult->fieldLookup.accessType = IAT_PVALUE;
pResult->fieldLookup.addr = pImport;
}
else
{
- ZapImport * pImport = m_pImage->GetImportTable()->GetDynamicHelperCell(
- (CORCOMPILE_FIXUP_BLOB_KIND)(ENCODE_FIELD_ADDRESS | fAtypicalCallsite), pResolvedToken->hField, pResolvedToken);
+ ZapImport * pImport = m_pImage->GetImportTable()->GetDynamicHelperCell(ENCODE_FIELD_ADDRESS, pResolvedToken->hField, pResolvedToken);
pResult->fieldLookup.accessType = IAT_PVALUE;
pResult->fieldLookup.addr = pImport;
ZapImport * pImport = NULL;
- DWORD fAtypicalCallsite = (id & CORINFO_HELP_READYTORUN_ATYPICAL_CALLSITE);
- id = (CorInfoHelpFunc)(id & ~CORINFO_HELP_READYTORUN_ATYPICAL_CALLSITE);
-
bool ignoredSideEffects = false;
switch (id)
{
if ((getClassAttribs(pResolvedToken->hClass) & CORINFO_FLG_SHAREDINST) != 0)
return false; // Requires runtime lookup.
- pImport = m_pImage->GetImportTable()->GetDynamicHelperCell(
- (CORCOMPILE_FIXUP_BLOB_KIND)(ENCODE_NEW_HELPER | fAtypicalCallsite), pResolvedToken->hClass);
+ pImport = m_pImage->GetImportTable()->GetDynamicHelperCell(ENCODE_NEW_HELPER, pResolvedToken->hClass);
break;
case CORINFO_HELP_READYTORUN_NEWARR_1:
if ((getClassAttribs(pResolvedToken->hClass) & CORINFO_FLG_SHAREDINST) != 0)
return false; // Requires runtime lookup.
- pImport = m_pImage->GetImportTable()->GetDynamicHelperCell(
- (CORCOMPILE_FIXUP_BLOB_KIND)(ENCODE_NEW_ARRAY_HELPER | fAtypicalCallsite), pResolvedToken->hClass);
+ pImport = m_pImage->GetImportTable()->GetDynamicHelperCell(ENCODE_NEW_ARRAY_HELPER, pResolvedToken->hClass);
break;
case CORINFO_HELP_READYTORUN_ISINSTANCEOF:
if ((getClassAttribs(pResolvedToken->hClass) & CORINFO_FLG_SHAREDINST) != 0)
return false; // Requires runtime lookup.
- pImport = m_pImage->GetImportTable()->GetDynamicHelperCell(
- (CORCOMPILE_FIXUP_BLOB_KIND)(ENCODE_ISINSTANCEOF_HELPER | fAtypicalCallsite), pResolvedToken->hClass);
+ pImport = m_pImage->GetImportTable()->GetDynamicHelperCell(ENCODE_ISINSTANCEOF_HELPER, pResolvedToken->hClass);
break;
case CORINFO_HELP_READYTORUN_CHKCAST:
if ((getClassAttribs(pResolvedToken->hClass) & CORINFO_FLG_SHAREDINST) != 0)
return false; // Requires runtime lookup.
- pImport = m_pImage->GetImportTable()->GetDynamicHelperCell(
- (CORCOMPILE_FIXUP_BLOB_KIND)(ENCODE_CHKCAST_HELPER | fAtypicalCallsite), pResolvedToken->hClass);
+ pImport = m_pImage->GetImportTable()->GetDynamicHelperCell(ENCODE_CHKCAST_HELPER, pResolvedToken->hClass);
break;
case CORINFO_HELP_READYTORUN_STATIC_BASE:
return false; // Requires runtime lookup.
if (m_pImage->GetCompileInfo()->IsInCurrentVersionBubble(m_pEEJitInfo->getClassModule(pResolvedToken->hClass)))
{
- pImport = m_pImage->GetImportTable()->GetDynamicHelperCell(
- (CORCOMPILE_FIXUP_BLOB_KIND)(ENCODE_CCTOR_TRIGGER | fAtypicalCallsite), pResolvedToken->hClass);
+ pImport = m_pImage->GetImportTable()->GetDynamicHelperCell(ENCODE_CCTOR_TRIGGER, pResolvedToken->hClass);
}
else
{
if (pGenericLookupKind->runtimeLookupKind == CORINFO_LOOKUP_METHODPARAM)
{
pImport = m_pImage->GetImportTable()->GetDictionaryLookupCell(
- (CORCOMPILE_FIXUP_BLOB_KIND)(ENCODE_DICTIONARY_LOOKUP_METHOD | fAtypicalCallsite), m_currentMethodHandle, pResolvedToken, pGenericLookupKind);
+ ENCODE_DICTIONARY_LOOKUP_METHOD, m_currentMethodHandle, pResolvedToken, pGenericLookupKind);
}
else if (pGenericLookupKind->runtimeLookupKind == CORINFO_LOOKUP_THISOBJ)
{
pImport = m_pImage->GetImportTable()->GetDictionaryLookupCell(
- (CORCOMPILE_FIXUP_BLOB_KIND)(ENCODE_DICTIONARY_LOOKUP_THISOBJ | fAtypicalCallsite), m_currentMethodHandle, pResolvedToken, pGenericLookupKind);
+ ENCODE_DICTIONARY_LOOKUP_THISOBJ, m_currentMethodHandle, pResolvedToken, pGenericLookupKind);
}
else
{
_ASSERTE(pGenericLookupKind->runtimeLookupKind == CORINFO_LOOKUP_CLASSPARAM);
pImport = m_pImage->GetImportTable()->GetDictionaryLookupCell(
- (CORCOMPILE_FIXUP_BLOB_KIND)(ENCODE_DICTIONARY_LOOKUP_TYPE | fAtypicalCallsite), m_currentMethodHandle, pResolvedToken, pGenericLookupKind);
+ ENCODE_DICTIONARY_LOOKUP_TYPE, m_currentMethodHandle, pResolvedToken, pGenericLookupKind);
}
break;