aboutsummaryrefslogtreecommitdiffstats
path: root/yjit/src/options.rs
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2023-04-04 10:58:11 -0700
committerGitHub <noreply@github.com>2023-04-04 10:58:11 -0700
commitb7717fc390ce47c8ef24d2ed9fe25f188f28f60f (patch)
tree6ef3a81fab299a39567876723eca8b4bfc59e857 /yjit/src/options.rs
parent87253d047ce35e7836b6f97edbb4f819879a3b25 (diff)
downloadruby-b7717fc390ce47c8ef24d2ed9fe25f188f28f60f.tar.gz
YJIT: Stack temp register allocation (#7651)
Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
Diffstat (limited to 'yjit/src/options.rs')
-rw-r--r--yjit/src/options.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/yjit/src/options.rs b/yjit/src/options.rs
index dfae06d1e7..759ed16205 100644
--- a/yjit/src/options.rs
+++ b/yjit/src/options.rs
@@ -22,6 +22,9 @@ pub struct Options {
// 1 means always create generic versions
pub max_versions: usize,
+ // The number of registers allocated for stack temps
+ pub num_temp_regs: usize,
+
// Capture and print out stats
pub gen_stats: bool,
@@ -52,6 +55,7 @@ pub static mut OPTIONS: Options = Options {
greedy_versioning: false,
no_type_prop: false,
max_versions: 4,
+ num_temp_regs: 0,
gen_stats: false,
gen_trace_exits: false,
pause: false,
@@ -141,6 +145,13 @@ pub fn parse_option(str_ptr: *const std::os::raw::c_char) -> Option<()> {
OPTIONS.pause = true;
},
+ ("temp-regs", _) => match opt_val.parse() {
+ Ok(n) => unsafe { OPTIONS.num_temp_regs = n },
+ Err(_) => {
+ return None;
+ }
+ },
+
("dump-disasm", _) => match opt_val.to_string().as_str() {
"" => unsafe { OPTIONS.dump_disasm = Some(DumpDisasm::Stdout) },
directory => {