From 08a70931e52ff0b0ad87fd6f1bf06104573a925e Mon Sep 17 00:00:00 2001 From: overlookmotel <557937+overlookmotel@users.noreply.github.com> Date: Sun, 1 Nov 2026 23:34:21 +0000 Subject: [PATCH] refactor(lexer): `#[inline(always)]` on `Walks::run_rules` (#28648) Part of effort to move to runtime CPU feature detection. Follow-up after auditing codegen after work so far in this stack. `Walks::run_rules` is Level 3 code, but `gt_run_split` calls it from Level 2. Outside tests, it only returns `true`, and that must fold into `gt_run_split`. So it gets `#[inline(always)]` instead of `cpu_versions!` or `#[inline(never)]`. Its test version too, so both versions are the same shape. Codegen: no change in any build. It was already inlined everywhere. --- crates/oxc_lexer/src/pipeline/disambiguate/context/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/oxc_lexer/src/pipeline/disambiguate/context/mod.rs b/crates/oxc_lexer/src/pipeline/disambiguate/context/mod.rs index 10f5f6da6b..37b4b2d606 100644 --- a/crates/oxc_lexer/src/pipeline/disambiguate/context/mod.rs +++ b/crates/oxc_lexer/src/pipeline/disambiguate/context/mod.rs @@ -83,11 +83,13 @@ impl Walks { } #[cfg(test)] + #[inline(always)] pub(super) fn run_rules(&self) -> bool { !self.full_walk_only && !self.no_run_rules } #[cfg(not(test))] + #[inline(always)] pub(super) fn run_rules(&self) -> bool { true }