Mark debug functions cold.

This commit is contained in:
Stephen Chung
2022-09-27 08:52:39 +08:00
parent 20d4b71591
commit 25476d1cea
16 changed files with 42 additions and 7 deletions

View File

@@ -117,6 +117,8 @@ pub struct FnCallHashes {
}
impl fmt::Debug for FnCallHashes {
#[cold]
#[inline(never)]
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
#[cfg(not(feature = "no_function"))]
if self.script != 0 {
@@ -199,6 +201,8 @@ pub struct FnCallExpr {
}
impl fmt::Debug for FnCallExpr {
#[cold]
#[inline(never)]
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let mut ff = f.debug_struct("FnCallExpr");
#[cfg(not(feature = "no_module"))]
@@ -294,7 +298,8 @@ impl<F: Float> DerefMut for FloatWrapper<F> {
#[cfg(not(feature = "no_float"))]
impl<F: Float + fmt::Debug> fmt::Debug for FloatWrapper<F> {
#[inline(always)]
#[cold]
#[inline(never)]
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt::Debug::fmt(&self.0, f)
}
@@ -448,6 +453,8 @@ impl Default for Expr {
}
impl fmt::Debug for Expr {
#[cold]
#[inline(never)]
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let mut display_pos = format!(" @ {:?}", self.start_position());