// The expanded separator used historically by R8 for verbose synthetic class names. static constexpr std::string_view kVerboseSyntheticSeparator = "$$ExternalSynthetic";
// The custom minimized separator used by R8 in the platform for minimal synthetic class names. // We define this separately from the verbose separator for clarity and safety. // See also the RELEASE_R8_MINIMIZE_SYNTHETIC_NAMES build flag. // NOTE: This should be kept in sync with related references in the `prebuilts/r8/` repo. // Unfortunately, `IfChange` lint rules don't support cross project references. static constexpr std::string_view kMinimizedSyntheticSeparator = "$$";
std::optional<std::string> RewriteSyntheticProfileClassIfNeeded(std::string_view klass) { if (klass.empty()) { return std::nullopt;
}
// Ignore primitives or primitive arrays. if (!klass.ends_with(';')) { return {};
}
// Strip the trailing semicolon.
std::string_view body = klass.substr(0, klass.size() - 1);
// Find the split point where digits start at the end (e.g., "LBar$$1" -> "LBar$$"+"1").
size_t last_non_digit_idx = body.find_last_not_of("0123456789"); if (last_non_digit_idx == std::string::npos) { return std::nullopt;
}
// Case 2: Expansion (e.g., $$7 -> $$ExternalSyntheticLambda7) // Note: This rewrite is purely *speculative*. We assume Lambda only because that has historically // been the most represented synthetic present in platform profiles. if (prefix.ends_with(kMinimizedSyntheticSeparator)) { // Explicitly remove the minimized separator from the end of the prefix before appending the // full expanded separator. This avoids assuming any relationship between the two.
std::string_view base_prefix =
prefix.substr(0, prefix.size() - kMinimizedSyntheticSeparator.size()); return std::format("{}{}Lambda{};", base_prefix, kVerboseSyntheticSeparator, digits);
}
return std::nullopt;
}
} // namespace art
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.15 Sekunden
(vorverarbeitet am 2026-06-29)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.