YJIT: Decrease SEND_MAX_DEPTH to 5 (#8390)
This commit is contained in:
parent
60a52caf87
commit
fcdedf7f47
Notes:
git
2023-09-07 18:22:55 +00:00
Merged-By: maximecb <maximecb@ruby-lang.org>
@ -2035,10 +2035,10 @@ fn jit_chain_guard(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// up to 5 different classes, and embedded or not for each
|
// up to 10 different classes, and embedded or not for each
|
||||||
pub const GET_IVAR_MAX_DEPTH: i32 = 10;
|
pub const GET_IVAR_MAX_DEPTH: i32 = 10;
|
||||||
|
|
||||||
// up to 5 different classes, and embedded or not for each
|
// up to 10 different classes, and embedded or not for each
|
||||||
pub const SET_IVAR_MAX_DEPTH: i32 = 10;
|
pub const SET_IVAR_MAX_DEPTH: i32 = 10;
|
||||||
|
|
||||||
// hashes and arrays
|
// hashes and arrays
|
||||||
@ -2047,11 +2047,8 @@ pub const OPT_AREF_MAX_CHAIN_DEPTH: i32 = 2;
|
|||||||
// expandarray
|
// expandarray
|
||||||
pub const EXPANDARRAY_MAX_CHAIN_DEPTH: i32 = 4;
|
pub const EXPANDARRAY_MAX_CHAIN_DEPTH: i32 = 4;
|
||||||
|
|
||||||
// up to 10 different classes
|
// up to 5 different methods for send
|
||||||
pub const SEND_MAX_DEPTH: i32 = 20;
|
pub const SEND_MAX_DEPTH: i32 = 5;
|
||||||
|
|
||||||
// up to 20 different methods for send
|
|
||||||
pub const SEND_MAX_CHAIN_DEPTH: i32 = 20;
|
|
||||||
|
|
||||||
// up to 20 different offsets for case-when
|
// up to 20 different offsets for case-when
|
||||||
pub const CASE_WHEN_MAX_DEPTH: i32 = 20;
|
pub const CASE_WHEN_MAX_DEPTH: i32 = 20;
|
||||||
@ -4385,7 +4382,7 @@ fn jit_rb_kernel_instance_of(
|
|||||||
jit,
|
jit,
|
||||||
asm,
|
asm,
|
||||||
ocb,
|
ocb,
|
||||||
SEND_MAX_CHAIN_DEPTH,
|
SEND_MAX_DEPTH,
|
||||||
Counter::guard_send_instance_of_class_mismatch,
|
Counter::guard_send_instance_of_class_mismatch,
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -4986,7 +4983,7 @@ fn jit_obj_respond_to(
|
|||||||
jit,
|
jit,
|
||||||
asm,
|
asm,
|
||||||
ocb,
|
ocb,
|
||||||
SEND_MAX_CHAIN_DEPTH,
|
SEND_MAX_DEPTH,
|
||||||
Counter::guard_send_respond_to_mid_mismatch,
|
Counter::guard_send_respond_to_mid_mismatch,
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -6038,7 +6035,7 @@ fn gen_send_iseq(
|
|||||||
jit,
|
jit,
|
||||||
asm,
|
asm,
|
||||||
ocb,
|
ocb,
|
||||||
SEND_MAX_CHAIN_DEPTH,
|
SEND_MAX_DEPTH,
|
||||||
Counter::guard_send_block_arg_type,
|
Counter::guard_send_block_arg_type,
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -7186,7 +7183,7 @@ fn gen_send_general(
|
|||||||
jit,
|
jit,
|
||||||
asm,
|
asm,
|
||||||
ocb,
|
ocb,
|
||||||
SEND_MAX_CHAIN_DEPTH,
|
SEND_MAX_DEPTH,
|
||||||
Counter::guard_send_send_chain,
|
Counter::guard_send_send_chain,
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -7428,7 +7425,7 @@ fn gen_invokeblock_specialized(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Fallback to dynamic dispatch if this callsite is megamorphic
|
// Fallback to dynamic dispatch if this callsite is megamorphic
|
||||||
if asm.ctx.get_chain_depth() as i32 >= SEND_MAX_CHAIN_DEPTH {
|
if asm.ctx.get_chain_depth() as i32 >= SEND_MAX_DEPTH {
|
||||||
gen_counter_incr(asm, Counter::invokeblock_megamorphic);
|
gen_counter_incr(asm, Counter::invokeblock_megamorphic);
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
@ -7462,7 +7459,7 @@ fn gen_invokeblock_specialized(
|
|||||||
jit,
|
jit,
|
||||||
asm,
|
asm,
|
||||||
ocb,
|
ocb,
|
||||||
SEND_MAX_CHAIN_DEPTH,
|
SEND_MAX_DEPTH,
|
||||||
Counter::guard_invokeblock_tag_changed,
|
Counter::guard_invokeblock_tag_changed,
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -7478,7 +7475,7 @@ fn gen_invokeblock_specialized(
|
|||||||
jit,
|
jit,
|
||||||
asm,
|
asm,
|
||||||
ocb,
|
ocb,
|
||||||
SEND_MAX_CHAIN_DEPTH,
|
SEND_MAX_DEPTH,
|
||||||
Counter::guard_invokeblock_iseq_block_changed,
|
Counter::guard_invokeblock_iseq_block_changed,
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -7521,7 +7518,7 @@ fn gen_invokeblock_specialized(
|
|||||||
jit,
|
jit,
|
||||||
asm,
|
asm,
|
||||||
ocb,
|
ocb,
|
||||||
SEND_MAX_CHAIN_DEPTH,
|
SEND_MAX_DEPTH,
|
||||||
Counter::guard_invokeblock_tag_changed,
|
Counter::guard_invokeblock_tag_changed,
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -7602,7 +7599,7 @@ fn gen_invokesuper_specialized(
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Fallback to dynamic dispatch if this callsite is megamorphic
|
// Fallback to dynamic dispatch if this callsite is megamorphic
|
||||||
if asm.ctx.get_chain_depth() as i32 >= SEND_MAX_CHAIN_DEPTH {
|
if asm.ctx.get_chain_depth() as i32 >= SEND_MAX_DEPTH {
|
||||||
gen_counter_incr(asm, Counter::invokesuper_megamorphic);
|
gen_counter_incr(asm, Counter::invokesuper_megamorphic);
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
@ -7686,7 +7683,7 @@ fn gen_invokesuper_specialized(
|
|||||||
jit,
|
jit,
|
||||||
asm,
|
asm,
|
||||||
ocb,
|
ocb,
|
||||||
SEND_MAX_CHAIN_DEPTH,
|
SEND_MAX_DEPTH,
|
||||||
Counter::guard_invokesuper_me_changed,
|
Counter::guard_invokesuper_me_changed,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user