-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[clr-ios] Guard code-versioning paths with FEATURE_CODE_VERSIONING
#120812
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[clr-ios] Guard code-versioning paths with FEATURE_CODE_VERSIONING
#120812
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR guards code-versioning, ReJIT, and related debugger/DAC paths with FEATURE_CODE_VERSIONING, adding stubs that return E_NOTIMPL when the feature is absent to prevent build errors on Apple mobile targets where tiered compilation (and thus code versioning) is disabled.
- Adds FEATURE_CODE_VERSIONING conditionals around code-versioning logic in perfmap, JIT interface, ETW events, debugger, DAC, and RS (debugger) components.
- Introduces E_NOTIMPL fallbacks for APIs that depend on code versioning when the feature is not compiled.
- Adjusts data structures and class members to compile cleanly without code versioning support.
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
src/coreclr/vm/perfmap.cpp | Wraps native code version resolution in FEATURE_CODE_VERSIONING. |
src/coreclr/vm/jitinterface.cpp | Guards helper resolution logic that depends on code versioning. |
src/coreclr/vm/eventtrace.cpp | Adds conditional emission of IL-to-native map and rich debug info events. |
src/coreclr/inc/dacvars.h | Exposes a DAC variable only when code versioning is enabled. |
src/coreclr/debug/inc/dbgipcevents.h | Guards VMPTRs for versioning nodes. |
src/coreclr/debug/inc/dacdbiinterface.h | Conditionally declares IL/native code version node accessors. |
src/coreclr/debug/ee/functioninfo.cpp | Gates IL map selection and fixes a variable name in a fallback path. |
src/coreclr/debug/ee/debugger.h | Makes helper method private/public only when feature enabled. |
src/coreclr/debug/ee/debugger.cpp | Adds guarded behavior and E_NOTIMPL stubs for deoptimization APIs. |
src/coreclr/debug/di/rsthread.cpp | Guards ReJIT IL code access in value enumeration and frame construction. |
src/coreclr/debug/di/rsstackwalk.cpp | Conditionally fetches ReJIT IL code during stack walking. |
src/coreclr/debug/di/rspriv.h | Wraps ReJIT-related forward declarations and members. |
src/coreclr/debug/di/rsfunction.cpp | Guards ReJIT IL code table and related methods; adds E_NOTIMPL fallback. |
src/coreclr/debug/di/module.cpp | Wraps CordbReJitILCode implementation. |
src/coreclr/debug/daccess/request.cpp | Adds guarded implementations with E_NOTIMPL fallbacks for ReJIT queries. |
src/coreclr/debug/daccess/dacdbiimpl.h | Moves versioning-related declarations under feature flag. |
src/coreclr/debug/daccess/dacdbiimpl.cpp | Segregates versioning node accessors and reintroduces stubs outside the guard. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Tagging subscribers to this area: @mangod9 |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
src/coreclr/vm/eventtrace.cpp
Outdated
ETW::EnumerationLog::EnumerationStructs::JitMethodILToNativeMap, | ||
pNativeCodeStartAddress, | ||
pConfig->GetCodeVersion().GetVersionId(), | ||
0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we this ifdef smaller e.g. by storing the arg in a local and just ifdef the local?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GetILCodeVersionId
returns 0 when not FEATURE_CODE_VERSIONING
, so these ifdefs were removed.
Co-authored-by: Aaron Robinson <arobins@microsoft.com>
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
|
||
return hr; | ||
#else | ||
return E_NOTIMPL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can succeed with returning *pcMethodDescs = 0;
|
||
HRESULT ClrDataAccess::GetProfilerModifiedILInformation(CLRDATA_ADDRESS methodDesc, struct DacpProfilerILData *pILData) | ||
{ | ||
#ifdef FEATURE_CODE_VERSIONING |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This ifdef can be smaller (just CodeVersionManager* pCodeVersionManager = pMD->GetCodeVersionManager();
block) so that the method succeeds as if there was no code versioning event.
} | ||
} | ||
|
||
#ifdef FEATURE_CODE_VERSIONING |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is ifdeing code unrelated to the code versioning now. The ifdef should be smaller so that the logging still works as if there was no code versioning event.
m_pReJitCode->ExternalAddRef(); | ||
} | ||
#else | ||
return E_NOTIMPL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return NULL instead of E_NOTIMPL
?
|
||
return hr; | ||
#else | ||
return E_NOTIMPL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this just return pReJitData->flags = DacpReJitData2::kActive;
- same as with no code versioning?
|
||
return hr; | ||
#else | ||
return E_NOTIMPL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return *pRejitId = -1;
and hr = S_FALSE;
?
Description
This PR updates code-versioning and debugger/DAC paths with
FEATURE_CODE_VERSIONING
and provides stubs where needed. Code versioning was moved under tiered compilation in #120583, which is disabled for Apple mobile targets that caused build errors.