mirror of
https://github.com/oxc-project/oxc.git
synced 2026-11-04 10:29:58 +00:00
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:
1 parent
e40bdac2f5
commit
74e7ceed35
2 files changed
+3
-2
No files matched your search
@@ -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();
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user