Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ termcolor = "1.0"
thiserror = "1.0.30"
tokio = { version = "1", default-features = false }
toml = "0.8.2"
tracing = "0.1.41"
tracing = { version = "0.1.41", features = ["max_level_off", "release_max_level_off"] }
tracing-chrome = "0.7.2"
tracing-subscriber = "0.3.20"
triomphe = "0.1.13"
Expand Down
2 changes: 0 additions & 2 deletions crates/swc_cli_impl/src/commands/bundle.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
use clap::Parser;
use swc_core::trace_macro::swc_trace;

#[derive(Parser)]
pub struct BundleOptions {}

#[swc_trace]
impl super::CommandRunner for BundleOptions {
fn execute(&self) -> anyhow::Result<()> {
unimplemented!("Bundle command is not yet implemented")
Expand Down
2 changes: 0 additions & 2 deletions crates/swc_cli_impl/src/commands/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ struct InputContext {
file_extension: PathBuf,
}

#[swc_trace]
impl CompileOptions {
fn build_transform_options(&self, file_path: &Option<&Path>) -> anyhow::Result<Options> {
let config_file = self.config_file.as_ref().map(|config_file_path| {
Expand Down Expand Up @@ -552,7 +551,6 @@ impl CompileOptions {
}
}

#[swc_trace]
impl super::CommandRunner for CompileOptions {
fn execute(&self) -> anyhow::Result<()> {
let guard = if self.experimental_trace {
Expand Down
2 changes: 0 additions & 2 deletions crates/swc_cli_impl/src/commands/lint.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
use clap::Parser;
use swc_core::trace_macro::swc_trace;

#[derive(Parser)]
pub struct LintOptions {}

#[swc_trace]
impl super::CommandRunner for LintOptions {
fn execute(&self) -> anyhow::Result<()> {
unimplemented!("Lint command is not yet implemented")
Expand Down
2 changes: 0 additions & 2 deletions crates/swc_cli_impl/src/commands/minify.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
use clap::Parser;
use swc_core::trace_macro::swc_trace;

#[derive(Parser)]
pub struct MinifyOptions {}

#[swc_trace]
impl super::CommandRunner for MinifyOptions {
fn execute(&self) -> anyhow::Result<()> {
unimplemented!("Minify command is not yet implemented")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use swc_ecma_ast::*;
use swc_ecma_compat_es2015::arrow;
use swc_ecma_utils::prepend_stmt;
use swc_ecma_visit::{fold_pass, standard_only_fold, Fold, FoldWith, InjectVars, VisitMutWith};
use swc_trace_macro::swc_trace;

/// A bugfix pass for Safari 10.3.
///
Expand All @@ -26,7 +25,6 @@ struct AsyncArrowsInClass {
}

/// TODO: VisitMut
#[swc_trace]
impl Fold for AsyncArrowsInClass {
standard_only_fold!();

Expand Down
2 changes: 0 additions & 2 deletions crates/swc_ecma_compat_bugfixes/src/edge_default_param.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use swc_ecma_ast::*;
use swc_ecma_visit::{noop_visit_mut_type, visit_mut_pass, VisitMut, VisitMutWith};
use swc_trace_macro::swc_trace;

/// A bugfix pass for Edge.
///
Expand All @@ -16,7 +15,6 @@ struct EdgeDefaultParam {
in_arrow: bool,
}

#[swc_trace]
impl VisitMut for EdgeDefaultParam {
noop_visit_mut_type!(fail);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use swc_common::SyntaxContext;
use swc_ecma_ast::*;
use swc_ecma_transforms_base::hygiene::rename;
use swc_ecma_visit::{noop_visit_mut_type, visit_mut_pass, VisitMut, VisitMutWith};
use swc_trace_macro::swc_trace;

pub fn safari_id_destructuring_collision_in_function_expression() -> impl Pass {
visit_mut_pass(SafariIdDestructuringCollisionInFunctionExpression::default())
Expand All @@ -30,7 +29,6 @@ impl SafariIdDestructuringCollisionInFunctionExpression {
}
}

#[swc_trace]
impl VisitMut for SafariIdDestructuringCollisionInFunctionExpression {
noop_visit_mut_type!(fail);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use swc_common::DUMMY_SP;
use swc_ecma_ast::*;
use swc_ecma_utils::{prepend_stmt, private_ident, ExprFactory};
use swc_ecma_visit::{fold_pass, standard_only_fold, Fold, FoldWith};
use swc_trace_macro::swc_trace;

// Converts destructured parameters with default values to non-shorthand syntax.
// This fixes the only Tagged Templates-related bug in ES Modules-supporting
Expand Down Expand Up @@ -57,7 +56,6 @@ impl TemplateLiteralCaching {
}

/// TODO: VisitMut
#[swc_trace]
impl Fold for TemplateLiteralCaching {
standard_only_fold!();

Expand Down
2 changes: 0 additions & 2 deletions crates/swc_ecma_compat_es2015/src/arrow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use swc_ecma_utils::{
prepend_stmt,
};
use swc_ecma_visit::{noop_visit_mut_type, visit_mut_pass, InjectVars, VisitMut, VisitMutWith};
use swc_trace_macro::swc_trace;

/// Compile ES2015 arrow functions to ES5
///
Expand Down Expand Up @@ -70,7 +69,6 @@ struct Arrow {
hoister: FnEnvHoister,
}

#[swc_trace]
impl VisitMut for Arrow {
noop_visit_mut_type!(fail);

Expand Down
2 changes: 0 additions & 2 deletions crates/swc_ecma_compat_es2015/src/block_scoped_fn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use swc_common::{util::take::Take, DUMMY_SP};
use swc_ecma_ast::*;
use swc_ecma_utils::IdentUsageFinder;
use swc_ecma_visit::{noop_visit_mut_type, visit_mut_pass, VisitMut, VisitMutWith};
use swc_trace_macro::swc_trace;

pub fn block_scoped_functions() -> impl Pass {
visit_mut_pass(BlockScopedFns)
Expand All @@ -11,7 +10,6 @@ pub fn block_scoped_functions() -> impl Pass {
#[derive(Clone, Copy)]
struct BlockScopedFns;

#[swc_trace]
impl VisitMut for BlockScopedFns {
noop_visit_mut_type!(fail);

Expand Down
4 changes: 0 additions & 4 deletions crates/swc_ecma_compat_es2015/src/block_scoping/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ use swc_ecma_utils::{
use swc_ecma_visit::{
noop_visit_mut_type, visit_mut_obj_and_computed, visit_mut_pass, VisitMut, VisitMutWith,
};
use swc_trace_macro::swc_trace;

mod vars;

Expand Down Expand Up @@ -429,7 +428,6 @@ impl BlockScoping {
}
}

#[swc_trace]
impl VisitMut for BlockScoping {
noop_visit_mut_type!(fail);

Expand Down Expand Up @@ -679,7 +677,6 @@ impl FlowHelper<'_> {
}
}

#[swc_trace]
impl VisitMut for FlowHelper<'_> {
noop_visit_mut_type!(fail);

Expand Down Expand Up @@ -912,7 +909,6 @@ impl MutationHandler<'_> {
}
}

#[swc_trace]
impl VisitMut for MutationHandler<'_> {
noop_visit_mut_type!(fail);

Expand Down
4 changes: 0 additions & 4 deletions crates/swc_ecma_compat_es2015/src/block_scoping/vars.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use swc_common::{Mark, SyntaxContext};
use swc_ecma_ast::*;
use swc_ecma_transforms_base::{rename::rename_with_config, scope::ScopeKind};
use swc_ecma_visit::{noop_visit_mut_type, VisitMut, VisitMutWith};
use swc_trace_macro::swc_trace;

pub(super) fn block_scoped_vars() -> impl VisitMut {
BlockScopedVars::default()
Expand Down Expand Up @@ -36,7 +35,6 @@ struct ParentScope<'a> {
vars: &'a IndexMap<Id, VarDeclKind, FxBuildHasher>,
}

#[swc_trace]
impl BlockScopedVars {
fn add_usage(&mut self, id: Id) {
if !self.scope.usages.contains(&id) {
Expand Down Expand Up @@ -103,7 +101,6 @@ impl BlockScopedVars {
}
}

#[swc_trace]
impl Scope {
fn rename(&mut self, parent: ParentScope, rename_map: &mut FxHashMap<Id, Id>, fn_only: bool) {
for s in self.children.iter_mut() {
Expand Down Expand Up @@ -234,7 +231,6 @@ impl ParentScope<'_> {
}
}

#[swc_trace]
impl VisitMut for BlockScopedVars {
noop_visit_mut_type!(fail);

Expand Down
3 changes: 0 additions & 3 deletions crates/swc_ecma_compat_es2015/src/classes/constructor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use swc_ecma_transforms_base::{helper, helper_expr};
use swc_ecma_transforms_classes::super_field::SuperFieldAccessFolder;
use swc_ecma_utils::{default_constructor_with_span, private_ident, quote_ident, ExprFactory};
use swc_ecma_visit::{noop_visit_mut_type, VisitMut, VisitMutWith};
use swc_trace_macro::swc_trace;
use tracing::debug;

use super::Config;
Expand Down Expand Up @@ -231,7 +230,6 @@ struct ConstructorFolder {
this_ref_count: usize,
}

#[swc_trace]
impl VisitMut for ConstructorFolder {
noop_visit_mut_type!(fail);

Expand Down Expand Up @@ -420,7 +418,6 @@ impl VisitMut for ConstructorFolder {
}
}

#[swc_trace]
impl ConstructorFolder {
fn get_this(&mut self) -> &Ident {
self.this_ref_count += 1;
Expand Down
4 changes: 0 additions & 4 deletions crates/swc_ecma_compat_es2015/src/classes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ use swc_ecma_utils::{
use swc_ecma_visit::{
noop_visit_mut_type, noop_visit_type, visit_mut_pass, Visit, VisitMut, VisitMutWith,
};
use swc_trace_macro::swc_trace;

use self::{
constructor::fold_constructor,
Expand Down Expand Up @@ -98,7 +97,6 @@ struct Data {
get: Option<Box<Expr>>,
}

#[swc_trace]
impl Classes {
fn visit_mut_stmt_like<T>(&mut self, stmts: &mut Vec<T>)
where
Expand Down Expand Up @@ -201,7 +199,6 @@ impl Classes {
}
}

#[swc_trace]
#[fast_path(ClassFinder)]
impl VisitMut for Classes {
noop_visit_mut_type!(fail);
Expand Down Expand Up @@ -331,7 +328,6 @@ impl VisitMut for Classes {
}
}

#[swc_trace]
impl Classes {
fn add_pure_comments(&mut self, start: &mut BytePos) {
*start = BytePos::PURE;
Expand Down
3 changes: 0 additions & 3 deletions crates/swc_ecma_compat_es2015/src/computed_props.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use swc_ecma_utils::{quote_ident, ExprFactory, StmtLike};
use swc_ecma_visit::{
noop_visit_mut_type, noop_visit_type, visit_mut_pass, Visit, VisitMut, VisitMutWith, VisitWith,
};
use swc_trace_macro::swc_trace;

/// `@babel/plugin-transform-computed-properties`
///
Expand Down Expand Up @@ -60,7 +59,6 @@ struct ComputedProps {
c: Config,
}

#[swc_trace]
impl VisitMut for ComputedProps {
noop_visit_mut_type!(fail);

Expand Down Expand Up @@ -368,7 +366,6 @@ impl Visit for ComplexVisitor {
}
}

#[swc_trace]
impl ComputedProps {
fn visit_mut_stmt_like<T>(&mut self, stmts: &mut Vec<T>)
where
Expand Down
6 changes: 0 additions & 6 deletions crates/swc_ecma_compat_es2015/src/destructuring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use swc_ecma_utils::{
use swc_ecma_visit::{
noop_visit_mut_type, noop_visit_type, visit_mut_pass, Visit, VisitMut, VisitMutWith, VisitWith,
};
use swc_trace_macro::swc_trace;

/// `@babel/plugin-transform-destructuring`
///
Expand Down Expand Up @@ -150,7 +149,6 @@ fn make_ref_ident_for_for_stmt() -> Ident {
private_ident!("ref")
}

#[swc_trace]
impl AssignFolder {
fn visit_mut_var_decl(&mut self, decls: &mut Vec<VarDeclarator>, decl: VarDeclarator) {
match decl.name {
Expand Down Expand Up @@ -474,7 +472,6 @@ impl AssignFolder {
}
}

#[swc_trace]
#[fast_path(DestructuringVisitor)]
impl VisitMut for Destructuring {
noop_visit_mut_type!(fail);
Expand All @@ -494,7 +491,6 @@ impl VisitMut for Destructuring {
}
}

#[swc_trace]
impl Destructuring {
fn visit_mut_fn_like(
&mut self,
Expand Down Expand Up @@ -606,7 +602,6 @@ impl AssignFolder {
}
}

#[swc_trace]
#[fast_path(DestructuringVisitor)]
impl VisitMut for AssignFolder {
noop_visit_mut_type!(fail);
Expand Down Expand Up @@ -1104,7 +1099,6 @@ impl VisitMut for AssignFolder {
}
}

#[swc_trace]
impl Destructuring {
fn visit_mut_stmt_like<T>(&mut self, stmts: &mut Vec<T>)
where
Expand Down
4 changes: 0 additions & 4 deletions crates/swc_ecma_compat_es2015/src/for_of.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use swc_ecma_utils::{
alias_if_required, member_expr, prepend_stmt, private_ident, quote_ident, ExprFactory,
};
use swc_ecma_visit::{noop_visit_mut_type, visit_mut_pass, VisitMut, VisitMutWith};
use swc_trace_macro::swc_trace;

/// `@babel/plugin-transform-for-of`
///
Expand Down Expand Up @@ -74,7 +73,6 @@ struct ForOf {
top_level_vars: Vec<VarDeclarator>,
}

#[swc_trace]
impl ForOf {
fn fold_for_stmt(
&mut self,
Expand Down Expand Up @@ -656,7 +654,6 @@ impl Parallel for ForOf {
}
}

#[swc_trace]
impl ParExplode for ForOf {
fn after_one_stmt(&mut self, stmts: &mut Vec<Stmt>) {
// Add variable declaration
Expand Down Expand Up @@ -693,7 +690,6 @@ impl ParExplode for ForOf {
}
}

#[swc_trace]
#[parallel(explode)]
impl VisitMut for ForOf {
noop_visit_mut_type!(fail);
Expand Down
2 changes: 0 additions & 2 deletions crates/swc_ecma_compat_es2015/src/new_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use swc_ecma_utils::{private_ident, quote_ident, ExprFactory};
use swc_ecma_visit::{
noop_visit_mut_type, noop_visit_type, visit_mut_pass, Visit, VisitMut, VisitMutWith,
};
use swc_trace_macro::swc_trace;

pub fn new_target() -> impl Pass {
visit_mut_pass(NewTarget {
Expand Down Expand Up @@ -35,7 +34,6 @@ impl NewTarget {
}
}

#[swc_trace]
impl VisitMut for NewTarget {
noop_visit_mut_type!(fail);

Expand Down
Loading
Loading