mirror of
https://github.com/ruby/ruby.git
synced 2025-08-25 05:55:46 +02:00
YJIT: print warning when disasm options used without a dev build (#9744)
* YJIT: print warning when disasm options used without a dev build I was confused for a few minutes the other way then --yjit-dump-disasm printed nothing, so I figured this would be useful for end-users (and future me). * Fix lone extraneous space
This commit is contained in:
parent
32bbf47500
commit
bc10b958d2
1 changed files with 20 additions and 10 deletions
|
@ -228,7 +228,12 @@ pub fn parse_option(str_ptr: *const std::os::raw::c_char) -> Option<()> {
|
||||||
_ => return None,
|
_ => return None,
|
||||||
},
|
},
|
||||||
|
|
||||||
("dump-disasm", _) => match opt_val {
|
("dump-disasm", _) => {
|
||||||
|
if !cfg!(feature = "disasm") {
|
||||||
|
eprintln!("WARNING: the {} option is only available when YJIT is built in dev mode, i.e. ./configure --enable-yjit=dev", opt_name);
|
||||||
|
}
|
||||||
|
|
||||||
|
match opt_val {
|
||||||
"" => unsafe { OPTIONS.dump_disasm = Some(DumpDisasm::Stdout) },
|
"" => unsafe { OPTIONS.dump_disasm = Some(DumpDisasm::Stdout) },
|
||||||
directory => {
|
directory => {
|
||||||
let path = format!("{directory}/yjit_{}.log", std::process::id());
|
let path = format!("{directory}/yjit_{}.log", std::process::id());
|
||||||
|
@ -240,9 +245,14 @@ pub fn parse_option(str_ptr: *const std::os::raw::c_char) -> Option<()> {
|
||||||
Err(err) => eprintln!("Failed to create {path}: {err}"),
|
Err(err) => eprintln!("Failed to create {path}: {err}"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
("dump-iseq-disasm", _) => unsafe {
|
("dump-iseq-disasm", _) => unsafe {
|
||||||
|
if !cfg!(feature = "disasm") {
|
||||||
|
eprintln!("WARNING: the {} option is only available when YJIT is built in dev mode, i.e. ./configure --enable-yjit=dev", opt_name);
|
||||||
|
}
|
||||||
|
|
||||||
OPTIONS.dump_iseq_disasm = Some(opt_val.to_string());
|
OPTIONS.dump_iseq_disasm = Some(opt_val.to_string());
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue