aboutsummaryrefslogtreecommitdiffstats
path: root/yjit
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2023-11-03 14:06:35 -0400
committerAlan Wu <XrXr@users.noreply.github.com>2023-11-03 18:47:41 +0000
commit38bdb9d0da1647a9b91463183a9b61330243d908 (patch)
treea1e7b8eaa7cc95ea969c9729301d865b48cf1720 /yjit
parentbc4d1c09facd33498e95408efe5bbbe9a0bb3cca (diff)
downloadruby-38bdb9d0da1647a9b91463183a9b61330243d908.tar.gz
YJIT: Delete some dead code and enable lints
Diffstat (limited to 'yjit')
-rw-r--r--yjit/src/backend/arm64/mod.rs19
-rw-r--r--yjit/src/backend/x86_64/mod.rs8
2 files changed, 6 insertions, 21 deletions
diff --git a/yjit/src/backend/arm64/mod.rs b/yjit/src/backend/arm64/mod.rs
index 93c441e228..553b8dd173 100644
--- a/yjit/src/backend/arm64/mod.rs
+++ b/yjit/src/backend/arm64/mod.rs
@@ -1,18 +1,10 @@
-#![allow(dead_code)]
-#![allow(unused_variables)]
-#![allow(unused_imports)]
-
use std::mem::take;
-use crate::asm::x86_64::jmp_ptr;
use crate::asm::{CodeBlock, OutlinedCb};
use crate::asm::arm64::*;
-use crate::codegen::{JITState, CodegenGlobals};
-use crate::core::Context;
use crate::cruby::*;
use crate::backend::ir::*;
use crate::virtualmem::CodePtr;
-use crate::options::*;
// Use the arm64 register type for this platform
pub type Reg = A64Reg;
@@ -105,7 +97,6 @@ fn emit_jmp_ptr_with_invalidation(cb: &mut CodeBlock, dst_ptr: CodePtr) {
#[cfg(not(test))]
{
let end = cb.get_write_ptr();
- use crate::cruby::rb_yjit_icache_invalidate;
unsafe { rb_yjit_icache_invalidate(start.raw_ptr() as _, end.raw_ptr() as _) };
}
}
@@ -618,9 +609,9 @@ impl Assembler
asm.not(opnd0);
},
- Insn::LShift { opnd, shift, .. } |
- Insn::RShift { opnd, shift, .. } |
- Insn::URShift { opnd, shift, .. } => {
+ Insn::LShift { opnd, .. } |
+ Insn::RShift { opnd, .. } |
+ Insn::URShift { opnd, .. } => {
// The operand must be in a register, so
// if we get anything else we need to load it first.
let opnd0 = match opnd {
@@ -885,8 +876,8 @@ impl Assembler
Insn::Mul { left, right, out } => {
// If the next instruction is jo (jump on overflow)
match (self.insns.get(insn_idx + 1), self.insns.get(insn_idx + 2)) {
- (Some(Insn::JoMul(target)), _) |
- (Some(Insn::PosMarker(_)), Some(Insn::JoMul(target))) => {
+ (Some(Insn::JoMul(_)), _) |
+ (Some(Insn::PosMarker(_)), Some(Insn::JoMul(_))) => {
// Compute the high 64 bits
smulh(cb, Self::SCRATCH0, left.into(), right.into());
diff --git a/yjit/src/backend/x86_64/mod.rs b/yjit/src/backend/x86_64/mod.rs
index a188b91c07..e87ededf69 100644
--- a/yjit/src/backend/x86_64/mod.rs
+++ b/yjit/src/backend/x86_64/mod.rs
@@ -1,16 +1,10 @@
-#![allow(dead_code)]
-#![allow(unused_variables)]
-#![allow(unused_imports)]
-
use std::mem::take;
use crate::asm::*;
use crate::asm::x86_64::*;
-use crate::codegen::{JITState, CodePtr};
-use crate::core::Context;
+use crate::codegen::CodePtr;
use crate::cruby::*;
use crate::backend::ir::*;
-use crate::codegen::CodegenGlobals;
use crate::options::*;
// Use the x86 register type for this platform