diff options
author | Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com> | 2022-07-19 11:45:46 -0400 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2022-08-29 08:47:01 -0700 |
commit | fd97f8ebc7f22df7e3a7bf05c5d9328946cb539e (patch) | |
tree | 381674bb8a52d58a952ef8dc3c871f89989ca34c /yjit/src/codegen.rs | |
parent | 10d50031e66cc19ebe7e10ce80c1d8bd8b745399 (diff) | |
download | ruby-fd97f8ebc7f22df7e3a7bf05c5d9328946cb539e.tar.gz |
Use frame_setup() and frame_teardown()
Diffstat (limited to 'yjit/src/codegen.rs')
-rw-r--r-- | yjit/src/codegen.rs | 25 |
1 files 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 { 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) { 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 { 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 { 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) { 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 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); |