Repository: dotnet/runtime
File: src/coreclr/jit/lower.cpp (C++)

Code before:
        case IAT_RELPVALUE:
        {
            // Non-virtual direct calls to addresses accessed by
            // a single relative indirection.
            GenTree* cellAddr = AddrGen(addr);
            GenTree* indir    = Ind(cellAddr);
            result            = m_compiler->gtNewOperNode(GT_ADD, TYP_I_IMPL, indir, AddrGen(addr));
            break;
        }

        default:
            noway_assert(!"Bad accessType");
            break;
    }

    return result;
}

//----------------------------------------------------------------------------------------------
// LowerDelegateInvoke: lower a delegate invoke, accessing fields of the delgate
//
// Arguments:
//     call - call representing a delegate invoke.
//
// Return Value:
//    Control expr for the delegate invoke call, for futher lowering.
//
GenTree* Lowering::LowerDelegateInvoke(GenTreeCall* call)
{
    noway_assert(call->gtCallType == CT_USER_FUNC);

    assert((m_compiler->info.compCompHnd->getMethodAttribs(call->gtCallMethHnd) &
            (CORINFO_FLG_DELEGATE_INVOKE | CORINFO_FLG_FINAL)) == (CORINFO_FLG_DELEGATE_INVOKE | CORINFO_FLG_FINAL));

    CallArg* thisArg = nullptr;

    if (call->IsTailCallViaJitHelper())
    {
        thisArg = call->gtArgs.GetArgByIndex(0);
    }
    else
    {
        thisArg = call->gtArgs.GetThisArg();
    }

    assert(thisArg != nullptr);
    GenTree* thisArgNode = thisArg->GetNode();
    assert(thisArgNode != nullptr);

#if HAS_FIXED_REGISTER_SET
    assert(thisArgNode->OperIs(GT_PUTARG_REG));

Review comment (suggestion):
Spelling in the new comment block: "delgate" should be "delegate", and "futher" should be "further".
```suggestion
// LowerDelegateInvoke: lower a delegate invoke, accessing fields of the delegate
//
// Arguments:
//     call - call representing a delegate invoke.
//
// Return Value:
//    Control expr for the delegate invoke call, for further lowering.
```

Code after:
        case IAT_RELPVALUE:
        {
            // Non-virtual direct calls to addresses accessed by
            // a single relative indirection.
            GenTree* cellAddr = AddrGen(addr);
            GenTree* indir    = Ind(cellAddr);
            result            = m_compiler->gtNewOperNode(GT_ADD, TYP_I_IMPL, indir, AddrGen(addr));
            break;
        }

        default:
            noway_assert(!"Bad accessType");
            break;
    }

    return result;
}

//----------------------------------------------------------------------------------------------
// LowerDelegateInvoke: lower a delegate invoke, accessing fields of the delegate
//
// Arguments:
//     call - call representing a delegate invoke.
//
// Return Value:
//    Control expr for the delegate invoke call, for further lowering.
//
GenTree* Lowering::LowerDelegateInvoke(GenTreeCall* call)
{
    noway_assert(call->gtCallType == CT_USER_FUNC);

    assert((m_compiler->info.compCompHnd->getMethodAttribs(call->gtCallMethHnd) &
            (CORINFO_FLG_DELEGATE_INVOKE | CORINFO_FLG_FINAL)) == (CORINFO_FLG_DELEGATE_INVOKE | CORINFO_FLG_FINAL));

    CallArg* thisArg = nullptr;

    if (call->IsTailCallViaJitHelper())
    {
        thisArg = call->gtArgs.GetArgByIndex(0);
    }
    else
    {
        thisArg = call->gtArgs.GetThisArg();
    }

    assert(thisArg != nullptr);
    GenTree* thisArgNode = thisArg->GetNode();
    assert(thisArgNode != nullptr);

#if HAS_FIXED_REGISTER_SET
    assert(thisArgNode->OperIs(GT_PUTARG_REG));