diff options
author | Alan Wu <XrXr@users.noreply.github.com> | 2023-11-10 15:21:56 -0500 |
---|---|---|
committer | Alan Wu <XrXr@users.noreply.github.com> | 2023-11-10 16:55:56 -0500 |
commit | 0a93ea4808d0d5c2cd0a757abe664e572036fe80 (patch) | |
tree | 0119158a2118af9286b13b04d89bee2a0c31e053 /yjit/src/codegen.rs | |
parent | 85db7baccb946c6bb463166acdd0fd7b12568d35 (diff) | |
download | ruby-0a93ea4808d0d5c2cd0a757abe664e572036fe80.tar.gz |
YJIT: Auto fix for clippy::clone_on_copy
Diffstat (limited to 'yjit/src/codegen.rs')
-rw-r--r-- | yjit/src/codegen.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/yjit/src/codegen.rs b/yjit/src/codegen.rs index be6d38a466..e99161c9f0 100644 --- a/yjit/src/codegen.rs +++ b/yjit/src/codegen.rs @@ -108,7 +108,7 @@ impl JITState { JITState { iseq: blockid.iseq, starting_insn_idx: blockid.idx, - starting_ctx: starting_ctx.clone(), + starting_ctx, output_ptr, insn_idx: 0, opcode: 0, @@ -151,7 +151,7 @@ impl JITState { } pub fn get_starting_ctx(&self) -> Context { - self.starting_ctx.clone() + self.starting_ctx } pub fn get_arg(&self, arg_idx: isize) -> VALUE { @@ -550,7 +550,7 @@ fn gen_exit(exit_pc: *mut VALUE, asm: &mut Assembler) { pub fn gen_outlined_exit(exit_pc: *mut VALUE, ctx: &Context, ocb: &mut OutlinedCb) -> Option<CodePtr> { let mut cb = ocb.unwrap(); let mut asm = Assembler::new(); - asm.ctx = ctx.clone(); + asm.ctx = *ctx; asm.set_reg_temps(ctx.get_reg_temps()); gen_exit(exit_pc, &mut asm); @@ -599,7 +599,7 @@ pub fn jit_ensure_block_entry_exit(jit: &mut JITState, asm: &mut Assembler, ocb: // If we're compiling the first instruction in the block. if jit.insn_idx == jit.starting_insn_idx { // Generate the exit with the cache in Assembler. - let side_exit_context = SideExitContext::new(jit.pc, block_starting_context.clone()); + let side_exit_context = SideExitContext::new(jit.pc, *block_starting_context); let entry_exit = asm.get_side_exit(&side_exit_context, None, ocb); jit.block_entry_exit = Some(entry_exit?); } else { @@ -843,7 +843,7 @@ fn jump_to_next_insn( ) -> Option<()> { // Reset the depth since in current usages we only ever jump to to // chain_depth > 0 from the same instruction. - let mut reset_depth = asm.ctx.clone(); + let mut reset_depth = asm.ctx; reset_depth.reset_chain_depth(); let jump_block = BlockId { @@ -897,7 +897,7 @@ pub fn gen_single_block( let mut insn_idx: IseqIdx = blockid.idx; // Initialize a JIT state object - let mut jit = JITState::new(blockid, ctx.clone(), cb.get_write_ptr(), ec); + let mut jit = JITState::new(blockid, ctx, cb.get_write_ptr(), ec); jit.iseq = blockid.iseq; // Create a backend assembler instance @@ -3920,7 +3920,7 @@ fn gen_branchif( asm.test(val_opnd, Opnd::Imm(!Qnil.as_i64())); // Generate the branch instructions - let ctx = asm.ctx.clone(); + let ctx = asm.ctx; gen_branch( jit, asm, @@ -3976,7 +3976,7 @@ fn gen_branchunless( asm.test(val_opnd, not_qnil.into()); // Generate the branch instructions - let ctx = asm.ctx.clone(); + let ctx = asm.ctx; gen_branch( jit, asm, @@ -4029,7 +4029,7 @@ fn gen_branchnil( // Test if the value is Qnil asm.cmp(val_opnd, Opnd::UImm(Qnil.into())); // Generate the branch instructions - let ctx = asm.ctx.clone(); + let ctx = asm.ctx; gen_branch( jit, asm, @@ -6671,7 +6671,7 @@ fn gen_send_iseq( // Pop arguments and receiver in return context and // mark it as a continuation of gen_leave() let mut return_asm = Assembler::new(); - return_asm.ctx = asm.ctx.clone(); + return_asm.ctx = asm.ctx; return_asm.stack_pop(sp_offset.try_into().unwrap()); return_asm.ctx.set_sp_offset(0); // We set SP on the caller's frame above return_asm.ctx.reset_chain_depth(); |