Skip to content

Commit f5721a4

Browse files
committed
chore: remove unconditioned instrument code
1 parent d14de24 commit f5721a4

File tree

29 files changed

+0
-85
lines changed

29 files changed

+0
-85
lines changed

bindings/binding_core_node/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ pub struct JsCompiler {
5858
impl JsCompiler {
5959
#[napi(constructor)]
6060
#[allow(clippy::new_without_default)]
61-
#[tracing::instrument(level = "info", skip_all)]
6261
pub fn new() -> Self {
6362
Self {
6463
_compiler: COMPILER.clone(),

crates/swc/src/lib.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,6 @@ impl Compiler {
465465
}
466466
}
467467

468-
#[tracing::instrument(skip_all)]
469468
pub fn read_config(&self, opts: &Options, name: &FileName) -> Result<Option<Config>, Error> {
470469
static CUR_DIR: Lazy<PathBuf> = Lazy::new(|| {
471470
if cfg!(target_arch = "wasm32") {
@@ -577,7 +576,6 @@ impl Compiler {
577576
/// This method handles merging of config.
578577
///
579578
/// This method does **not** parse module.
580-
#[tracing::instrument(skip_all)]
581579
pub fn parse_js_as_input<'a, P>(
582580
&'a self,
583581
fm: Lrc<SourceFile>,
@@ -642,7 +640,6 @@ impl Compiler {
642640
})
643641
}
644642

645-
#[tracing::instrument(skip_all)]
646643
pub fn transform(
647644
&self,
648645
handler: &Handler,
@@ -670,7 +667,6 @@ impl Compiler {
670667
///
671668
/// This means, you can use `noop_visit_type`, `noop_fold_type` and
672669
/// `noop_visit_mut_type` in your visitor to reduce the binary size.
673-
#[tracing::instrument(skip_all)]
674670
pub fn process_js_with_custom_pass<P1, P2>(
675671
&self,
676672
fm: Arc<SourceFile>,
@@ -727,7 +723,6 @@ impl Compiler {
727723
})
728724
}
729725

730-
#[tracing::instrument(skip(self, handler, opts))]
731726
pub fn process_js_file(
732727
&self,
733728
fm: Arc<SourceFile>,
@@ -745,7 +740,6 @@ impl Compiler {
745740
)
746741
}
747742

748-
#[tracing::instrument(skip_all)]
749743
pub fn minify(
750744
&self,
751745
fm: Arc<SourceFile>,
@@ -938,7 +932,6 @@ impl Compiler {
938932
/// You can use custom pass with this method.
939933
///
940934
/// Pass building logic has been inlined into the configuration system.
941-
#[tracing::instrument(skip_all)]
942935
pub fn process_js(
943936
&self,
944937
handler: &Handler,
@@ -959,7 +952,6 @@ impl Compiler {
959952
)
960953
}
961954

962-
#[tracing::instrument(name = "swc::Compiler::apply_transforms", skip_all)]
963955
fn apply_transforms(
964956
&self,
965957
handler: &Handler,
@@ -1124,7 +1116,6 @@ fn find_swcrc(path: &Path, root: &Path, root_mode: RootMode) -> Option<PathBuf>
11241116
None
11251117
}
11261118

1127-
#[tracing::instrument(skip_all)]
11281119
fn load_swcrc(path: &Path) -> Result<Rc, Error> {
11291120
let content = read_to_string(path).context("failed to read config (.swcrc) file")?;
11301121

crates/swc/src/plugin.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ impl RustPlugins {
9191
.with_context(|| format!("failed to invoke plugin on '{filename:?}'"))
9292
}
9393

94-
#[tracing::instrument(level = "info", skip_all, name = "apply_plugins")]
9594
#[cfg(all(feature = "plugin", not(target_arch = "wasm32")))]
9695
fn apply_inner(&mut self, n: Program) -> Result<Program, anyhow::Error> {
9796
use anyhow::Context;
@@ -167,7 +166,6 @@ impl RustPlugins {
167166
}
168167

169168
#[cfg(all(feature = "plugin", target_arch = "wasm32"))]
170-
#[tracing::instrument(level = "info", skip_all)]
171169
fn apply_inner(&mut self, n: Program) -> Result<Program, anyhow::Error> {
172170
// [TODO]: unimplemented
173171
n

crates/swc_cli_impl/src/commands/compile.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ static DEFAULT_EXTENSIONS: &[&str] = &["js", "jsx", "es6", "es", "mjs", "ts", "t
126126
/// Infer list of files to be transformed from cli arguments.
127127
/// If given input is a directory, it'll traverse it and collect all supported
128128
/// files.
129-
#[tracing::instrument(level = "info", skip_all)]
130129
fn get_files_list(
131130
raw_files_input: &[PathBuf],
132131
extensions: &[String],

crates/swc_common/src/plugin/serialized.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ impl PluginSerializedBytes {
4747
* Constructs an instance from already serialized byte
4848
* slices.
4949
*/
50-
#[tracing::instrument(level = "info", skip_all)]
5150
pub fn from_bytes(field: Vec<u8>) -> PluginSerializedBytes {
5251
PluginSerializedBytes { field }
5352
}
@@ -59,7 +58,6 @@ impl PluginSerializedBytes {
5958
* to implement TryFrom trait
6059
*/
6160
/*
62-
#[tracing::instrument(level = "info", skip_all)]
6361
pub fn try_serialize<W>(t: &VersionedSerializable<W>) -> Result<Self, Error>
6462
where
6563
W: rkyv::Serialize<rkyv::ser::serializers::AllocSerializer<512>>,
@@ -78,7 +76,6 @@ impl PluginSerializedBytes {
7876
}
7977
*/
8078

81-
#[tracing::instrument(level = "info", skip_all)]
8279
pub fn try_serialize<W>(t: &VersionedSerializable<W>) -> Result<Self, Error>
8380
where
8481
W: cbor4ii::core::enc::Encode,
@@ -93,7 +90,6 @@ impl PluginSerializedBytes {
9390
/*
9491
* Internal fn to constructs an instance from raw bytes ptr.
9592
*/
96-
#[tracing::instrument(level = "info", skip_all)]
9793
#[allow(clippy::not_unsafe_ptr_arg_deref)]
9894
pub fn from_raw_ptr(
9995
raw_allocated_ptr: *const u8,
@@ -113,7 +109,6 @@ impl PluginSerializedBytes {
113109
(self.field.as_ptr(), self.field.len())
114110
}
115111

116-
#[tracing::instrument(level = "info", skip_all)]
117112
pub fn deserialize<W>(&self) -> Result<VersionedSerializable<W>, Error>
118113
where
119114
W: for<'de> cbor4ii::core::dec::Decode<'de>,
@@ -127,7 +122,6 @@ impl PluginSerializedBytes {
127122
}
128123

129124
/*
130-
#[tracing::instrument(level = "info", skip_all)]
131125
pub fn deserialize<W>(&self) -> Result<VersionedSerializable<W>, Error>
132126
where
133127
W: rkyv::Archive,

crates/swc_core/tests/fixture/stub_napi/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ pub struct JsCompiler {
4141
impl JsCompiler {
4242
#[napi(constructor)]
4343
#[allow(clippy::new_without_default)]
44-
#[tracing::instrument(level = "info", skip_all)]
4544
pub fn new() -> Self {
4645
Self {
4746
_compiler: COMPILER.clone(),

crates/swc_ecma_codegen/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1429,7 +1429,6 @@ impl MacroNode for Program {
14291429

14301430
#[node_impl]
14311431
impl MacroNode for Module {
1432-
#[tracing::instrument(level = "debug", skip_all)]
14331432
fn emit(&mut self, emitter: &mut Macro) -> Result {
14341433
emitter.emit_leading_comments_of_span(self.span(), false)?;
14351434

@@ -1457,7 +1456,6 @@ impl MacroNode for Module {
14571456

14581457
#[node_impl]
14591458
impl MacroNode for Script {
1460-
#[tracing::instrument(level = "debug", skip_all)]
14611459
fn emit(&mut self, emitter: &mut Macro) -> Result {
14621460
emitter.emit_leading_comments_of_span(self.span(), false)?;
14631461

crates/swc_ecma_compat_es2015/src/destructuring.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1148,7 +1148,6 @@ fn make_ref_ident(c: Config, decls: &mut Vec<VarDeclarator>, init: Option<Box<Ex
11481148
make_ref_ident_for_array(c, decls, init, None)
11491149
}
11501150

1151-
#[tracing::instrument(level = "debug", skip_all)]
11521151
fn make_ref_ident_for_array(
11531152
c: Config,
11541153
decls: &mut Vec<VarDeclarator>,

crates/swc_ecma_compat_es2015/src/for_of.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,6 @@ impl ForOf {
569569
/// }
570570
/// }
571571
/// ```
572-
#[tracing::instrument(level = "debug", skip_all)]
573572
fn make_finally_block(
574573
iterator_return: Box<Expr>,
575574
normal_completion_ident: &Ident,

crates/swc_ecma_compat_es2015/src/generator.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,6 @@ impl VisitMut for Generator {
978978
}
979979
}
980980

981-
#[tracing::instrument(level = "debug", skip_all)]
982981
fn visit_mut_stmt(&mut self, node: &mut Stmt) {
983982
match node {
984983
Stmt::Break(b) => {
@@ -3130,7 +3129,6 @@ impl Generator {
31303129
});
31313130
}
31323131

3133-
#[tracing::instrument(level = "debug", skip(self))]
31343132
fn try_enter_label(&mut self, op_index: usize) {
31353133
if self.label_offsets.is_none() {
31363134
return;
@@ -3184,7 +3182,6 @@ impl Generator {
31843182
}
31853183

31863184
/// Tries to enter or leave a code block.
3187-
#[tracing::instrument(level = "debug", skip(self))]
31883185
fn try_enter_or_leave_block(&mut self, op_index: usize) {
31893186
if let Some(blocks) = &self.blocks {
31903187
while self.block_index < self.block_actions.as_ref().unwrap().len()
@@ -3251,7 +3248,6 @@ impl Generator {
32513248

32523249
/// Writes an operation as a statement to the current label's statement
32533250
/// list.
3254-
#[tracing::instrument(level = "debug", skip(self))]
32553251
fn write_operation(&mut self, op_index: usize) {
32563252
if cfg!(debug_assertions) {
32573253
debug!("Writing operation {}", op_index);

0 commit comments

Comments
 (0)