3 ms·
doesnt rustc rely on LLVM to generate its assembly. i watch the webrender repo and there have been several issues about poor codegen that LLVM could not properl
by leeoniya 9y ago
doesnt rustc rely on LLVM to generate its assembly. i watch the webrender repo and there have been several issues about poor codegen that LLVM could not properly handle. some were also related to absent optimizations at the MIR level.
also would that mean that the asm snippets could change as llvm changes and possibly cause security bugs if not carefully hand-audited/tweaked anyhow?
- Confiks 9y agoThe blog post doesn't explain it very well, but I believe the tool code-generates the assembly at runtime, and not at compile time, so LLVM is not involved in code generation for the JIT.
- masklinn 9y agoSince it sounds very similar to RPython it probably does both: it generates a regular (native) interpreter, and generates and merges a JIT inside that interpreter (with all that implies of e.g. tracing and runtime code generation).
- steveklabnik 9y agoRustc does, but it doesn't appear to me that holyjit does, that is https://github.com/nbp/holyjit/blob/master/lib/src/compile.rs https://github.com/nbp/holyjit/blob/master/lib/src/compile.r... and https://github.com/nbp/holyjit/blob/master/lib/src/lib.rs#L16-L19 https://github.com/nbp/holyjit/blob/master/lib/src/lib.rs#L1... Basically, it seems (and I haven't fully digested the code yet) that it uses https://crates.io/crates/dynasmrt https://crates.io/crates/dynasmrt for codegen.
- tbodt 9y agoLooks like dynasmrt was written for use in holyjit.
- steveklabnik 9y agoQuite possibly! It's the first I'm hearing of it. It's very interesting...