RISC-V: move block compilation behind trait
- closes RV-582
What
Introduce a DispatchTarget to wrap the function pointer, and move compilation behind the trait.
Why
This allows OutlineJit to be introduced in future (where the function pointer/Cell will be replaced with an AtomicPtr for thread safety), without requiring any further changes to the block.rs file
How
Jitted block is made generic over the DispatchCompiler trait.
Manually Testing
make -C src/riscv all
Benchmarking
No performance changes were detected on the benchmark machine.
Tasks for the Author
-
Link all Linear issues related to this MR using magic words (e.g. part of, relates to, closes). -
Eliminate dead code and other spurious artefacts introduced in your changes. -
Document new public functions, methods and types. -
Make sure the documentation for updated functions, methods, and types is correct. -
Add tests for bugs that have been fixed. -
Put in reasonable effort to ensure that CI will pass. make -C src/riscvdune build src/lib_riscvdune build src/rust_deps
-
Benchmark performance and populate the table above if needed. -
Explain changes to regression test captures when applicable. -
Write commit messages to reflect the changes they're about. -
Self-review your changes to ensure they are high-quality. -
Complete all of the above before assigning this MR to reviewers.
Edited by Emma Turner