YJIT: Delete --yjit-global-constant-state (#7559)
It was useful for evaluating 6068da8937d7e4358943f95e7450dae7179a7763 but I think we should remove it now to make the logic around invalidation more straight forward.
This commit is contained in:
parent
2a26a5e677
commit
7fc796f92a
Notes:
git
2023-03-17 20:16:52 +00:00
Merged-By: maximecb <maximecb@ruby-lang.org>
@ -5,7 +5,6 @@ use crate::asm::OutlinedCb;
|
|||||||
use crate::codegen::*;
|
use crate::codegen::*;
|
||||||
use crate::core::*;
|
use crate::core::*;
|
||||||
use crate::cruby::*;
|
use crate::cruby::*;
|
||||||
use crate::options::*;
|
|
||||||
use crate::stats::*;
|
use crate::stats::*;
|
||||||
use crate::utils::IntoUsize;
|
use crate::utils::IntoUsize;
|
||||||
use crate::yjit::yjit_enabled_p;
|
use crate::yjit::yjit_enabled_p;
|
||||||
@ -273,32 +272,11 @@ pub extern "C" fn rb_yjit_constant_state_changed(id: ID) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
with_vm_lock(src_loc!(), || {
|
with_vm_lock(src_loc!(), || {
|
||||||
if get_option!(global_constant_state) {
|
// Invalidate the blocks that are associated with the given ID.
|
||||||
// If the global-constant-state option is set, then we're going to
|
if let Some(blocks) = Invariants::get_instance().constant_state_blocks.remove(&id) {
|
||||||
// invalidate every block that depends on any constant.
|
for block in &blocks {
|
||||||
|
invalidate_block_version(block);
|
||||||
Invariants::get_instance()
|
incr_counter!(invalidate_constant_state_bump);
|
||||||
.constant_state_blocks
|
|
||||||
.keys()
|
|
||||||
.for_each(|id| {
|
|
||||||
if let Some(blocks) =
|
|
||||||
Invariants::get_instance().constant_state_blocks.remove(&id)
|
|
||||||
{
|
|
||||||
for block in &blocks {
|
|
||||||
invalidate_block_version(block);
|
|
||||||
incr_counter!(invalidate_constant_state_bump);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
// If the global-constant-state option is not set, then we're only going
|
|
||||||
// to invalidate the blocks that are associated with the given ID.
|
|
||||||
|
|
||||||
if let Some(blocks) = Invariants::get_instance().constant_state_blocks.remove(&id) {
|
|
||||||
for block in &blocks {
|
|
||||||
invalidate_block_version(block);
|
|
||||||
incr_counter!(invalidate_constant_state_bump);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -39,12 +39,6 @@ pub struct Options {
|
|||||||
|
|
||||||
/// Verify context objects (debug mode only)
|
/// Verify context objects (debug mode only)
|
||||||
pub verify_ctx: bool,
|
pub verify_ctx: bool,
|
||||||
|
|
||||||
/// Whether or not to assume a global constant state (and therefore
|
|
||||||
/// invalidating code whenever any constant changes) versus assuming
|
|
||||||
/// constant name components (and therefore invalidating code whenever a
|
|
||||||
/// matching name component changes)
|
|
||||||
pub global_constant_state: bool,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize the options to default values
|
// Initialize the options to default values
|
||||||
@ -59,7 +53,6 @@ pub static mut OPTIONS: Options = Options {
|
|||||||
dump_insns: false,
|
dump_insns: false,
|
||||||
dump_disasm: None,
|
dump_disasm: None,
|
||||||
verify_ctx: false,
|
verify_ctx: false,
|
||||||
global_constant_state: false,
|
|
||||||
dump_iseq_disasm: None,
|
dump_iseq_disasm: None,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -159,7 +152,6 @@ pub fn parse_option(str_ptr: *const std::os::raw::c_char) -> Option<()> {
|
|||||||
("trace-exits", "") => unsafe { OPTIONS.gen_trace_exits = true; OPTIONS.gen_stats = true },
|
("trace-exits", "") => unsafe { OPTIONS.gen_trace_exits = true; OPTIONS.gen_stats = true },
|
||||||
("dump-insns", "") => unsafe { OPTIONS.dump_insns = true },
|
("dump-insns", "") => unsafe { OPTIONS.dump_insns = true },
|
||||||
("verify-ctx", "") => unsafe { OPTIONS.verify_ctx = true },
|
("verify-ctx", "") => unsafe { OPTIONS.verify_ctx = true },
|
||||||
("global-constant-state", "") => unsafe { OPTIONS.global_constant_state = true },
|
|
||||||
|
|
||||||
// Option name not recognized
|
// Option name not recognized
|
||||||
_ => {
|
_ => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user