mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
perf(parser): inline end_span and parse_identifier_kind which are on the hot path (#2612)
This commit is contained in:
parent
49778abb80
commit
bf42158ad7
3 changed files with 5 additions and 4 deletions
|
|
@ -146,8 +146,8 @@ opt-level = 'z'
|
|||
opt-level = 3
|
||||
lto = "fat"
|
||||
codegen-units = 1
|
||||
strip = "symbols"
|
||||
debug = false
|
||||
strip = false
|
||||
debug = true
|
||||
panic = "abort" # Let it crash and force ourselves to write safe Rust.
|
||||
|
||||
# Use the `--profile release-debug` flag to show symbols in release mode.
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@ impl<'a> ParserImpl<'a> {
|
|||
Span::new(token.start, 0)
|
||||
}
|
||||
|
||||
pub(crate) fn end_span(&self, span: Span) -> Span {
|
||||
let mut span = span;
|
||||
#[inline]
|
||||
pub(crate) fn end_span(&self, mut span: Span) -> Span {
|
||||
span.end = self.prev_token_end;
|
||||
span
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,6 +102,7 @@ impl<'a> ParserImpl<'a> {
|
|||
IdentifierName { span, name }
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub(crate) fn parse_identifier_kind(&mut self, kind: Kind) -> (Span, Atom<'a>) {
|
||||
let span = self.start_span();
|
||||
let name = self.cur_string();
|
||||
|
|
|
|||
Loading…
Reference in a new issue