8000 ZJIT: Inline well-known C functions into HIR by tekknolagi · Pull Request #14679 · ruby/ruby · GitHub
[go: up one dir, main page]

Skip to content

Conversation

tekknolagi
Copy link
Contributor
@tekknolagi tekknolagi commented Sep 30, 2025

Add the ability to create a Rust function that "open-codes" HIR
implementations of specific well-known C functions, starting with
String#to_s. It supports emitting multiple instructions into a
temporary block, but does not support emitting new blocks (yet?).

@tekknolagi tekknolagi force-pushed the mb-inline-cfunc-2 branch 2 times, most recently from 4fafe7e to 34d9eaf Compare October 1, 2025 14:32
@tekknolagi tekknolagi marked this pull request as ready for review October 1, 2025 15:01
@matzbot matzbot requested a review from a team October 1, 2025 15:01

fn inline_kernel_itself(_fun: &mut hir::Function, _block: hir::BlockId, recv: hir::InsnId, args: &[hir::InsnId], _state: hir::InsnId) -> Option<hir::InsnId> {
if args.len() == 0 {
// No need to coerce the receiver; that is done by the SendWithoutBlock rewriting.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// No need to coerce the receiver; that is done by the SendWithoutBlock rewriting.

itself doesn't do any coercion in any caes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In this case it does; it's a guard that the lhs is the expected type so that we can continue to inline the same method on it

Add the ability to create a Rust function that "open-codes" HIR
implementations of specific well-known C functions, starting with
`String#to_s`. It supports emitting multiple instructions into a
temporary block, but does not support emitting *new blocks* (yet?).
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

0