Skip to content

Remove hotswapping support from cranelift-jit#10345

Merged
alexcrichton merged 2 commits intobytecodealliance:mainfrom
bjorn3:remove_cranelift_jit_hotswap
Mar 6, 2025
Merged

Remove hotswapping support from cranelift-jit#10345
alexcrichton merged 2 commits intobytecodealliance:mainfrom
bjorn3:remove_cranelift_jit_hotswap

Conversation

@bjorn3
Copy link
Copy Markdown
Contributor

@bjorn3 bjorn3 commented Mar 6, 2025

It was originally introduced for cg_clif. cg_clif recently removed it's use of hotswapping as the way it is implemented in cranelift-jit has various issues like leaking memory, panicking when the memory allocator decided to put two functions more than 2GB away from each other and only supporting x86_64. Better hotswapping support will likely require a fundamentally different implementation.

Also fix a bug that prevents cg_clif from switching to is_pic=false for the jit mode.

cc #2735

bjorn3 added 2 commits March 6, 2025 15:52
It was originally introduced for cg_clif. cg_clif recently removed
it's use of hotswapping as the way it is implemented in cranelift-jit
has various issues like leaking memory, panicking when the memory
allocator decided to put two functions more than 2GB away from each
other and only supporting x86_64. Better hotswapping support will likely
require a fundamentally different implementation.
@bjorn3 bjorn3 requested a review from a team as a code owner March 6, 2025 16:08
@bjorn3 bjorn3 requested review from abrown and removed request for a team March 6, 2025 16:08
@bjorn3
Copy link
Copy Markdown
Contributor Author

bjorn3 commented Mar 6, 2025

If the second commit could be backported to the release-31.0.0 branch that would be appreciated.

@alexcrichton
Copy link
Copy Markdown
Member

For the backport I think that's reasonable, would you be ok sending a PR yourself? (no need for a subset of folks to send backports to older branches, it's ok for anyone to open a PR to the branch)

@bjorn3
Copy link
Copy Markdown
Contributor Author

bjorn3 commented Mar 6, 2025

Opened #10347

Copy link
Copy Markdown
Member

@abrown abrown left a comment

Choose a reason for hiding this comment

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

This change seems sensible to me but I'll let @alexcrichton comment as well since he's here.

@alexcrichton alexcrichton added this pull request to the merge queue Mar 6, 2025
Merged via the queue into bytecodealliance:main with commit 27de1e0 Mar 6, 2025
39 checks passed
@bjorn3 bjorn3 deleted the remove_cranelift_jit_hotswap branch March 6, 2025 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants