summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2023-11-10 15:47:23 -0500
committerAlan Wu <XrXr@users.noreply.github.com>2023-11-10 16:55:56 -0500
commit8dfbfa15f6d0d8677cd1b4adb192643a05d02411 (patch)
tree90a650294a57aa5ee0cc510bbb25733cc998c9aa
parent408d5886cf653c1fbf51880095766fd54da737d2 (diff)
YJIT: Take cargo --fix for unnecessary calls to into()
-rw-r--r--yjit/src/codegen.rs6
-rw-r--r--yjit/src/core.rs12
2 files changed, 9 insertions, 9 deletions
diff --git a/yjit/src/codegen.rs b/yjit/src/codegen.rs
index 3919be788a..1d264ccb49 100644
--- a/yjit/src/codegen.rs
+++ b/yjit/src/codegen.rs
@@ -410,7 +410,7 @@ fn verify_ctx(jit: &JITState, ctx: &Context) {
}
}
TempMappingKind::MapToLocal => {
- let local_idx: u8 = learned_mapping.get_local_idx().into();
+ let local_idx: u8 = learned_mapping.get_local_idx();
let local_val = jit.peek_at_local(local_idx.into());
if local_val != stack_val {
panic!(
@@ -2680,7 +2680,7 @@ fn gen_definedivar(
jit_prepare_routine_call(jit, asm);
// Call rb_ivar_defined(recv, ivar_name)
- let def_result = asm.ccall(rb_ivar_defined as *const u8, vec![recv.into(), ivar_name.into()]);
+ let def_result = asm.ccall(rb_ivar_defined as *const u8, vec![recv, ivar_name.into()]);
// if (rb_ivar_defined(recv, ivar_name)) {
// val = pushval;
@@ -5028,7 +5028,7 @@ fn jit_obj_respond_to(
(METHOD_VISI_UNDEF, _) => {
// No method, we can return false given respond_to_missing? hasn't been overridden.
// In the future, we might want to jit the call to respond_to_missing?
- if !assume_method_basic_definition(jit, asm, ocb, recv_class, ID!(respond_to_missing).into()) {
+ if !assume_method_basic_definition(jit, asm, ocb, recv_class, ID!(respond_to_missing)) {
return false;
}
Qfalse
diff --git a/yjit/src/core.rs b/yjit/src/core.rs
index 1a3031af57..75585d67a0 100644
--- a/yjit/src/core.rs
+++ b/yjit/src/core.rs
@@ -514,8 +514,8 @@ impl BranchGenFn {
BranchShape::Next0 => asm.jz(target1.unwrap()),
BranchShape::Next1 => asm.jnz(target0),
BranchShape::Default => {
- asm.jnz(target0.into());
- asm.jmp(target1.unwrap().into());
+ asm.jnz(target0);
+ asm.jmp(target1.unwrap());
}
}
}
@@ -544,11 +544,11 @@ impl BranchGenFn {
panic!("Branch shape Next1 not allowed in JumpToTarget0!");
}
if shape.get() == BranchShape::Default {
- asm.jmp(target0.into());
+ asm.jmp(target0);
}
}
BranchGenFn::JNZToTarget0 => {
- asm.jnz(target0.into())
+ asm.jnz(target0)
}
BranchGenFn::JZToTarget0 => {
asm.jz(target0)
@@ -1835,7 +1835,7 @@ impl Context {
MapToLocal => {
let idx = mapping.get_local_idx();
if idx as usize == local_idx {
- let local_type = self.get_local_type(local_idx.into());
+ let local_type = self.get_local_type(local_idx);
TempMapping::map_to_stack(local_type)
} else {
TempMapping::map_to_local(idx)
@@ -2015,7 +2015,7 @@ impl Assembler {
return self.stack_push(Type::Unknown);
}
- return self.stack_push_mapping(TempMapping::map_to_local((local_idx as u8).into()));
+ return self.stack_push_mapping(TempMapping::map_to_local(local_idx as u8));
}
// Pop N values off the stack