Skip to content

[cDAC] Use BinaryThenLinearSearch in GetExceptionClauses#125667

Merged
max-charlamb merged 1 commit intodotnet:mainfrom
max-charlamb:dev/maxcharlamb/runtime-cdac-binary-search
Mar 17, 2026
Merged

[cDAC] Use BinaryThenLinearSearch in GetExceptionClauses#125667
max-charlamb merged 1 commit intodotnet:mainfrom
max-charlamb:dev/maxcharlamb/runtime-cdac-binary-search

Conversation

@max-charlamb
Copy link
Member

@max-charlamb max-charlamb commented Mar 17, 2026

Refactor GetExceptionClauses in ReadyToRunJitManager to use the shared BinaryThenLinearSearch helper instead of an inline binary+linear search, reducing code duplication.

The behavior is identical — same threshold (10), same midpoint calculation, same branch direction, same first-match semantics.

Copilot AI review requested due to automatic review settings March 17, 2026 17:53
@max-charlamb max-charlamb changed the title cDAC: Use BinaryThenLinearSearch in GetExceptionClauses [cDAC] Use BinaryThenLinearSearch in GetExceptionClauses Mar 17, 2026
@max-charlamb max-charlamb requested a review from rcj1 March 17, 2026 17:54
@dotnet-policy-service
Copy link
Contributor

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

Refactor GetExceptionClauses in ReadyToRunJitManager to use the shared
BinaryThenLinearSearch helper instead of an inline binary+linear search,
reducing code duplication.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@max-charlamb max-charlamb force-pushed the dev/maxcharlamb/runtime-cdac-binary-search branch from 981905e to e3bbd8d Compare March 17, 2026 17:55
Copy link
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

Updates cDAC developer workflow documentation and refactors a ReadyToRun exception lookup search to use a shared helper, improving maintainability while keeping the same behavior.

Changes:

  • Add a checked-in cdac.slnx solution file under src/native/managed/cdac/ covering cDAC projects and tests.
  • Update cDAC README instructions to reference the in-directory cdac.slnx instead of asking developers to create one in the repo root.
  • Replace a bespoke binary-then-linear search implementation with BinaryThenLinearSearch.Search in the ReadyToRun JIT manager.

Reviewed changes

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

File Description
src/native/managed/cdac/README.md Updates unit testing instructions to use the committed cdac.slnx in the cDAC directory.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/ExecutionManager/ExecutionManagerCore.ReadyToRunJitManager.cs Refactors exception lookup table searching to reuse BinaryThenLinearSearch.
src/native/managed/cdac/cdac.slnx New solution file to load all cDAC projects and test projects in VS/VS Code.

@max-charlamb max-charlamb enabled auto-merge (squash) March 17, 2026 18:37
@max-charlamb
Copy link
Member Author

/ba-g cDAC only change and cDAC tests passed

@max-charlamb max-charlamb merged commit 5b3d729 into dotnet:main Mar 17, 2026
42 of 50 checks passed
@max-charlamb max-charlamb deleted the dev/maxcharlamb/runtime-cdac-binary-search branch March 17, 2026 19:57
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