YJIT: Inline return address callback (#7198)
This makes it so that the generator and the output code read in the same order. I think it reads better this way.
This commit is contained in:
parent
cb06006213
commit
e1ffafb285
Notes:
git
2023-01-30 17:50:30 +00:00
Merged-By: maximecb <maximecb@ruby-lang.org>
@ -4872,21 +4872,6 @@ fn gen_send_cfunc(
|
|||||||
EndBlock
|
EndBlock
|
||||||
}
|
}
|
||||||
|
|
||||||
fn gen_return_branch(
|
|
||||||
asm: &mut Assembler,
|
|
||||||
target0: CodePtr,
|
|
||||||
_target1: Option<CodePtr>,
|
|
||||||
shape: BranchShape,
|
|
||||||
) {
|
|
||||||
match shape {
|
|
||||||
BranchShape::Next0 | BranchShape::Next1 => unreachable!(),
|
|
||||||
BranchShape::Default => {
|
|
||||||
asm.comment("update cfp->jit_return");
|
|
||||||
asm.mov(Opnd::mem(64, CFP, RUBY_OFFSET_CFP_JIT_RETURN), Opnd::const_ptr(target0.raw_ptr()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Pushes arguments from an array to the stack that are passed with a splat (i.e. *args)
|
/// Pushes arguments from an array to the stack that are passed with a splat (i.e. *args)
|
||||||
/// It optimistically compiles to a static size that is the exact number of arguments
|
/// It optimistically compiles to a static size that is the exact number of arguments
|
||||||
/// needed for the function.
|
/// needed for the function.
|
||||||
@ -5609,7 +5594,15 @@ fn gen_send_iseq(
|
|||||||
&return_ctx,
|
&return_ctx,
|
||||||
None,
|
None,
|
||||||
None,
|
None,
|
||||||
gen_return_branch,
|
|asm, target0, _target1, shape| {
|
||||||
|
match shape {
|
||||||
|
BranchShape::Default => {
|
||||||
|
asm.comment("update cfp->jit_return");
|
||||||
|
asm.mov(Opnd::mem(64, CFP, RUBY_OFFSET_CFP_JIT_RETURN), Opnd::const_ptr(target0.raw_ptr()));
|
||||||
|
}
|
||||||
|
_ => unreachable!()
|
||||||
|
}
|
||||||
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
//print_str(cb, "calling Ruby func:");
|
//print_str(cb, "calling Ruby func:");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user