diff options
author | Takashi Kokubun <[email protected]> | 2023-09-15 18:41:00 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2023-09-15 21:41:00 -0400 |
commit | 9aeb6e72db7a049a620a6d10836992dc9d0cf3b3 (patch) | |
tree | 7b8f2b9553f83eb7acec687caf5772b7297872b0 /yjit/src/backend/ir.rs | |
parent | 1fbfd066286bce3cb48eb4e2ed28a7927e9a424b (diff) |
YJIT: Avoid creating a vector in get_temp_regs() (#8446)
* YJIT: Avoid creating a vector in get_temp_regs()
Co-authored-by: Alan Wu <[email protected]>
* Remove unused import
---------
Co-authored-by: Alan Wu <[email protected]>
Co-authored-by: Alan Wu <[email protected]>
Diffstat (limited to 'yjit/src/backend/ir.rs')
-rw-r--r-- | yjit/src/backend/ir.rs | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/yjit/src/backend/ir.rs b/yjit/src/backend/ir.rs index 9f0748de0f..479a4df3db 100644 --- a/yjit/src/backend/ir.rs +++ b/yjit/src/backend/ir.rs @@ -14,11 +14,7 @@ use crate::core::{Context, RegTemps, MAX_REG_TEMPS}; use crate::options::*; use crate::stats::*; -#[cfg(target_arch = "x86_64")] -use crate::backend::x86_64::*; - -#[cfg(target_arch = "aarch64")] -use crate::backend::arm64::*; +use crate::backend::current::*; pub const EC: Opnd = _EC; pub const CFP: Opnd = _CFP; @@ -1028,10 +1024,9 @@ impl Assembler } /// Get the list of registers that can be used for stack temps. - pub fn get_temp_regs() -> Vec<Reg> { + pub fn get_temp_regs() -> &'static [Reg] { let num_regs = get_option!(num_temp_regs); - let mut regs = Self::TEMP_REGS.to_vec(); - regs.drain(0..num_regs).collect() + &TEMP_REGS[0..num_regs] } /// Set a context for generating side exits |