Repository: dotnet/runtime
File: src/coreclr/interpreter/eeinterp.cpp (C++)

Code before:
            case 1:
            {
                doInterpret = true;
                const char *assemblyName = compHnd->getClassAssemblyName(compHnd->getMethodClass(methodInfo->ftn));
                if (assemblyName && !strcmp(assemblyName, "System.Private.CoreLib"))
                    doInterpret = false;
                break;
            }

            // 2: use interpreter for everything except intrinsics. All intrinsics fallback to JIT. Implies DOTNET_ReadyToRun=0
            case 2:
                doInterpret = !(compHnd->getMethodAttribs(methodInfo->ftn) & CORINFO_FLG_INTRINSIC);
                break;

            // 3: use interpreter for everything, the full interpreter-only mode, no fallbacks to R2R or JIT whatsoever. Implies DOTNET_ReadyToRun=0, DOTNET_EnableHWIntrinsic=0, DOTNET_MaxVectorTBitWidth=128, DOTNET_PreferredVectorBitWidth=128
            case 3:
                doInterpret = true;
                break;

            default:
                NO_WAY("Unsupported value for DOTNET_InterpMode");
                break;
        }

#if defined(TARGET_WASM) || defined(TARGET_IOS) || defined(TARGET_TVOS) || defined(TARGET_MACCATALYST)
        // interpret everything on wasm and Apple mobile platforms
        doInterpret = true;
#else
        // NOTE: We do this check even if doInterpret==true in order to populate g_interpModule
        const char *methodName = compHnd->getMethodNameFromMetadata(methodInfo->ftn, nullptr, nullptr, nullptr, 0);
        if (InterpConfig.Interpreter().contains(compHnd, methodInfo->ftn, compHnd->getMethodClass(methodInfo->ftn), &methodInfo->args))
        {
            doInterpret = true;
            g_interpModule = methodInfo->scope;
        }
#endif
    }

    if (!doInterpret)
    {
        return CORJIT_SKIPPED;
    }

    try
    {
        InterpCompiler compiler(compHnd, methodInfo);
        InterpMethod *pMethod = compiler.CompileMethod();
        int32_t IRCodeSize = 0;
        int32_t *pIRCode = compiler.GetCode(&IRCodeSize);

        uint32_t sizeOfCode = sizeof(InterpMethod*) + IRCodeSize * sizeof(int32_t);

Review comment (suggestion):
```suggestion
#if !defined(FEATURE_JIT)
        // interpret everything when we do not have a JIT
```

Code after:
            case 1:
            {
                doInterpret = true;
                const char *assemblyName = compHnd->getClassAssemblyName(compHnd->getMethodClass(methodInfo->ftn));
                if (assemblyName && !strcmp(assemblyName, "System.Private.CoreLib"))
                    doInterpret = false;
                break;
            }

            // 2: use interpreter for everything except intrinsics. All intrinsics fallback to JIT. Implies DOTNET_ReadyToRun=0
            case 2:
                doInterpret = !(compHnd->getMethodAttribs(methodInfo->ftn) & CORINFO_FLG_INTRINSIC);
                break;

            // 3: use interpreter for everything, the full interpreter-only mode, no fallbacks to R2R or JIT whatsoever. Implies DOTNET_ReadyToRun=0, DOTNET_EnableHWIntrinsic=0, DOTNET_MaxVectorTBitWidth=128, DOTNET_PreferredVectorBitWidth=128
            case 3:
                doInterpret = true;
                break;

            default:
                NO_WAY("Unsupported value for DOTNET_InterpMode");
                break;
        }

#if !defined(FEATURE_JIT)
        // interpret everything when we do not have a JIT
        doInterpret = true;
#else
        // NOTE: We do this check even if doInterpret==true in order to populate g_interpModule
        const char *methodName = compHnd->getMethodNameFromMetadata(methodInfo->ftn, nullptr, nullptr, nullptr, 0);
        if (InterpConfig.Interpreter().contains(compHnd, methodInfo->ftn, compHnd->getMethodClass(methodInfo->ftn), &methodInfo->args))
        {
            doInterpret = true;
            g_interpModule = methodInfo->scope;
        }
#endif
    }

    if (!doInterpret)
    {
        return CORJIT_SKIPPED;
    }

    try
    {
        InterpCompiler compiler(compHnd, methodInfo);
        InterpMethod *pMethod = compiler.CompileMethod();
        int32_t IRCodeSize = 0;
        int32_t *pIRCode = compiler.GetCode(&IRCodeSize);

        uint32_t sizeOfCode = sizeof(InterpMethod*) + IRCodeSize * sizeof(int32_t);