style: Remove the old profiler label frames code in the servo codebase and replace it with the new API

Differential Revision: https://phabricator.services.mozilla.com/D120795
This commit is contained in:
Nazım Can Altınova 2023-05-22 13:08:55 +02:00 committed by Oriol Brufau
parent 9e33a154fd
commit 5a9fae3fb5
6 changed files with 5 additions and 109 deletions

View file

@ -105,35 +105,6 @@ macro_rules! define_keyword_type {
};
}
/// Place a Gecko profiler label on the stack.
///
/// The `label_type` argument must be the name of a variant of `ProfilerLabel`.
#[cfg(feature = "gecko_profiler")]
#[macro_export]
macro_rules! profiler_label {
($label_type:ident) => {
let mut _profiler_label =
::std::mem::MaybeUninit::<$crate::gecko_bindings::structs::AutoProfilerLabel>::uninit();
let _profiler_label = if $crate::gecko::profiler::profiler_is_active() {
unsafe {
Some($crate::gecko::profiler::AutoProfilerLabel::new(
&mut _profiler_label,
$crate::gecko::profiler::ProfilerLabel::$label_type,
))
}
} else {
None
};
};
}
/// No-op when the Gecko profiler is not available.
#[cfg(not(feature = "gecko_profiler"))]
#[macro_export]
macro_rules! profiler_label {
($label_type:ident) => {};
}
#[cfg(feature = "servo")]
macro_rules! local_name {
($s:tt) => {