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

ruby-changes:74477

From: Takashi <ko1@a...>
Date: Mon, 14 Nov 2022 02:33:40 +0900 (JST)
Subject: [ruby-changes:74477] d5e1b82f5c (master): YJIT: Remove unused src_ctx from Block (#6714)

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

From d5e1b82f5c3e29e5d0a4a49216ae26e18af3f1c6 Mon Sep 17 00:00:00 2001
From: Takashi Kokubun <takashikkbn@g...>
Date: Sun, 13 Nov 2022 09:33:23 -0800
Subject: YJIT: Remove unused src_ctx from Block (#6714)

---
 yjit/src/codegen.rs |  6 +-----
 yjit/src/core.rs    | 16 ++++------------
 2 files changed, 5 insertions(+), 17 deletions(-)

diff --git a/yjit/src/codegen.rs b/yjit/src/codegen.rs
index 421e14c553..ac70cf98bd 100644
--- a/yjit/src/codegen.rs
+++ b/yjit/src/codegen.rs
@@ -1880,7 +1880,7 @@ fn jit_chain_guard( https://github.com/ruby/ruby/blob/trunk/yjit/src/codegen.rs#L1880
             idx: jit.insn_idx,
         };
 
-        gen_branch(jit, ctx, asm, ocb, bid, &deeper, None, None, target0_gen_fn);
+        gen_branch(jit, asm, ocb, bid, &deeper, None, None, target0_gen_fn);
     } else {
         target0_gen_fn(asm, side_exit, None, BranchShape::Default);
     }
@@ -3210,7 +3210,6 @@ fn gen_branchif( https://github.com/ruby/ruby/blob/trunk/yjit/src/codegen.rs#L3210
         // Generate the branch instructions
         gen_branch(
             jit,
-            ctx,
             asm,
             ocb,
             jump_block,
@@ -3281,7 +3280,6 @@ fn gen_branchunless( https://github.com/ruby/ruby/blob/trunk/yjit/src/codegen.rs#L3280
         // Generate the branch instructions
         gen_branch(
             jit,
-            ctx,
             asm,
             ocb,
             jump_block,
@@ -3349,7 +3347,6 @@ fn gen_branchnil( https://github.com/ruby/ruby/blob/trunk/yjit/src/codegen.rs#L3347
         // Generate the branch instructions
         gen_branch(
             jit,
-            ctx,
             asm,
             ocb,
             jump_block,
@@ -5069,7 +5066,6 @@ fn gen_send_iseq( https://github.com/ruby/ruby/blob/trunk/yjit/src/codegen.rs#L5066
     // Write the JIT return address on the callee frame
     gen_branch(
         jit,
-        ctx,
         asm,
         ocb,
         return_block,
diff --git a/yjit/src/core.rs b/yjit/src/core.rs
index eca58f8135..0dcaa73453 100644
--- a/yjit/src/core.rs
+++ b/yjit/src/core.rs
@@ -334,10 +334,6 @@ struct Branch { https://github.com/ruby/ruby/blob/trunk/yjit/src/core.rs#L334
     start_addr: Option<CodePtr>,
     end_addr: Option<CodePtr>, // exclusive
 
-    // Context right after the branch instruction
-    #[allow(unused)] // set but not read at the moment
-    src_ctx: Context,
-
     // Branch target blocks and their contexts
     targets: [Option<BlockId>; 2],
     target_ctxs: [Context; 2],
@@ -1646,7 +1642,7 @@ fn regenerate_branch(cb: &mut CodeBlock, branch: &mut Branch) { https://github.com/ruby/ruby/blob/trunk/yjit/src/core.rs#L1642
 }
 
 /// Create a new outgoing branch entry for a block
-fn make_branch_entry(block: &BlockRef, src_ctx: &Context, gen_fn: BranchGenFn) -> BranchRef {
+fn make_branch_entry(block: &BlockRef, gen_fn: BranchGenFn) -> BranchRef {
     let branch = Branch {
         // Block this is attached to
         block: block.clone(),
@@ -1655,9 +1651,6 @@ fn make_branch_entry(block: &BlockRef, src_ctx: &Context, gen_fn: BranchGenFn) - https://github.com/ruby/ruby/blob/trunk/yjit/src/core.rs#L1651
         start_addr: None,
         end_addr: None,
 
-        // Context right after the branch instruction
-        src_ctx: *src_ctx,
-
         // Branch target blocks and their contexts
         targets: [None, None],
         target_ctxs: [Context::default(), Context::default()],
@@ -1952,7 +1945,6 @@ impl Assembler https://github.com/ruby/ruby/blob/trunk/yjit/src/core.rs#L1945
 
 pub fn gen_branch(
     jit: &JITState,
-    src_ctx: &Context,
     asm: &mut Assembler,
     ocb: &mut OutlinedCb,
     target0: BlockId,
@@ -1961,7 +1953,7 @@ pub fn gen_branch( https://github.com/ruby/ruby/blob/trunk/yjit/src/core.rs#L1953
     ctx1: Option<&Context>,
     gen_fn: BranchGenFn,
 ) {
-    let branchref = make_branch_entry(&jit.get_block(), src_ctx, gen_fn);
+    let branchref = make_branch_entry(&jit.get_block(), gen_fn);
 
     // Get the branch targets or stubs
     let dst_addr0 = get_branch_target(target0, ctx0, &branchref, 0, ocb);
@@ -2013,7 +2005,7 @@ fn gen_jump_branch( https://github.com/ruby/ruby/blob/trunk/yjit/src/core.rs#L2005
 }
 
 pub fn gen_direct_jump(jit: &JITState, ctx: &Context, target0: BlockId, asm: &mut Assembler) {
-    let branchref = make_branch_entry(&jit.get_block(), ctx, gen_jump_branch);
+    let branchref = make_branch_entry(&jit.get_block(), gen_jump_branch);
     let mut branch = branchref.borrow_mut();
 
     branch.targets[0] = Some(target0);
@@ -2068,7 +2060,7 @@ pub fn defer_compilation( https://github.com/ruby/ruby/blob/trunk/yjit/src/core.rs#L2060
     next_ctx.chain_depth += 1;
 
     let block_rc = jit.get_block();
-    let branch_rc = make_branch_entry(&jit.get_block(), cur_ctx, gen_jump_branch);
+    let branch_rc = make_branch_entry(&jit.get_block(), gen_jump_branch);
     let mut branch = branch_rc.borrow_mut();
     let block = block_rc.borrow();
 
-- 
cgit v1.2.3


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

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