script: Downgrade noisy debug logs. (#34914)

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
Josh Matthews 2025-01-09 03:49:59 -05:00 committed by GitHub
parent ceec1759f6
commit 3d1b7f8f06
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 7 additions and 7 deletions

View file

@ -265,7 +265,7 @@ impl LiveDOMReferences {
let capacity = table.capacity(); let capacity = table.capacity();
let len = table.len(); let len = table.len();
if (0 < capacity) && (capacity <= len) { if (0 < capacity) && (capacity <= len) {
info!("growing refcounted references by {}", len); trace!("growing refcounted references by {}", len);
remove_nulls(&mut table); remove_nulls(&mut table);
table.reserve(len); table.reserve(len);
} }
@ -294,7 +294,7 @@ fn remove_nulls<K: Eq + Hash + Clone, V>(table: &mut HashMap<K, Weak<V>>) {
.filter(|&(_, value)| Weak::upgrade(value).is_none()) .filter(|&(_, value)| Weak::upgrade(value).is_none())
.map(|(key, _)| key.clone()) .map(|(key, _)| key.clone())
.collect(); .collect();
info!("removing {} refcounted references", to_remove.len()); trace!("removing {} refcounted references", to_remove.len());
for key in to_remove { for key in to_remove {
table.remove(&key); table.remove(&key);
} }
@ -303,7 +303,7 @@ fn remove_nulls<K: Eq + Hash + Clone, V>(table: &mut HashMap<K, Weak<V>>) {
/// A JSTraceDataOp for tracing reflectors held in LIVE_REFERENCES /// A JSTraceDataOp for tracing reflectors held in LIVE_REFERENCES
#[allow(crown::unrooted_must_root)] #[allow(crown::unrooted_must_root)]
pub unsafe fn trace_refcounted_objects(tracer: *mut JSTracer) { pub unsafe fn trace_refcounted_objects(tracer: *mut JSTracer) {
info!("tracing live refcounted references"); trace!("tracing live refcounted references");
LIVE_REFERENCES.with(|r| { LIVE_REFERENCES.with(|r| {
let r = r.borrow(); let r = r.borrow();
let live_references = r.as_ref().unwrap(); let live_references = r.as_ref().unwrap();

View file

@ -299,7 +299,7 @@ impl RootCollection {
/// SM Callback that traces the rooted reflectors /// SM Callback that traces the rooted reflectors
pub unsafe fn trace_roots(tracer: *mut JSTracer) { pub unsafe fn trace_roots(tracer: *mut JSTracer) {
debug!("tracing stack roots"); trace!("tracing stack roots");
STACK_ROOTS.with(|collection| { STACK_ROOTS.with(|collection| {
let collection = &*(*collection.get().unwrap()).roots.get(); let collection = &*(*collection.get().unwrap()).roots.get();
for root in collection { for root in collection {

View file

@ -892,12 +892,12 @@ unsafe extern "C" fn trace_rust_roots(tr: *mut JSTracer, _data: *mut os::raw::c_
if !THREAD_ACTIVE.with(|t| t.get()) { if !THREAD_ACTIVE.with(|t| t.get()) {
return; return;
} }
debug!("starting custom root handler"); trace!("starting custom root handler");
trace_thread(tr); trace_thread(tr);
trace_roots(tr); trace_roots(tr);
trace_refcounted_objects(tr); trace_refcounted_objects(tr);
settings_stack::trace(tr); settings_stack::trace(tr);
debug!("done custom root handler"); trace!("done custom root handler");
} }
#[allow(unsafe_code)] #[allow(unsafe_code)]

View file

@ -176,7 +176,7 @@ pub(crate) fn with_script_thread<R: Default>(f: impl FnOnce(&ScriptThread) -> R)
/// or else the garbage collector may end up collecting objects that are still reachable. /// or else the garbage collector may end up collecting objects that are still reachable.
pub unsafe fn trace_thread(tr: *mut JSTracer) { pub unsafe fn trace_thread(tr: *mut JSTracer) {
with_script_thread(|script_thread| { with_script_thread(|script_thread| {
debug!("tracing fields of ScriptThread"); trace!("tracing fields of ScriptThread");
script_thread.trace(tr); script_thread.trace(tr);
}) })
} }