Skip to content

Commit

Permalink
refactor: don't inline all structs.
Browse files Browse the repository at this point in the history
  • Loading branch information
rzvxa committed Jul 2, 2024
1 parent 7db9dde commit 7509233
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
2 changes: 0 additions & 2 deletions crates/oxc_ast/src/generated/visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2961,7 +2961,6 @@ pub mod walk {
}
}

#[inline]
pub fn walk_class<'a, V: Visit<'a>>(visitor: &mut V, it: &Class<'a>) {
let kind = AstKind::Class(visitor.alloc(it));
visitor.enter_node(kind);
Expand Down Expand Up @@ -3057,7 +3056,6 @@ pub mod walk {
visitor.leave_node(kind);
}

#[inline]
pub fn walk_function<'a, V: Visit<'a>>(
visitor: &mut V,
it: &Function<'a>,
Expand Down
2 changes: 0 additions & 2 deletions crates/oxc_ast/src/generated/visit_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3086,7 +3086,6 @@ pub mod walk_mut {
}
}

#[inline]
pub fn walk_class<'a, V: VisitMut<'a>>(visitor: &mut V, it: &mut Class<'a>) {
let kind = AstType::Class;
visitor.enter_node(kind);
Expand Down Expand Up @@ -3182,7 +3181,6 @@ pub mod walk_mut {
visitor.leave_node(kind);
}

#[inline]
pub fn walk_function<'a, V: VisitMut<'a>>(
visitor: &mut V,
it: &mut Function<'a>,
Expand Down
4 changes: 2 additions & 2 deletions tasks/ast_codegen/src/generators/visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -632,8 +632,8 @@ impl<'a> VisitBuilder<'a> {
_ => body,
};

// always inline struct walks
(result, true)
// inline if there are 5 or less fields.
(result, fields_visits.len() <= 5)
}

fn analyze_type(&self, ty: &Type) -> Option<(TypeRef, TypeWrapper)> {
Expand Down

0 comments on commit 7509233

Please sign in to comment.