Skip to content

Delete CodeHeapReserveForJumpStubs - #135411

Merged
jkotas merged 4 commits into
dotnet:mainfrom
jkotas:jkotas-jump-stub-reserve-cleanup
Oct 13, 2026
Merged

jkotas merged 4 commits into
dotnet:mainfrom
jkotas:jkotas-jump-stub-reserve-cleanup

Conversation

@jkotas

@jkotas jkotas commented Oct 8, 2026

Copy link
Copy Markdown
Member

With the new precode design, we do not need to guarantee jumpstubs allocation succeeds anymore. All jump stub allocation can retry in the very rare case we are not able to find memory for the jump stub in the right range.

With the new precode design, we do not need to guarantee jumpstubs allocation succeeds anymore. All jump stub allocation can retry in the very rare case we are not able to find memory for the jump stub in the right range.
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @agocke
See info in area-owners.md if you want to be subscribed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The jump-stub design document still describes the removed settings and fatal failure behavior.

1 open finding
What changed in this PR

Reworks jump-stub allocation failures to retry instead of relying on reserved code-heap space or fatal range-specific OOM handling.

Changes:

  • Removes jump-stub heap reservations, configuration switches, and dedicated OOM resources.
  • Propagates allocation failure as NULL so JIT compilation can retry.
  • Adds AMD64 dynamic-helper emission retries at new addresses.
File Description
src/​coreclr/​vm/​threads.h Removes a redundant access specifier.
src/​coreclr/​vm/​jitinterface.cpp Adapts relocation handling to nullable jump-stub allocation.
src/​coreclr/​vm/​dynamicmethod.cpp Returns failure for unsatisfied ranged allocations.
src/​coreclr/​vm/​codeman.h Simplifies allocation state and jump-stub APIs.
src/​coreclr/​vm/​codeman.cpp Removes reservations and fatal range-OOM handling.
src/​coreclr/​vm/​amd64/​cgencpu.h Updates the AMD64 relocation helper contract.
src/​coreclr/​vm/​amd64/​cgenamd64.cpp Retries dynamic-helper emission after allocation failure.
src/​coreclr/​pal/​src/​map/​virtual.cpp Updates executable-memory reservation commentary.
src/​coreclr/​inc/​clrconfigvalues.h Removes obsolete jump-stub settings.
src/​coreclr/​dlls/​mscorrc/​resource.h Removes the range-OOM resource identifier.
src/​coreclr/​dlls/​mscorrc/​mscorrc.rc Removes the corresponding error message.
src/​coreclr/​debug/​daccess/​fntableaccess.h Keeps the diagnostic heap-layout mirror synchronized.

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

Comment thread src/coreclr/inc/clrconfigvalues.h Resolved
Comment thread src/coreclr/vm/amd64/cgenamd64.cpp Resolved
Comment thread src/coreclr/vm/jitinterface.cpp Resolved

@pcshrosbree pcshrosbree left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Built Checked clr and the readytorun tests on linux-x64 at e8fae2e. All 24 pass on this head and the merge-base, with and without DOTNET_ForceRelocs=1. With injected jump-stub failures, every dynamic-helper retry moved to a new address and ended within about 1 KB.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

CoreCLR code-allocation and retry semantics span several architectures and require final maintainer validation.

0 open findings

1 resolved since last review

🧠 Review effort: Balanced

Comment thread src/coreclr/vm/amd64/cgenamd64.cpp Resolved
Comment thread src/coreclr/vm/amd64/cgenamd64.cpp Resolved
Comment thread src/coreclr/vm/codeman.cpp Resolved
Co-authored-by: Aaron R Robinson <arobins@microsoft.com>
@jkotas

jkotas commented Oct 12, 2026

Copy link
Copy Markdown
Member Author

/azp run runtime-coreclr r2r-extra

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@jkotas

jkotas commented Oct 13, 2026

Copy link
Copy Markdown
Member Author

/ba-g failure is known issue #132291

@jkotas
jkotas merged commit bea720f into dotnet:main Oct 13, 2026
116 of 121 checks passed
@jkotas
jkotas deleted the jkotas-jump-stub-reserve-cleanup branch October 14, 2026 03:35
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Oct 14, 2026
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.

4 participants