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

Code before:
            assert(call->IsR2ROrVirtualStubRelativeIndir());

            params.callType = EC_INDIR_R;
            // params.ireg     = targetAddrReg;
            genEmitCallWithCurrentGC(params);
        }
        else
        {
            // Generate a direct call to a non-virtual user defined or helper method
            assert(call->IsHelperCall() || (call->gtCallType == CT_USER_FUNC));

            if (call->gtEntryPoint.addr != NULL)
            {
                NYI_WASM("Call with statically known address");
            }
            else
            {
                if (call->IsHelperCall())
                {
                    NYI_WASM("Call helper statically without indirection cell");
                    CorInfoHelpFunc helperNum = compiler->eeGetHelperNum(params.methHnd);
                    noway_assert(helperNum != CORINFO_HELP_UNDEF);

                    CORINFO_CONST_LOOKUP helperLookup = compiler->compGetHelperFtn(helperNum);
                    params.addr                       = helperLookup.addr;
                    assert(helperLookup.accessType == IAT_VALUE);
                }
                else
                {
                    // Direct call to a non-virtual user function.
                    params.addr = call->gtDirectCallAddress;
                }
            }

            params.callType = EC_FUNC_TOKEN;
            // params.ireg     = params.isJump ? rsGetRsvdReg() : REG_RA;

            genEmitCallWithCurrentGC(params);
        }
    }
}

/*****************************************************************************
 *  Emit a call to a helper function.
 */
void CodeGen::genEmitHelperCall(unsigned helper, int argSize, emitAttr retSize, regNumber callTargetReg /*= REG_NA */)
{
    EmitCallParams params;

    CORINFO_CONST_LOOKUP helperFunction = compiler->compGetHelperFtn((CorInfoHelpFunc)helper);
    params.ireg                         = callTargetReg;

Review comment (suggestion):
The code after NYI_WASM at line 1531 is unreachable because NYI_WASM calls notYetImplemented, which throws an exception. The code at lines 1532-1537 will never execute. This code should either be removed or the NYI_WASM call should be removed if this is intended to be implemented code.
```suggestion

```

Code after:
        }
    }
}

/*****************************************************************************
 *  Emit a call to a helper function.
 */
void CodeGen::genEmitHelperCall(unsigned helper, int argSize, emitAttr retSize, regNumber callTargetReg /*= REG_NA */)
{
    EmitCallParams params;

    CORINFO_CONST_LOOKUP helperFunction = compiler->compGetHelperFtn((CorInfoHelpFunc)helper);
    params.ireg                         = callTargetReg;

    if (helperFunction.accessType == IAT_VALUE)
    {
        params.callType = EC_FUNC_TOKEN;
        params.addr     = helperFunction.addr;
    }
    else
    {
        params.addr = nullptr;
        assert(helperFunction.accessType == IAT_PVALUE);
        void* pAddr = helperFunction.addr;

        // Push indirection cell address onto stack for genEmitCall to dereference
        GetEmitter()->emitIns_I(INS_i32_const, emitActualTypeSize(TYP_I_IMPL), (cnsval_ssize_t)pAddr);

        params.callType = EC_INDIR_R;
    }

    params.methHnd = compiler->eeFindHelper(helper);
    params.argSize = argSize;
    params.retSize = retSize;

    genEmitCallWithCurrentGC(params);
}

//------------------------------------------------------------------------
// genCodeForCompare: Produce code for a GT_EQ/GT_NE/GT_LT/GT_LE/GT_GE/GT_GT node.
//
// Arguments:
//    tree - the node
//
void CodeGen::genCodeForCompare(GenTreeOp* tree)
{
    assert(tree->OperIsCmpCompare());

    GenTree* const  op1     = tree->gtGetOp1();
    var_types const op1Type = op1->TypeGet();