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

Code before:
    {
        info.compMatchedVM = info.compMatchedVM && (eeInfo->osType == CORINFO_APPLE);
    }
    else if (TargetOS::IsUnix)
    {
        if (TargetArchitecture::IsX64)
        {
            // Apple x64 uses the Unix jit variant in crossgen2, not a special jit
            info.compMatchedVM =
                info.compMatchedVM && ((eeInfo->osType == CORINFO_UNIX) || (eeInfo->osType == CORINFO_APPLE));
        }
        else
        {
            info.compMatchedVM = info.compMatchedVM && (eeInfo->osType == CORINFO_UNIX);
        }
    }
    else if (TargetOS::IsWindows)
    {
        info.compMatchedVM = info.compMatchedVM && (eeInfo->osType == CORINFO_WINNT);
    }

    compMaxUncheckedOffsetForNullObject = eeInfo->maxUncheckedOffsetForNullObject;

#if defined(DEBUG) && defined(TARGET_WASM)
    // if we are cross-replaying wasm, override compMaxUncheckedOffsetForNullObject
    if (!info.compMatchedVM)
    {
        compMaxUncheckedOffsetForNullObject = 1024 - 1;
    }
#endif

    info.compProfilerCallback = false; // Assume false until we are told to hook this method.

    info.compCode         = methodInfo->ILCode;
    info.compILCodeSize   = methodInfo->ILCodeSize;
    info.compILImportSize = 0;

    info.compHasNextCallRetAddr    = false;
    info.compIsVarArgs             = false;
    info.compUsesAsyncContinuation = false;
}

//------------------------------------------------------------------------
// getJitGCType: Given the VM's CorInfoGCType convert it to the JIT's var_types
//
// Arguments:
//    gcType    - an enum value that originally came from an element
//                of the BYTE[] returned from getClassGClayout()
//
// Return Value:
//    The corresponding enum value from the JIT's var_types

Review comment (suggestion):
I think this should be `TODO-WASM: remove once we no longer need to use x86/arm collections.`. Since it is only useful for "abusing" foreign collections.

Code after:
    {
        info.compMatchedVM = info.compMatchedVM && (eeInfo->osType == CORINFO_APPLE);
    }
    else if (TargetOS::IsUnix)
    {
        if (TargetArchitecture::IsX64)
        {
            // Apple x64 uses the Unix jit variant in crossgen2, not a special jit
            info.compMatchedVM =
                info.compMatchedVM && ((eeInfo->osType == CORINFO_UNIX) || (eeInfo->osType == CORINFO_APPLE));
        }
        else
        {
            info.compMatchedVM = info.compMatchedVM && (eeInfo->osType == CORINFO_UNIX);
        }
    }
    else if (TargetOS::IsWindows)
    {
        info.compMatchedVM = info.compMatchedVM && (eeInfo->osType == CORINFO_WINNT);
    }

    compMaxUncheckedOffsetForNullObject = eeInfo->maxUncheckedOffsetForNullObject;

#if defined(DEBUG) && defined(TARGET_WASM)
    // TODO-WASM: remove once we no longer need to use x86/arm collections for wasm replay
    // if we are cross-replaying wasm, override compMaxUncheckedOffsetForNullObject
    if (!info.compMatchedVM)
    {
        compMaxUncheckedOffsetForNullObject = 1024 - 1;
    }
#endif

    info.compProfilerCallback = false; // Assume false until we are told to hook this method.

    info.compCode         = methodInfo->ILCode;
    info.compILCodeSize   = methodInfo->ILCodeSize;
    info.compILImportSize = 0;

    info.compHasNextCallRetAddr    = false;
    info.compIsVarArgs             = false;
    info.compUsesAsyncContinuation = false;
}

//------------------------------------------------------------------------
// getJitGCType: Given the VM's CorInfoGCType convert it to the JIT's var_types
//
// Arguments:
//    gcType    - an enum value that originally came from an element
//                of the BYTE[] returned from getClassGClayout()
//
// Return Value: