Repository: dotnet/runtime
File: src/coreclr/vm/method.cpp (C++)

Code before:
    // temporary entry point.
    EnsureTemporaryEntryPoint();

    SetStableEntryPointInterlocked(GetPortableEntryPoint());
}

PCODE MethodDesc::GetPortableEntryPoint()
{
    WRAPPER_NO_CONTRACT;

    // The portable entry point is currently the same as the
    // temporary entry point.
    return GetTemporaryEntryPoint();
}

PCODE MethodDesc::GetPortableEntryPointIfExists()
{
    WRAPPER_NO_CONTRACT;

    // The portable entry point is currently the same as the
    // temporary entry point.
    return GetTemporaryEntryPointIfExists();
}

// If the portable entry point diverges from the temporary
// entry point, we may need to reset both of them.
void MethodDesc::ResetPortableEntryPoint()
{
    PCODE portableEntry = GetPortableEntryPointIfExists();
    if (portableEntry != (PCODE)NULL)
    {
        PortableEntryPoint* pep = PortableEntryPoint::ToPortableEntryPoint(portableEntry);
        pep->Init(this);  // Re-initializes: clears _pActualCode, _pInterpreterData, _flags
    }
}
#endif // FEATURE_PORTABLE_ENTRYPOINTS

//*******************************************************************************
void MethodDescChunk::DetermineAndSetIsEligibleForTieredCompilation()
{
    WRAPPER_NO_CONTRACT;

    if (!DeterminedIfMethodsAreEligibleForTieredCompilation())
    {
        int count = GetCount();

        // Determine eligibility for tiered compilation
        {
            MethodDesc *pMD = GetFirstMethodDesc();
            bool chunkContainsEligibleMethods = pMD->DetermineIsEligibleForTieredCompilationInvariantForAllMethodsInChunk();


Review comment (suggestion):
```suggestion
```
I do not think this comment is useful. It does not explain what the code does currently.

This comment talks about what the code may need to do in theory in case fundamental invariants change. Information like that is rarely captured in comments. If it is captured, the comment needs to state that it is describing hypothetical alternative.

Code after:
    // temporary entry point.
    EnsureTemporaryEntryPoint();

    SetStableEntryPointInterlocked(GetPortableEntryPoint());
}

PCODE MethodDesc::GetPortableEntryPoint()
{
    WRAPPER_NO_CONTRACT;

    // The portable entry point is currently the same as the
    // temporary entry point.
    return GetTemporaryEntryPoint();
}

PCODE MethodDesc::GetPortableEntryPointIfExists()
{
    WRAPPER_NO_CONTRACT;

    // The portable entry point is currently the same as the
    // temporary entry point.
    return GetTemporaryEntryPointIfExists();
}

void MethodDesc::ResetPortableEntryPoint()
{
    PCODE portableEntry = GetPortableEntryPointIfExists();
    if (portableEntry != (PCODE)NULL)
    {
        PortableEntryPoint* pep = PortableEntryPoint::ToPortableEntryPoint(portableEntry);
        pep->Init(this);  // Re-initializes: clears _pActualCode, _pInterpreterData, _flags
    }
}
#endif // FEATURE_PORTABLE_ENTRYPOINTS

//*******************************************************************************
void MethodDescChunk::DetermineAndSetIsEligibleForTieredCompilation()
{
    WRAPPER_NO_CONTRACT;

    if (!DeterminedIfMethodsAreEligibleForTieredCompilation())
    {
        int count = GetCount();

        // Determine eligibility for tiered compilation
        {
            MethodDesc *pMD = GetFirstMethodDesc();
            bool chunkContainsEligibleMethods = pMD->DetermineIsEligibleForTieredCompilationInvariantForAllMethodsInChunk();

    #ifdef _DEBUG
            // Validate every MethodDesc has the same result for DetermineIsEligibleForTieredCompilationInvariantForAllMethodsInChunk