diff options
author | Alan Wu <XrXr@users.noreply.github.com> | 2022-10-19 14:03:07 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-19 14:03:07 -0400 |
commit | 5ca23caa2057fc4760fbefab6087371b11c4bc6c (patch) | |
tree | b0456a0c659205843eb6d49693e7e823fc75f307 /yjit/src/asm/mod.rs | |
parent | bc939d293768acf9a21568ebe738b8fe5981038f (diff) | |
download | ruby-5ca23caa2057fc4760fbefab6087371b11c4bc6c.tar.gz |
YJIT: fold the "asm_comments" feature into "disasm" (#6591)
Previously, enabling only "disasm" didn't actually build. Since these
two features are closely related and we don't really use one without the
other, let's simplify and merge the two features together.
Diffstat (limited to 'yjit/src/asm/mod.rs')
-rw-r--r-- | yjit/src/asm/mod.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/yjit/src/asm/mod.rs b/yjit/src/asm/mod.rs index 6fce8384c6..271f11defc 100644 --- a/yjit/src/asm/mod.rs +++ b/yjit/src/asm/mod.rs @@ -8,7 +8,7 @@ use crate::backend::x86_64::JMP_PTR_BYTES; use crate::backend::arm64::JMP_PTR_BYTES; use crate::virtualmem::WriteError; -#[cfg(feature = "asm_comments")] +#[cfg(feature = "disasm")] use std::collections::BTreeMap; use crate::codegen::CodegenGlobals; @@ -69,7 +69,7 @@ pub struct CodeBlock { label_refs: Vec<LabelRef>, // Comments for assembly instructions, if that feature is enabled - #[cfg(feature = "asm_comments")] + #[cfg(feature = "disasm")] asm_comments: BTreeMap<usize, Vec<String>>, // True for OutlinedCb @@ -101,7 +101,7 @@ impl CodeBlock { label_addrs: Vec::new(), label_names: Vec::new(), label_refs: Vec::new(), - #[cfg(feature = "asm_comments")] + #[cfg(feature = "disasm")] asm_comments: BTreeMap::new(), outlined, dropped_bytes: false, @@ -239,7 +239,7 @@ impl CodeBlock { /// Add an assembly comment if the feature is on. /// If not, this becomes an inline no-op. - #[cfg(feature = "asm_comments")] + #[cfg(feature = "disasm")] pub fn add_comment(&mut self, comment: &str) { let cur_ptr = self.get_write_ptr().into_usize(); @@ -251,11 +251,11 @@ impl CodeBlock { this_line_comments.push(comment.to_string()); } } - #[cfg(not(feature = "asm_comments"))] + #[cfg(not(feature = "disasm"))] #[inline] pub fn add_comment(&mut self, _: &str) {} - #[cfg(feature = "asm_comments")] + #[cfg(feature = "disasm")] pub fn comments_at(&self, pos: usize) -> Option<&Vec<String>> { self.asm_comments.get(&pos) } |