HRESULT STDMETHODCALLTYPE CorProfiler::JITCompilationStarted()

in src/profiler/src/CorProfiler.cpp [140:168]


HRESULT STDMETHODCALLTYPE CorProfiler::JITCompilationStarted(FunctionID functionId, BOOL fIsSafeToBlock)
{    
    // Insert only once at the beginning of application
    if (hasInserted)
    {
        return S_OK;
    }

    FunctionInfo* functionInfo = GetFunctionInfoFromId(this->corProfilerInfo, functionId);

    if (functionInfo == NULL)
    {
        return S_OK;
    }

    ILWriter* ilWriter = new ILWriter(this->corProfilerInfo, functionInfo);

    if (ilWriter == nullptr)
    {
        return E_FAIL;
    }

    if (ilWriter->Write())
    {
        hasInserted = true;
    }

    return S_OK;
}