From ee4fb42d70ffc4e2e859d1747729757ddb5fb215 Mon Sep 17 00:00:00 2001 From: Boshen <1430279+Boshen@users.noreply.github.com> Date: Tue, 10 Sep 2024 14:01:36 +0000 Subject: [PATCH] perf(ast)!: reduce size of `WithClause` by `Box`ing it (#5677) relates #5601 --- crates/oxc_ast/src/ast/js.rs | 6 +- crates/oxc_ast/src/ast_builder_impl.rs | 4 +- crates/oxc_ast/src/ast_impl/js.rs | 2 +- .../oxc_ast/src/generated/assert_layouts.rs | 20 ++-- crates/oxc_ast/src/generated/ast_builder.rs | 106 +++++++++++++----- crates/oxc_codegen/src/gen.rs | 20 +--- crates/oxc_isolated_declarations/src/lib.rs | 10 +- .../src/plugins/inject_global_variables.rs | 10 +- crates/oxc_parser/src/js/module.rs | 2 +- .../src/helpers/module_imports.rs | 2 +- crates/oxc_traverse/src/generated/ancestor.rs | 28 ++--- crates/oxc_traverse/src/generated/walk.rs | 12 +- 12 files changed, 135 insertions(+), 87 deletions(-) diff --git a/crates/oxc_ast/src/ast/js.rs b/crates/oxc_ast/src/ast/js.rs index 15b58056816b7..cca85e2b93de0 100644 --- a/crates/oxc_ast/src/ast/js.rs +++ b/crates/oxc_ast/src/ast/js.rs @@ -2311,7 +2311,7 @@ pub struct ImportDeclaration<'a> { pub specifiers: Option>>, pub source: StringLiteral<'a>, /// Some(vec![]) for empty assertion - pub with_clause: Option>, + pub with_clause: Option>>, /// `import type { foo } from 'bar'` pub import_kind: ImportOrExportKind, } @@ -2452,7 +2452,7 @@ pub struct ExportNamedDeclaration<'a> { /// `export type { foo }` pub export_kind: ImportOrExportKind, /// Some(vec![]) for empty assertion - pub with_clause: Option>, + pub with_clause: Option>>, } /// Export Default Declaration @@ -2497,7 +2497,7 @@ pub struct ExportAllDeclaration<'a> { pub exported: Option>, pub source: StringLiteral<'a>, /// Will be `Some(vec![])` for empty assertion - pub with_clause: Option>, // Some(vec![]) for empty assertion + pub with_clause: Option>>, // Some(vec![]) for empty assertion pub export_kind: ImportOrExportKind, // `export type *` } diff --git a/crates/oxc_ast/src/ast_builder_impl.rs b/crates/oxc_ast/src/ast_builder_impl.rs index 611039179d4dd..f0727e1168697 100644 --- a/crates/oxc_ast/src/ast_builder_impl.rs +++ b/crates/oxc_ast/src/ast_builder_impl.rs @@ -174,7 +174,7 @@ impl<'a> AstBuilder<'a> { self.vec(), None, ImportOrExportKind::Value, - None, + None::, )) } @@ -191,7 +191,7 @@ impl<'a> AstBuilder<'a> { specifiers, source, ImportOrExportKind::Value, - None, + None::, )) } diff --git a/crates/oxc_ast/src/ast_impl/js.rs b/crates/oxc_ast/src/ast_impl/js.rs index 2f16cc4bade3f..15f327b10851c 100644 --- a/crates/oxc_ast/src/ast_impl/js.rs +++ b/crates/oxc_ast/src/ast_impl/js.rs @@ -1409,7 +1409,7 @@ impl<'a> ModuleDeclaration<'a> { } } - pub fn with_clause(&self) -> Option<&WithClause<'a>> { + pub fn with_clause(&self) -> Option<&Box<'a, WithClause<'a>>> { match self { Self::ImportDeclaration(decl) => decl.with_clause.as_ref(), Self::ExportAllDeclaration(decl) => decl.with_clause.as_ref(), diff --git a/crates/oxc_ast/src/generated/assert_layouts.rs b/crates/oxc_ast/src/generated/assert_layouts.rs index 636399610cafc..3511e0d07d914 100644 --- a/crates/oxc_ast/src/generated/assert_layouts.rs +++ b/crates/oxc_ast/src/generated/assert_layouts.rs @@ -706,13 +706,13 @@ const _: () = { assert!(offset_of!(ImportExpression, source) == 8usize); assert!(offset_of!(ImportExpression, arguments) == 24usize); - assert!(size_of::() == 136usize); + assert!(size_of::() == 80usize); assert!(align_of::() == 8usize); assert!(offset_of!(ImportDeclaration, span) == 0usize); assert!(offset_of!(ImportDeclaration, specifiers) == 8usize); assert!(offset_of!(ImportDeclaration, source) == 40usize); assert!(offset_of!(ImportDeclaration, with_clause) == 64usize); - assert!(offset_of!(ImportDeclaration, import_kind) == 128usize); + assert!(offset_of!(ImportDeclaration, import_kind) == 72usize); assert!(size_of::() == 16usize); assert!(align_of::() == 8usize); @@ -749,7 +749,7 @@ const _: () = { assert!(size_of::() == 32usize); assert!(align_of::() == 8usize); - assert!(size_of::() == 152usize); + assert!(size_of::() == 96usize); assert!(align_of::() == 8usize); assert!(offset_of!(ExportNamedDeclaration, span) == 0usize); assert!(offset_of!(ExportNamedDeclaration, declaration) == 8usize); @@ -764,13 +764,13 @@ const _: () = { assert!(offset_of!(ExportDefaultDeclaration, declaration) == 8usize); assert!(offset_of!(ExportDefaultDeclaration, exported) == 24usize); - assert!(size_of::() == 144usize); + assert!(size_of::() == 88usize); assert!(align_of::() == 8usize); assert!(offset_of!(ExportAllDeclaration, span) == 0usize); assert!(offset_of!(ExportAllDeclaration, exported) == 8usize); assert!(offset_of!(ExportAllDeclaration, source) == 48usize); assert!(offset_of!(ExportAllDeclaration, with_clause) == 72usize); - assert!(offset_of!(ExportAllDeclaration, export_kind) == 136usize); + assert!(offset_of!(ExportAllDeclaration, export_kind) == 80usize); assert!(size_of::() == 96usize); assert!(align_of::() == 8usize); @@ -2261,13 +2261,13 @@ const _: () = { assert!(offset_of!(ImportExpression, source) == 8usize); assert!(offset_of!(ImportExpression, arguments) == 16usize); - assert!(size_of::() == 84usize); + assert!(size_of::() == 48usize); assert!(align_of::() == 4usize); assert!(offset_of!(ImportDeclaration, span) == 0usize); assert!(offset_of!(ImportDeclaration, specifiers) == 8usize); assert!(offset_of!(ImportDeclaration, source) == 24usize); assert!(offset_of!(ImportDeclaration, with_clause) == 40usize); - assert!(offset_of!(ImportDeclaration, import_kind) == 80usize); + assert!(offset_of!(ImportDeclaration, import_kind) == 44usize); assert!(size_of::() == 8usize); assert!(align_of::() == 4usize); @@ -2304,7 +2304,7 @@ const _: () = { assert!(size_of::() == 20usize); assert!(align_of::() == 4usize); - assert!(size_of::() == 92usize); + assert!(size_of::() == 56usize); assert!(align_of::() == 4usize); assert!(offset_of!(ExportNamedDeclaration, span) == 0usize); assert!(offset_of!(ExportNamedDeclaration, declaration) == 8usize); @@ -2319,13 +2319,13 @@ const _: () = { assert!(offset_of!(ExportDefaultDeclaration, declaration) == 8usize); assert!(offset_of!(ExportDefaultDeclaration, exported) == 16usize); - assert!(size_of::() == 92usize); + assert!(size_of::() == 56usize); assert!(align_of::() == 4usize); assert!(offset_of!(ExportAllDeclaration, span) == 0usize); assert!(offset_of!(ExportAllDeclaration, exported) == 8usize); assert!(offset_of!(ExportAllDeclaration, source) == 32usize); assert!(offset_of!(ExportAllDeclaration, with_clause) == 48usize); - assert!(offset_of!(ExportAllDeclaration, export_kind) == 88usize); + assert!(offset_of!(ExportAllDeclaration, export_kind) == 52usize); assert!(size_of::() == 60usize); assert!(align_of::() == 4usize); diff --git a/crates/oxc_ast/src/generated/ast_builder.rs b/crates/oxc_ast/src/generated/ast_builder.rs index c28960d3bc0c7..88b6b6a36edd1 100644 --- a/crates/oxc_ast/src/generated/ast_builder.rs +++ b/crates/oxc_ast/src/generated/ast_builder.rs @@ -6740,14 +6740,17 @@ impl<'a> AstBuilder<'a> { /// - with_clause: Some(vec![]) for empty assertion /// - import_kind: `import type { foo } from 'bar'` #[inline] - pub fn module_declaration_import_declaration( + pub fn module_declaration_import_declaration( self, span: Span, specifiers: Option>>, source: StringLiteral<'a>, - with_clause: Option>, + with_clause: T1, import_kind: ImportOrExportKind, - ) -> ModuleDeclaration<'a> { + ) -> ModuleDeclaration<'a> + where + T1: IntoIn<'a, Option>>>, + { ModuleDeclaration::ImportDeclaration(self.alloc(self.import_declaration( span, specifiers, @@ -6777,14 +6780,17 @@ impl<'a> AstBuilder<'a> { /// - with_clause: Will be `Some(vec![])` for empty assertion /// - export_kind #[inline] - pub fn module_declaration_export_all_declaration( + pub fn module_declaration_export_all_declaration( self, span: Span, exported: Option>, source: StringLiteral<'a>, - with_clause: Option>, + with_clause: T1, export_kind: ImportOrExportKind, - ) -> ModuleDeclaration<'a> { + ) -> ModuleDeclaration<'a> + where + T1: IntoIn<'a, Option>>>, + { ModuleDeclaration::ExportAllDeclaration(self.alloc(self.export_all_declaration( span, exported, @@ -6852,15 +6858,18 @@ impl<'a> AstBuilder<'a> { /// - export_kind: `export type { foo }` /// - with_clause: Some(vec![]) for empty assertion #[inline] - pub fn module_declaration_export_named_declaration( + pub fn module_declaration_export_named_declaration( self, span: Span, declaration: Option>, specifiers: Vec<'a, ExportSpecifier<'a>>, source: Option>, export_kind: ImportOrExportKind, - with_clause: Option>, - ) -> ModuleDeclaration<'a> { + with_clause: T1, + ) -> ModuleDeclaration<'a> + where + T1: IntoIn<'a, Option>>>, + { ModuleDeclaration::ExportNamedDeclaration(self.alloc(self.export_named_declaration( span, declaration, @@ -7082,15 +7091,24 @@ impl<'a> AstBuilder<'a> { /// - with_clause: Some(vec![]) for empty assertion /// - import_kind: `import type { foo } from 'bar'` #[inline] - pub fn import_declaration( + pub fn import_declaration( self, span: Span, specifiers: Option>>, source: StringLiteral<'a>, - with_clause: Option>, + with_clause: T1, import_kind: ImportOrExportKind, - ) -> ImportDeclaration<'a> { - ImportDeclaration { span, specifiers, source, with_clause, import_kind } + ) -> ImportDeclaration<'a> + where + T1: IntoIn<'a, Option>>>, + { + ImportDeclaration { + span, + specifiers, + source, + with_clause: with_clause.into_in(self.allocator), + import_kind, + } } /// Builds a [`ImportDeclaration`] and stores it in the memory arena. @@ -7104,14 +7122,17 @@ impl<'a> AstBuilder<'a> { /// - with_clause: Some(vec![]) for empty assertion /// - import_kind: `import type { foo } from 'bar'` #[inline] - pub fn alloc_import_declaration( + pub fn alloc_import_declaration( self, span: Span, specifiers: Option>>, source: StringLiteral<'a>, - with_clause: Option>, + with_clause: T1, import_kind: ImportOrExportKind, - ) -> Box<'a, ImportDeclaration<'a>> { + ) -> Box<'a, ImportDeclaration<'a>> + where + T1: IntoIn<'a, Option>>>, + { Box::new_in( self.import_declaration(span, specifiers, source, with_clause, import_kind), self.allocator, @@ -7455,16 +7476,26 @@ impl<'a> AstBuilder<'a> { /// - export_kind: `export type { foo }` /// - with_clause: Some(vec![]) for empty assertion #[inline] - pub fn export_named_declaration( + pub fn export_named_declaration( self, span: Span, declaration: Option>, specifiers: Vec<'a, ExportSpecifier<'a>>, source: Option>, export_kind: ImportOrExportKind, - with_clause: Option>, - ) -> ExportNamedDeclaration<'a> { - ExportNamedDeclaration { span, declaration, specifiers, source, export_kind, with_clause } + with_clause: T1, + ) -> ExportNamedDeclaration<'a> + where + T1: IntoIn<'a, Option>>>, + { + ExportNamedDeclaration { + span, + declaration, + specifiers, + source, + export_kind, + with_clause: with_clause.into_in(self.allocator), + } } /// Builds a [`ExportNamedDeclaration`] and stores it in the memory arena. @@ -7479,15 +7510,18 @@ impl<'a> AstBuilder<'a> { /// - export_kind: `export type { foo }` /// - with_clause: Some(vec![]) for empty assertion #[inline] - pub fn alloc_export_named_declaration( + pub fn alloc_export_named_declaration( self, span: Span, declaration: Option>, specifiers: Vec<'a, ExportSpecifier<'a>>, source: Option>, export_kind: ImportOrExportKind, - with_clause: Option>, - ) -> Box<'a, ExportNamedDeclaration<'a>> { + with_clause: T1, + ) -> Box<'a, ExportNamedDeclaration<'a>> + where + T1: IntoIn<'a, Option>>>, + { Box::new_in( self.export_named_declaration( span, @@ -7548,15 +7582,24 @@ impl<'a> AstBuilder<'a> { /// - with_clause: Will be `Some(vec![])` for empty assertion /// - export_kind #[inline] - pub fn export_all_declaration( + pub fn export_all_declaration( self, span: Span, exported: Option>, source: StringLiteral<'a>, - with_clause: Option>, + with_clause: T1, export_kind: ImportOrExportKind, - ) -> ExportAllDeclaration<'a> { - ExportAllDeclaration { span, exported, source, with_clause, export_kind } + ) -> ExportAllDeclaration<'a> + where + T1: IntoIn<'a, Option>>>, + { + ExportAllDeclaration { + span, + exported, + source, + with_clause: with_clause.into_in(self.allocator), + export_kind, + } } /// Builds a [`ExportAllDeclaration`] and stores it in the memory arena. @@ -7570,14 +7613,17 @@ impl<'a> AstBuilder<'a> { /// - with_clause: Will be `Some(vec![])` for empty assertion /// - export_kind #[inline] - pub fn alloc_export_all_declaration( + pub fn alloc_export_all_declaration( self, span: Span, exported: Option>, source: StringLiteral<'a>, - with_clause: Option>, + with_clause: T1, export_kind: ImportOrExportKind, - ) -> Box<'a, ExportAllDeclaration<'a>> { + ) -> Box<'a, ExportAllDeclaration<'a>> + where + T1: IntoIn<'a, Option>>>, + { Box::new_in( self.export_all_declaration(span, exported, source, with_clause, export_kind), self.allocator, diff --git a/crates/oxc_codegen/src/gen.rs b/crates/oxc_codegen/src/gen.rs index 8240b96880ef6..57a9f0c2e161b 100644 --- a/crates/oxc_codegen/src/gen.rs +++ b/crates/oxc_codegen/src/gen.rs @@ -719,10 +719,10 @@ impl<'a> Gen for ImportDeclaration<'a> { p.print_char(b'"'); p.print_str(self.source.value.as_str()); p.print_char(b'"'); - if self.with_clause.is_some() { + if let Some(with_clause) = &self.with_clause { p.print_hard_space(); + with_clause.gen(p, ctx); } - self.with_clause.gen(p, ctx); p.print_semicolon_after_statement(); return; } @@ -802,23 +802,15 @@ impl<'a> Gen for ImportDeclaration<'a> { p.print_str(" from "); } self.source.gen(p, ctx); - if self.with_clause.is_some() { + if let Some(with_clause) = &self.with_clause { p.print_hard_space(); + with_clause.gen(p, ctx); } - self.with_clause.gen(p, ctx); p.add_source_mapping(self.span.end); p.print_semicolon_after_statement(); } } -impl<'a> Gen for Option> { - fn gen(&self, p: &mut Codegen, ctx: Context) { - if let Some(with_clause) = self { - with_clause.gen(p, ctx); - } - } -} - impl<'a> Gen for WithClause<'a> { fn gen(&self, p: &mut Codegen, ctx: Context) { p.add_source_mapping(self.span.start); @@ -976,10 +968,10 @@ impl<'a> Gen for ExportAllDeclaration<'a> { p.print_str(" from "); self.source.gen(p, ctx); - if self.with_clause.is_some() { + if let Some(with_clause) = &self.with_clause { p.print_hard_space(); + with_clause.gen(p, ctx); } - self.with_clause.gen(p, ctx); p.print_semicolon_after_statement(); } } diff --git a/crates/oxc_isolated_declarations/src/lib.rs b/crates/oxc_isolated_declarations/src/lib.rs index 37123dc073e3f..087c8f0afe696 100644 --- a/crates/oxc_isolated_declarations/src/lib.rs +++ b/crates/oxc_isolated_declarations/src/lib.rs @@ -309,8 +309,14 @@ impl<'a> IsolatedDeclarations<'a> { if need_empty_export_marker { let specifiers = self.ast.vec(); let kind = ImportOrExportKind::Value; - let empty_export = - self.ast.alloc_export_named_declaration(SPAN, None, specifiers, None, kind, None); + let empty_export = self.ast.alloc_export_named_declaration( + SPAN, + None, + specifiers, + None, + kind, + None::, + ); new_ast_stmts .push(Statement::from(ModuleDeclaration::ExportNamedDeclaration(empty_export))); } diff --git a/crates/oxc_minifier/src/plugins/inject_global_variables.rs b/crates/oxc_minifier/src/plugins/inject_global_variables.rs index 3059ef802a891..68fda18adfe0b 100644 --- a/crates/oxc_minifier/src/plugins/inject_global_variables.rs +++ b/crates/oxc_minifier/src/plugins/inject_global_variables.rs @@ -185,9 +185,13 @@ impl<'a> InjectGlobalVariables<'a> { let specifiers = Some(self.ast.vec1(self.inject_import_to_specifier(inject))); let source = self.ast.string_literal(SPAN, inject.source.as_str()); let kind = ImportOrExportKind::Value; - let import_decl = self - .ast - .module_declaration_import_declaration(SPAN, specifiers, source, None, kind); + let import_decl = self.ast.module_declaration_import_declaration( + SPAN, + specifiers, + source, + None::, + kind, + ); self.ast.statement_module_declaration(import_decl) }); program.body.splice(0..0, imports); diff --git a/crates/oxc_parser/src/js/module.rs b/crates/oxc_parser/src/js/module.rs index 4e987fa10de2f..c46a8b21cb082 100644 --- a/crates/oxc_parser/src/js/module.rs +++ b/crates/oxc_parser/src/js/module.rs @@ -347,7 +347,7 @@ impl<'a> ParserImpl<'a> { self.ast.vec(), None, ImportOrExportKind::Value, - None, + None::, )) } diff --git a/crates/oxc_transformer/src/helpers/module_imports.rs b/crates/oxc_transformer/src/helpers/module_imports.rs index 56a0eeb77a4f5..46b65d6e424fb 100644 --- a/crates/oxc_transformer/src/helpers/module_imports.rs +++ b/crates/oxc_transformer/src/helpers/module_imports.rs @@ -108,7 +108,7 @@ impl<'a> ModuleImports<'a> { SPAN, Some(specifiers), StringLiteral::new(SPAN, source), - None, + None::, ImportOrExportKind::Value, ); self.ast.statement_module_declaration(import_stmt) diff --git a/crates/oxc_traverse/src/generated/ancestor.rs b/crates/oxc_traverse/src/generated/ancestor.rs index 8234cd1f87de6..20c55e0d69f50 100644 --- a/crates/oxc_traverse/src/generated/ancestor.rs +++ b/crates/oxc_traverse/src/generated/ancestor.rs @@ -8064,10 +8064,10 @@ impl<'a, 't> ImportDeclarationWithoutSpecifiers<'a, 't> { } #[inline] - pub fn with_clause(self) -> &'t Option> { + pub fn with_clause(self) -> &'t Option>> { unsafe { &*((self.0 as *const u8).add(OFFSET_IMPORT_DECLARATION_WITH_CLAUSE) - as *const Option>) + as *const Option>>) } } @@ -8102,10 +8102,10 @@ impl<'a, 't> ImportDeclarationWithoutSource<'a, 't> { } #[inline] - pub fn with_clause(self) -> &'t Option> { + pub fn with_clause(self) -> &'t Option>> { unsafe { &*((self.0 as *const u8).add(OFFSET_IMPORT_DECLARATION_WITH_CLAUSE) - as *const Option>) + as *const Option>>) } } @@ -8413,10 +8413,10 @@ impl<'a, 't> ExportNamedDeclarationWithoutDeclaration<'a, 't> { } #[inline] - pub fn with_clause(self) -> &'t Option> { + pub fn with_clause(self) -> &'t Option>> { unsafe { &*((self.0 as *const u8).add(OFFSET_EXPORT_NAMED_DECLARATION_WITH_CLAUSE) - as *const Option>) + as *const Option>>) } } } @@ -8461,10 +8461,10 @@ impl<'a, 't> ExportNamedDeclarationWithoutSpecifiers<'a, 't> { } #[inline] - pub fn with_clause(self) -> &'t Option> { + pub fn with_clause(self) -> &'t Option>> { unsafe { &*((self.0 as *const u8).add(OFFSET_EXPORT_NAMED_DECLARATION_WITH_CLAUSE) - as *const Option>) + as *const Option>>) } } } @@ -8509,10 +8509,10 @@ impl<'a, 't> ExportNamedDeclarationWithoutSource<'a, 't> { } #[inline] - pub fn with_clause(self) -> &'t Option> { + pub fn with_clause(self) -> &'t Option>> { unsafe { &*((self.0 as *const u8).add(OFFSET_EXPORT_NAMED_DECLARATION_WITH_CLAUSE) - as *const Option>) + as *const Option>>) } } } @@ -8652,10 +8652,10 @@ impl<'a, 't> ExportAllDeclarationWithoutExported<'a, 't> { } #[inline] - pub fn with_clause(self) -> &'t Option> { + pub fn with_clause(self) -> &'t Option>> { unsafe { &*((self.0 as *const u8).add(OFFSET_EXPORT_ALL_DECLARATION_WITH_CLAUSE) - as *const Option>) + as *const Option>>) } } @@ -8690,10 +8690,10 @@ impl<'a, 't> ExportAllDeclarationWithoutSource<'a, 't> { } #[inline] - pub fn with_clause(self) -> &'t Option> { + pub fn with_clause(self) -> &'t Option>> { unsafe { &*((self.0 as *const u8).add(OFFSET_EXPORT_ALL_DECLARATION_WITH_CLAUSE) - as *const Option>) + as *const Option>>) } } diff --git a/crates/oxc_traverse/src/generated/walk.rs b/crates/oxc_traverse/src/generated/walk.rs index 8049506aecd24..f612c5de5acb4 100644 --- a/crates/oxc_traverse/src/generated/walk.rs +++ b/crates/oxc_traverse/src/generated/walk.rs @@ -2785,10 +2785,10 @@ pub(crate) unsafe fn walk_import_declaration<'a, Tr: Traverse<'a>>( ); if let Some(field) = &mut *((node as *mut u8) .add(ancestor::OFFSET_IMPORT_DECLARATION_WITH_CLAUSE) - as *mut Option) + as *mut Option>) { ctx.retag_stack(AncestorType::ImportDeclarationWithClause); - walk_with_clause(traverser, field as *mut _, ctx); + walk_with_clause(traverser, (&mut **field) as *mut _, ctx); } ctx.pop_stack(pop_token); traverser.exit_import_declaration(&mut *node, ctx); @@ -2974,10 +2974,10 @@ pub(crate) unsafe fn walk_export_named_declaration<'a, Tr: Traverse<'a>>( } if let Some(field) = &mut *((node as *mut u8) .add(ancestor::OFFSET_EXPORT_NAMED_DECLARATION_WITH_CLAUSE) - as *mut Option) + as *mut Option>) { ctx.retag_stack(AncestorType::ExportNamedDeclarationWithClause); - walk_with_clause(traverser, field as *mut _, ctx); + walk_with_clause(traverser, (&mut **field) as *mut _, ctx); } ctx.pop_stack(pop_token); traverser.exit_export_named_declaration(&mut *node, ctx); @@ -3032,10 +3032,10 @@ pub(crate) unsafe fn walk_export_all_declaration<'a, Tr: Traverse<'a>>( ); if let Some(field) = &mut *((node as *mut u8) .add(ancestor::OFFSET_EXPORT_ALL_DECLARATION_WITH_CLAUSE) - as *mut Option) + as *mut Option>) { ctx.retag_stack(AncestorType::ExportAllDeclarationWithClause); - walk_with_clause(traverser, field as *mut _, ctx); + walk_with_clause(traverser, (&mut **field) as *mut _, ctx); } ctx.pop_stack(pop_token); traverser.exit_export_all_declaration(&mut *node, ctx);