YJIT: Delete --yjit-global-constant-state (#7559)

It was useful for evaluating 6068da8937
but I think we should remove it now to make the logic around
invalidation more straight forward.
This commit is contained in:
Alan Wu 2023-03-17 16:16:17 -04:00 коммит произвёл GitHub
Родитель 2a26a5e677
Коммит 7fc796f92a
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 5 добавлений и 35 удалений

Просмотреть файл

@ -5,7 +5,6 @@ use crate::asm::OutlinedCb;
use crate::codegen::*;
use crate::core::*;
use crate::cruby::*;
use crate::options::*;
use crate::stats::*;
use crate::utils::IntoUsize;
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!(), || {
if get_option!(global_constant_state) {
// If the global-constant-state option is set, then we're going to
// invalidate every block that depends on any constant.
Invariants::get_instance()
.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);
}
// 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)
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
@ -59,7 +53,6 @@ pub static mut OPTIONS: Options = Options {
dump_insns: false,
dump_disasm: None,
verify_ctx: false,
global_constant_state: false,
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 },
("dump-insns", "") => unsafe { OPTIONS.dump_insns = true },
("verify-ctx", "") => unsafe { OPTIONS.verify_ctx = true },
("global-constant-state", "") => unsafe { OPTIONS.global_constant_state = true },
// Option name not recognized
_ => {