Skip to content

[cDAC] Implement AreOptimizationsDisabled for cDAC#128672

Merged
barosiak merged 5 commits into
dotnet:mainfrom
barosiak:barosiak/AreOptimizationsDisabled
May 29, 2026
Merged

[cDAC] Implement AreOptimizationsDisabled for cDAC#128672
barosiak merged 5 commits into
dotnet:mainfrom
barosiak:barosiak/AreOptimizationsDisabled

Conversation

@barosiak
Copy link
Copy Markdown
Member

Summary

Implements AreOptimizationsDisabled in the cDAC.

Changes

  • Implemented AreOptimizationsDisabled in DacDbiImpl with #if DEBUG legacy validation
  • Added Deoptimized field to ILCodeVersionNode data descriptors and managed data class
  • Added IsDeoptimized to IReJIT contract interface and implementation
  • Added tests and updated ReJIT.md documentation

@barosiak barosiak self-assigned this May 27, 2026
Copilot AI review requested due to automatic review settings May 27, 2026 23:25
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag
See info in area-owners.md if you want to be subscribed.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Implements AreOptimizationsDisabled in the cDAC DacDbiImpl so it no longer needs to fall back to the legacy implementation, and adds the supporting IReJIT.IsDeoptimized contract API plus an ILCodeVersionNode.Deoptimized data field.

Changes:

  • Add IsDeoptimized to IReJIT and implement it in ReJIT_1 mirroring ILCodeVersion::IsDeoptimized (synthetic → false; explicit → node field).
  • Expose ILCodeVersionNode::m_deoptimized via a new data descriptor entry and managed ILCodeVersionNode.Deoptimized property.
  • Implement DacDbiImpl.AreOptimizationsDisabled using cDAC contracts (with #if DEBUG validation against the legacy implementation) and add unit tests for both the contract and DacDbi paths.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/coreclr/vm/codeversion.h Adds cdac_data<ILCodeVersionNode>::Deoptimized offset entry.
src/coreclr/vm/datadescriptor/datadescriptor.inc Adds Deoptimized field to the ILCodeVersionNode data descriptor (typed T_BOOL).
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Contracts/IReJIT.cs Adds default IsDeoptimized method on the IReJIT contract.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/ReJIT_1.cs Implements IsDeoptimized for the c1 contract version.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Data/ILCodeVersionNode.cs Reads the new Deoptimized field as uint and exposes it as bool.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/DacDbiImpl.cs Implements AreOptimizationsDisabled via contracts with debug-time legacy cross-check.
src/native/managed/cdac/tests/MockDescriptors/MockDescriptors.CodeVersions.cs Adds Deoptimized field to mock ILCodeVersionNode layout/builder.
src/native/managed/cdac/tests/MockDescriptors/MockDescriptors.ReJIT.cs Plumbs deoptimized parameter through AddExplicitILCodeVersionNode.
src/native/managed/cdac/tests/ReJITTests.cs New tests for synthetic/explicit IsDeoptimized behavior.
src/native/managed/cdac/tests/DacDbiImplTests.cs New tests covering null-output, invalid token, null MethodDesc, and deoptimized/not-deoptimized paths for AreOptimizationsDisabled.
docs/design/datacontracts/ReJIT.md Documents the new IsDeoptimized API and Deoptimized field.

Comment thread src/coreclr/vm/datadescriptor/datadescriptor.inc Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 28, 2026 19:41
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Copilot AI review requested due to automatic review settings May 28, 2026 20:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 28, 2026 21:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.

@barosiak
Copy link
Copy Markdown
Member Author

/ba-g unrelated preexisting infrastructure failures

@barosiak barosiak merged commit 675aea5 into dotnet:main May 29, 2026
114 of 127 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants