ruby-changes:73210
From: Maxime <ko1@a...>
Date: Tue, 30 Aug 2022 01:00:26 +0900 (JST)
Subject: [ruby-changes:73210] fd97f8ebc7 (master): Use frame_setup() and frame_teardown()
https://git.ruby-lang.org/ruby.git/commit/?id=fd97f8ebc7 From fd97f8ebc7f22df7e3a7bf05c5d9328946cb539e Mon Sep 17 00:00:00 2001 From: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@s...> Date: Tue, 19 Jul 2022 11:45:46 -0400 Subject: Use frame_setup() and frame_teardown() --- yjit/src/codegen.rs | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/yjit/src/codegen.rs b/yjit/src/codegen.rs index 17b5b09698..6d4ac72433 100644 --- a/yjit/src/codegen.rs +++ b/yjit/src/codegen.rs @@ -398,6 +398,8 @@ fn gen_code_for_exit_from_stub(ocb: &mut OutlinedCb) -> CodePtr { https://github.com/ruby/ruby/blob/trunk/yjit/src/codegen.rs#L398 asm.cpop_into(EC); asm.cpop_into(CFP); + asm.frame_teardown(); + asm.cret(Qundef.into()); asm.compile(ocb); @@ -447,6 +449,8 @@ fn gen_exit(exit_pc: *mut VALUE, ctx: &Context, asm: &mut Assembler) { https://github.com/ruby/ruby/blob/trunk/yjit/src/codegen.rs#L449 asm.cpop_into(EC); asm.cpop_into(CFP); + asm.frame_teardown(); + asm.cret(Qundef.into()); } @@ -531,6 +535,8 @@ fn gen_full_cfunc_return(ocb: &mut OutlinedCb) -> CodePtr { https://github.com/ruby/ruby/blob/trunk/yjit/src/codegen.rs#L535 asm.cpop_into(EC); asm.cpop_into(CFP); + asm.frame_teardown(); + asm.cret(Qundef.into()); asm.compile(ocb); @@ -555,6 +561,8 @@ fn gen_leave_exit(ocb: &mut OutlinedCb) -> CodePtr { https://github.com/ruby/ruby/blob/trunk/yjit/src/codegen.rs#L561 asm.cpop_into(EC); asm.cpop_into(CFP); + asm.frame_teardown(); + asm.cret(C_RET_OPND); asm.compile(ocb); @@ -584,6 +592,8 @@ fn gen_pc_guard(asm: &mut Assembler, iseq: IseqPtr, insn_idx: u32) { https://github.com/ruby/ruby/blob/trunk/yjit/src/codegen.rs#L592 asm.cpop_into(EC); asm.cpop_into(CFP); + asm.frame_teardown(); + asm.cret(Qundef.into()); // PC should match the expected insn_idx @@ -611,20 +621,7 @@ pub fn gen_entry_prologue(cb: &mut CodeBlock, iseq: IseqPtr, insn_idx: u32) -> O https://github.com/ruby/ruby/blob/trunk/yjit/src/codegen.rs#L621 let mut asm = Assembler::new(); - - - // FIXME: need to handle this properly - // Maybe add an asm.entry_prologue() insn that compiles to nothing on x86 - // stp x29, x30, [sp, -16]! - // mov x29, sp - - - // NOTE: we also need a matching asm.exit_epilogue() - // mov sp, x29 - // ldp x29, x30, [sp], 16 - - - + asm.frame_setup(); // Save the CFP, EC, SP registers to the C stack asm.cpush(CFP); -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/