summaryrefslogtreecommitdiff
path: root/yjit/src
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2022-11-13 09:33:23 -0800
committerGitHub <noreply@github.com>2022-11-13 12:33:23 -0500
commitd5e1b82f5c3e29e5d0a4a49216ae26e18af3f1c6 (patch)
treeb43896b17cf2ec36ddb2dea0e04b51f37ec0a6a9 /yjit/src
parent2f7d2662dd90a6985f1c98ea93cfc2026407a8ab (diff)
downloadruby-d5e1b82f5c3e29e5d0a4a49216ae26e18af3f1c6.tar.gz
YJIT: Remove unused src_ctx from Block (#6714)
Diffstat (limited to 'yjit/src')
-rw-r--r--yjit/src/codegen.rs6
-rw-r--r--yjit/src/core.rs16
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(
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(
// Generate the branch instructions
gen_branch(
jit,
- ctx,
asm,
ocb,
jump_block,
@@ -3281,7 +3280,6 @@ fn gen_branchunless(
// Generate the branch instructions
gen_branch(
jit,
- ctx,
asm,
ocb,
jump_block,
@@ -3349,7 +3347,6 @@ fn gen_branchnil(
// Generate the branch instructions
gen_branch(
jit,
- ctx,
asm,
ocb,
jump_block,
@@ -5069,7 +5066,6 @@ fn gen_send_iseq(
// 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 {
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) {
}
/// 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) -
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
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(
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(
}
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(
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();