diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2023-04-06 08:34:58 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-06 11:34:58 -0400 |
commit | 89bdf6e94cb36567478c509722fe98069402fb8e (patch) | |
tree | 633c8fd7d2ebe53e2ce5a9105e346f04068bc843 /yjit/src/options.rs | |
parent | 2a34bcaa1023c5f0b41774d8153b9625a4233c04 (diff) | |
download | ruby-89bdf6e94cb36567478c509722fe98069402fb8e.tar.gz |
YJIT: Stack temp register allocation for arm64 (#7659)
* YJIT: Stack temp register allocation for arm64
* Update a comment
Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
* Update comments about assertion
* Update a comment
Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
---------
Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
Diffstat (limited to 'yjit/src/options.rs')
-rw-r--r-- | yjit/src/options.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/yjit/src/options.rs b/yjit/src/options.rs index 759ed16205..03acc7bbe0 100644 --- a/yjit/src/options.rs +++ b/yjit/src/options.rs @@ -1,4 +1,5 @@ use std::ffi::CStr; +use crate::backend::ir::Assembler; // Command-line options #[derive(Clone, PartialEq, Eq, Debug)] @@ -55,7 +56,7 @@ pub static mut OPTIONS: Options = Options { greedy_versioning: false, no_type_prop: false, max_versions: 4, - num_temp_regs: 0, + num_temp_regs: 5, gen_stats: false, gen_trace_exits: false, pause: false, @@ -146,7 +147,10 @@ pub fn parse_option(str_ptr: *const std::os::raw::c_char) -> Option<()> { }, ("temp-regs", _) => match opt_val.parse() { - Ok(n) => unsafe { OPTIONS.num_temp_regs = n }, + Ok(n) => { + assert!(n <= Assembler::TEMP_REGS.len(), "--yjit-temp-regs must be <= {}", Assembler::TEMP_REGS.len()); + unsafe { OPTIONS.num_temp_regs = n } + } Err(_) => { return None; } |