Skip to content

Commit a615e76

Browse files
committed
refactor(transformer/arrow-functions): do not inline non-trivial visitor method (#8321)
Follow-on after #8024. Don't inline `visit_statements` visitor method. This visitor is not so small, and always executes unconditionally. The compiler can decide whether to inline it or not. Where `#[inline]` is really valuable is: 1. Where the function is tiny so the cost of moving it into the caller is small. and 2. The function gets called a lot e.g. `visit_expression`, `visit_statement`, `visit_identifier_reference`. 3. Most commonly the function checks something and exits "nothing to do here". e.g. `visit_expression` where you only need to transform a particular type of `Expression`.
1 parent 32a0ee9 commit a615e76

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

crates/oxc_transformer/src/common/arrow_function_converter.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1137,7 +1137,6 @@ impl<'a> VisitMut<'a> for ConstructorBodyThisAfterSuperInserter<'a, '_> {
11371137
}
11381138

11391139
/// `super()` -> `super(); _this = this;`
1140-
#[inline]
11411140
fn visit_statements(&mut self, statements: &mut ArenaVec<'a, Statement<'a>>) {
11421141
let mut new_stmts = vec![];
11431142

0 commit comments

Comments
 (0)