bjorn3 opened PR #2403 from simplejit_hot_swapping
to main
:
This makes it possible to change functions when using SimpleJIT without having to recompile everything or even restart the jitted code. When a changed function is currently on the stack, the old version will be returned to, but all new calls will be redirected to the new version. It is not yet possible to swap data objects.
This is a prerequisite of https://github.com/bjorn3/rustc_codegen_cranelift/issues/1087.
I have tested this PR by implementing lazy compilation in cg_clif as suggested by @flodiebold in https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/cranelift.20backend.20work/near/187645798 in February.
r? @pchickey (By the way, is it deliberate that you are marked as unavailable on zulip? I sent you a PM)
cc https://bytecodealliance.zulipchat.com/#narrow/stream/217117-cranelift/topic/hot.20code.20swapping.20for.20simplejit/near/216403611
bjorn3 updated PR #2403 from simplejit_hot_swapping
to main
:
This makes it possible to change functions when using SimpleJIT without having to recompile everything or even restart the jitted code. When a changed function is currently on the stack, the old version will be returned to, but all new calls will be redirected to the new version. It is not yet possible to swap data objects.
This is a prerequisite of https://github.com/bjorn3/rustc_codegen_cranelift/issues/1087.
I have tested this PR by implementing lazy compilation in cg_clif as suggested by @flodiebold in https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/cranelift.20backend.20work/near/187645798 in February.
r? @pchickey (By the way, is it deliberate that you are marked as unavailable on zulip? I sent you a PM)
cc https://bytecodealliance.zulipchat.com/#narrow/stream/217117-cranelift/topic/hot.20code.20swapping.20for.20simplejit/near/216403611
bjorn3 updated PR #2403 from simplejit_hot_swapping
to main
:
This makes it possible to change functions when using SimpleJIT without having to recompile everything or even restart the jitted code. When a changed function is currently on the stack, the old version will be returned to, but all new calls will be redirected to the new version. It is not yet possible to swap data objects.
This is a prerequisite of https://github.com/bjorn3/rustc_codegen_cranelift/issues/1087.
I have tested this PR by implementing lazy compilation in cg_clif as suggested by @flodiebold in https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/cranelift.20backend.20work/near/187645798 in February.
r? @pchickey (By the way, is it deliberate that you are marked as unavailable on zulip? I sent you a PM)
cc https://bytecodealliance.zulipchat.com/#narrow/stream/217117-cranelift/topic/hot.20code.20swapping.20for.20simplejit/near/216403611
pchickey requested pchickey for a review on PR #2403.
pchickey submitted PR Review.
pchickey submitted PR Review.
pchickey created PR Review Comment:
I'm not clear on how 16 bytes was arrived at, and how platform specific this is - is it due to 16-byte alignment on x86_64? does some other sequence of instructions have to fit in here besides the plt_val at line 179?
pchickey edited PR Review Comment.
bjorn3 submitted PR Review.
bjorn3 created PR Review Comment:
In the future I may extend it to be more like the lazy symbol binding used by ELF. In that case the GOT entry will initially point just after the jump instruction in the PLT. After this jump instruction it pushes a specific value to the stack depending on which PLT entry it is and then it jumps to a function common between all entries in a module. This function then resolves the symbol. This avoids having to create a new wrapper function for each lazily compiled function.
bjorn3 updated PR #2403 from simplejit_hot_swapping
to main
:
This makes it possible to change functions when using SimpleJIT without having to recompile everything or even restart the jitted code. When a changed function is currently on the stack, the old version will be returned to, but all new calls will be redirected to the new version. It is not yet possible to swap data objects.
This is a prerequisite of https://github.com/bjorn3/rustc_codegen_cranelift/issues/1087.
I have tested this PR by implementing lazy compilation in cg_clif as suggested by @flodiebold in https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/cranelift.20backend.20work/near/187645798 in February.
r? @pchickey (By the way, is it deliberate that you are marked as unavailable on zulip? I sent you a PM)
cc https://bytecodealliance.zulipchat.com/#narrow/stream/217117-cranelift/topic/hot.20code.20swapping.20for.20simplejit/near/216403611
pchickey submitted PR Review.
pchickey created PR Review Comment:
That makes sense. a comment to this effect would be appreciated :)
pchickey submitted PR Review.
bjorn3 updated PR #2403 from simplejit_hot_swapping
to main
:
This makes it possible to change functions when using SimpleJIT without having to recompile everything or even restart the jitted code. When a changed function is currently on the stack, the old version will be returned to, but all new calls will be redirected to the new version. It is not yet possible to swap data objects.
This is a prerequisite of https://github.com/bjorn3/rustc_codegen_cranelift/issues/1087.
I have tested this PR by implementing lazy compilation in cg_clif as suggested by @flodiebold in https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/cranelift.20backend.20work/near/187645798 in February.
r? @pchickey (By the way, is it deliberate that you are marked as unavailable on zulip? I sent you a PM)
cc https://bytecodealliance.zulipchat.com/#narrow/stream/217117-cranelift/topic/hot.20code.20swapping.20for.20simplejit/near/216403611
bjorn3 updated PR #2403 from simplejit_hot_swapping
to main
:
This makes it possible to change functions when using SimpleJIT without having to recompile everything or even restart the jitted code. When a changed function is currently on the stack, the old version will be returned to, but all new calls will be redirected to the new version. It is not yet possible to swap data objects.
This is a prerequisite of https://github.com/bjorn3/rustc_codegen_cranelift/issues/1087.
I have tested this PR by implementing lazy compilation in cg_clif as suggested by @flodiebold in https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/cranelift.20backend.20work/near/187645798 in February.
r? @pchickey (By the way, is it deliberate that you are marked as unavailable on zulip? I sent you a PM)
cc https://bytecodealliance.zulipchat.com/#narrow/stream/217117-cranelift/topic/hot.20code.20swapping.20for.20simplejit/near/216403611
bjorn3 updated PR #2403 from simplejit_hot_swapping
to main
:
This makes it possible to change functions when using SimpleJIT without having to recompile everything or even restart the jitted code. When a changed function is currently on the stack, the old version will be returned to, but all new calls will be redirected to the new version. It is not yet possible to swap data objects.
This is a prerequisite of https://github.com/bjorn3/rustc_codegen_cranelift/issues/1087.
I have tested this PR by implementing lazy compilation in cg_clif as suggested by @flodiebold in https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/cranelift.20backend.20work/near/187645798 in February.
r? @pchickey (By the way, is it deliberate that you are marked as unavailable on zulip? I sent you a PM)
cc https://bytecodealliance.zulipchat.com/#narrow/stream/217117-cranelift/topic/hot.20code.20swapping.20for.20simplejit/near/216403611
bjorn3 updated PR #2403 from simplejit_hot_swapping
to main
:
This makes it possible to change functions when using SimpleJIT without having to recompile everything or even restart the jitted code. When a changed function is currently on the stack, the old version will be returned to, but all new calls will be redirected to the new version. It is not yet possible to swap data objects.
This is a prerequisite of https://github.com/bjorn3/rustc_codegen_cranelift/issues/1087.
I have tested this PR by implementing lazy compilation in cg_clif as suggested by @flodiebold in https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/cranelift.20backend.20work/near/187645798 in February.
r? @pchickey (By the way, is it deliberate that you are marked as unavailable on zulip? I sent you a PM)
cc https://bytecodealliance.zulipchat.com/#narrow/stream/217117-cranelift/topic/hot.20code.20swapping.20for.20simplejit/near/216403611
pchickey merged PR #2403.
Last updated: Dec 23 2024 at 12:05 UTC