summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>2022-07-19 11:45:46 -0400
committerTakashi Kokubun <takashikkbn@gmail.com>2022-08-29 08:47:01 -0700
commitfd97f8ebc7f22df7e3a7bf05c5d9328946cb539e (patch)
tree381674bb8a52d58a952ef8dc3c871f89989ca34c
parent10d50031e66cc19ebe7e10ce80c1d8bd8b745399 (diff)
Use frame_setup() and frame_teardown()
-rw-r--r--yjit/src/codegen.rs25
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);