diff options
Diffstat (limited to 'src/vm/proftoeeinterfaceimpl.cpp')
-rw-r--r-- | src/vm/proftoeeinterfaceimpl.cpp | 65 |
1 files changed, 61 insertions, 4 deletions
diff --git a/src/vm/proftoeeinterfaceimpl.cpp b/src/vm/proftoeeinterfaceimpl.cpp index b5ade592f7..309fb085f5 100644 --- a/src/vm/proftoeeinterfaceimpl.cpp +++ b/src/vm/proftoeeinterfaceimpl.cpp @@ -6790,6 +6790,63 @@ HRESULT ProfToEEInterfaceImpl::GetCodeInfo4(UINT_PTR pNativeCodeStartAddress, codeInfos); } +HRESULT ProfToEEInterfaceImpl::RequestReJITWithInliners( + DWORD dwRejitFlags, + ULONG cFunctions, + ModuleID moduleIds[], + mdMethodDef methodIds[]) +{ + CONTRACTL + { + NOTHROW; + GC_TRIGGERS; + MODE_ANY; + CAN_TAKE_LOCK; + PRECONDITION(CheckPointer(moduleIds, NULL_OK)); + PRECONDITION(CheckPointer(methodIds, NULL_OK)); + } + CONTRACTL_END; + + PROFILER_TO_CLR_ENTRYPOINT_SYNC_EX( + kP2EETriggers | kP2EEAllowableAfterAttach, + (LF_CORPROF, + LL_INFO1000, + "**PROF: RequestReJITWithInliners.\n")); + + if (!g_profControlBlock.pProfInterface->IsCallback4Supported()) + { + return CORPROF_E_CALLBACK4_REQUIRED; + } + + if (!CORProfilerEnableRejit()) + { + return CORPROF_E_REJIT_NOT_ENABLED; + } + + if (!ReJitManager::IsReJITInlineTrackingEnabled()) + { + return CORPROF_E_REJIT_INLINING_DISABLED; + } + + // Request at least 1 method to reJIT! + if ((cFunctions == 0) || (moduleIds == NULL) || (methodIds == NULL)) + { + return E_INVALIDARG; + } + + // We only support disabling inlining currently + if ((dwRejitFlags & COR_PRF_REJIT_BLOCK_INLINING) != COR_PRF_REJIT_BLOCK_INLINING) + { + return E_INVALIDARG; + } + + // Remember the profiler is doing this, as that means we must never detach it! + g_profControlBlock.pProfInterface->SetUnrevertiblyModifiedILFlag(); + + GCX_PREEMP(); + return ReJitManager::RequestReJIT(cFunctions, moduleIds, methodIds, static_cast<COR_PRF_REJIT_FLAGS>(dwRejitFlags)); +} + /* * GetObjectReferences * @@ -8645,7 +8702,7 @@ HRESULT ProfToEEInterfaceImpl::RequestReJIT(ULONG cFunctions, // in g_profControlBlock.pProfInterface->SetUnrevertiblyModifiedILFlag(); GCX_PREEMP(); - return ReJitManager::RequestReJIT(cFunctions, moduleIds, methodIds); + return ReJitManager::RequestReJIT(cFunctions, moduleIds, methodIds, static_cast<COR_PRF_REJIT_FLAGS>(0)); } HRESULT ProfToEEInterfaceImpl::RequestRevert(ULONG cFunctions, // in @@ -9650,7 +9707,7 @@ HRESULT ProfToEEInterfaceImpl::EnumNgenModuleMethodsInliningThisMethod( return CORPROF_E_DATAINCOMPLETE; } - if (!inlinersModule->HasInlineTrackingMap()) + if (!inlinersModule->HasNativeOrReadyToRunInlineTrackingMap()) { return CORPROF_E_DATAINCOMPLETE; } @@ -9663,14 +9720,14 @@ HRESULT ProfToEEInterfaceImpl::EnumNgenModuleMethodsInliningThisMethod( EX_TRY { // Trying to use static buffer - COUNT_T methodsAvailable = inlinersModule->GetInliners(inlineeOwnerModule, inlineeMethodId, staticBufferSize, staticBuffer, incompleteData); + COUNT_T methodsAvailable = inlinersModule->GetNativeOrReadyToRunInliners(inlineeOwnerModule, inlineeMethodId, staticBufferSize, staticBuffer, incompleteData); // If static buffer is not enough, allocate an array. if (methodsAvailable > staticBufferSize) { DWORD dynamicBufferSize = methodsAvailable; dynamicBuffer = methodsBuffer = new MethodInModule[dynamicBufferSize]; - methodsAvailable = inlinersModule->GetInliners(inlineeOwnerModule, inlineeMethodId, dynamicBufferSize, dynamicBuffer, incompleteData); + methodsAvailable = inlinersModule->GetNativeOrReadyToRunInliners(inlineeOwnerModule, inlineeMethodId, dynamicBufferSize, dynamicBuffer, incompleteData); if (methodsAvailable > dynamicBufferSize) { _ASSERTE(!"Ngen image inlining info changed, this shouldn't be possible."); |