refactor(lexer): compile Lanes::clear separately for each CPU feature set (#28643)

Part of effort to move to runtime CPU feature detection.

Apply `cpu_versions!` to `Lanes::clear`. It doesn't use `cpu` yet. Its only caller `lex_raw_impl` passes `cpu`.

Codegen: no change in any build. `Lanes::clear` was already inlined into `lex_raw_impl`, and still is.
This commit is contained in:
overlookmotel committed 2026-11-01 23:34:19 +00:00
1 parent e40bdac2f5
commit 74e7ceed35
2 files changed
+3 -2

No files matched your search

+2 -1
View File
@@ -50,7 +50,8 @@ pub(crate) struct Lanes {
}
impl Lanes {
pub(super) fn clear(&mut self) {
#[apply(cpu_versions)]
pub(super) fn clear(&mut self, _cpu: impl Cpu) {
self.numbers.clear();
self.strings.clear();
self.templates.clear();
+1 -1
View File
@@ -165,7 +165,7 @@ impl Lexer {
) -> usize {
debug_assert!(src.len() >= n + PAD, "source must extend PAD zeroed bytes past n");
self.ensure(n);
self.lanes.clear();
self.lanes.clear(cpu);
self.lanes.module = module;
self.lanes.disambiguate.begin(n, module, cpu);
if n == 0 {