[前][次][番号順一覧][スレッド一覧]

ruby-changes:73134

From: Maxime <ko1@a...>
Date: Tue, 30 Aug 2022 00:55:20 +0900 (JST)
Subject: [ruby-changes:73134] 9d18e6c300 (master): Port gen_code_for_exit_from_stub()

https://git.ruby-lang.org/ruby.git/commit/?id=9d18e6c300

From 9d18e6c300eacfdf11e166326156677e56fc6392 Mon Sep 17 00:00:00 2001
From: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@s...>
Date: Tue, 14 Jun 2022 15:50:48 -0400
Subject: Port gen_code_for_exit_from_stub()

---
 yjit/src/codegen.rs | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/yjit/src/codegen.rs b/yjit/src/codegen.rs
index 580595d499..95d29689fb 100644
--- a/yjit/src/codegen.rs
+++ b/yjit/src/codegen.rs
@@ -400,21 +400,19 @@ fn verify_ctx(jit: &JITState, ctx: &Context) { https://github.com/ruby/ruby/blob/trunk/yjit/src/codegen.rs#L400
 fn gen_code_for_exit_from_stub(ocb: &mut OutlinedCb) -> CodePtr {
     let ocb = ocb.unwrap();
     let code_ptr = ocb.get_write_ptr();
+    let mut asm = Assembler::new();
 
-    todo!();
-
-    /*
     gen_counter_incr!(asm, exit_from_branch_stub);
 
-    cpop(ocb, REG_SP);
-    cpop(ocb, REG_EC);
-    cpop(ocb, REG_CFP);
+    asm.cpop(SP);
+    asm.cpop(EC);
+    asm.cpop(CFP);
+
+    asm.cret(Qundef.into());
 
-    mov(ocb, RAX, uimm_opnd(Qundef.into()));
-    ret(ocb);
+    asm.compile(ocb);
 
-    return code_ptr;
-    */
+    code_ptr
 }
 
 /// Generate an exit to return to the interpreter
@@ -6186,7 +6184,7 @@ impl CodegenGlobals { https://github.com/ruby/ruby/blob/trunk/yjit/src/codegen.rs#L6184
 
         let leave_exit_code = gen_leave_exit(&mut ocb);
 
-        //let stub_exit_code = gen_code_for_exit_from_stub(&mut ocb);
+        let stub_exit_code = gen_code_for_exit_from_stub(&mut ocb);
 
         // Generate full exit code for C func
         //let cfunc_exit_code = gen_full_cfunc_return(&mut ocb);
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]