Skip to content

Commit

Permalink
Delete some dead code` (#91018)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkotas authored Aug 24, 2023
1 parent 819e288 commit b0d2596
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 19 deletions.
18 changes: 2 additions & 16 deletions src/coreclr/vm/jitinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5982,26 +5982,21 @@ CorInfoHelpFunc CEEInfo::getCastingHelper(CORINFO_RESOLVED_TOKEN * pResolvedToke

JIT_TO_EE_TRANSITION();

bool fClassMustBeRestored;
result = getCastingHelperStatic(TypeHandle(pResolvedToken->hClass), fThrowing, &fClassMustBeRestored);
if (fClassMustBeRestored)
classMustBeLoadedBeforeCodeIsRun(pResolvedToken->hClass);
result = getCastingHelperStatic(TypeHandle(pResolvedToken->hClass), fThrowing);

EE_TO_JIT_TRANSITION();

return result;
}

/***********************************************************************/
CorInfoHelpFunc CEEInfo::getCastingHelperStatic(TypeHandle clsHnd, bool fThrowing, bool * pfClassMustBeRestored)
CorInfoHelpFunc CEEInfo::getCastingHelperStatic(TypeHandle clsHnd, bool fThrowing)
{
STANDARD_VM_CONTRACT;

// Slow helper is the default
int helper = CORINFO_HELP_ISINSTANCEOFANY;

*pfClassMustBeRestored = false;

if (clsHnd == TypeHandle(g_pCanonMethodTableClass))
{
// In shared code just use the catch-all helper for type variables, as the same
Expand All @@ -6014,9 +6009,6 @@ CorInfoHelpFunc CEEInfo::getCastingHelperStatic(TypeHandle clsHnd, bool fThrowin
else
if (!clsHnd.IsTypeDesc() && clsHnd.AsMethodTable()->HasVariance())
{
// Casting to variant type requires the type to be fully loaded
*pfClassMustBeRestored = true;

_ASSERTE(helper == CORINFO_HELP_ISINSTANCEOFANY);
}
else
Expand All @@ -6036,12 +6028,6 @@ CorInfoHelpFunc CEEInfo::getCastingHelperStatic(TypeHandle clsHnd, bool fThrowin
else
if (clsHnd.IsArray())
{
if (clsHnd.GetInternalCorElementType() != ELEMENT_TYPE_SZARRAY)
{
// Casting to multidimensional array type requires restored pointer to EEClass to fetch rank
*pfClassMustBeRestored = true;
}

// If it is an array, use the fast array helper
helper = CORINFO_HELP_ISINSTANCEOFARRAY;
}
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/jitinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ class CEEInfo : public ICorJitInfo
static unsigned getClassGClayoutStatic(TypeHandle th, BYTE* gcPtrs);
static CorInfoHelpFunc getNewHelperStatic(MethodTable * pMT, bool * pHasSideEffects);
static CorInfoHelpFunc getNewArrHelperStatic(TypeHandle clsHnd);
static CorInfoHelpFunc getCastingHelperStatic(TypeHandle clsHnd, bool fThrowing, bool * pfClassMustBeRestored);
static CorInfoHelpFunc getCastingHelperStatic(TypeHandle clsHnd, bool fThrowing);

// Returns that compilation flags that are shared between JIT and NGen
static CORJIT_FLAGS GetBaseCompileFlags(MethodDesc * ftn);
Expand Down
3 changes: 1 addition & 2 deletions src/coreclr/vm/prestub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3561,8 +3561,7 @@ PCODE DynamicHelperFixup(TransitionBlock * pTransitionBlock, TADDR * pCell, DWOR
case ENCODE_ISINSTANCEOF_HELPER:
case ENCODE_CHKCAST_HELPER:
{
bool fClassMustBeRestored;
CorInfoHelpFunc helpFunc = CEEInfo::getCastingHelperStatic(th, /* throwing */ (kind == ENCODE_CHKCAST_HELPER), &fClassMustBeRestored);
CorInfoHelpFunc helpFunc = CEEInfo::getCastingHelperStatic(th, /* throwing */ (kind == ENCODE_CHKCAST_HELPER));
pHelper = DynamicHelpers::CreateHelperArgMove(pModule->GetLoaderAllocator(), th.AsTAddr(), CEEJitInfo::getHelperFtnStatic(helpFunc));
}
break;
Expand Down

0 comments on commit b0d2596

Please sign in to comment.