Commit 88ead176 authored by Shu-yu Guo's avatar Shu-yu Guo Committed by V8 LUCI CQ

Revert "heap: Inline GCTracer::Scope::Name"

This reverts commit 370cae1d.

Reason for revert: Breaking gcc and bazel builds:
https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux%20gcc%20-%20builder/1646/overview
https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux64%20-%20bazel%20-%20builder/1714/overview

Original change's description:
> heap: Inline GCTracer::Scope::Name
>
> This is a follow-up to https://crrev.com/c/3581774.
> It inlines method GCTracer::Scope::Name so that the calculation of the
> name of the trace event can be performed at compile time and optimized
> away, at most call sites.
>
> Bug: chromium:1318062
> Change-Id: I483d8fdfcc2c82c2a88d245326f27e7e787979aa
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3602511
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Reviewed-by: Omer Katz <omerkatz@chromium.org>
> Commit-Queue: Nikolaos Papaspyrou <nikolaos@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#80122}

Bug: chromium:1318062
Change-Id: Ib33472a3a51fa3922a0af4d1c7dbac4b30b0098b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3600682
Auto-Submit: Shu-yu Guo <syg@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Owners-Override: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#80124}
parent ee72b7a1
...@@ -77,33 +77,6 @@ GCTracer::Scope::~Scope() { ...@@ -77,33 +77,6 @@ GCTracer::Scope::~Scope() {
#endif // defined(V8_RUNTIME_CALL_STATS) #endif // defined(V8_RUNTIME_CALL_STATS)
} }
constexpr const char* GCTracer::Scope::Name(ScopeId id) {
#define CASE(scope) \
case Scope::scope: \
return "V8.GC_" #scope;
switch (id) {
TRACER_SCOPES(CASE)
TRACER_BACKGROUND_SCOPES(CASE)
case Scope::NUMBER_OF_SCOPES:
break;
}
#undef CASE
UNREACHABLE();
}
constexpr bool GCTracer::Scope::NeedsYoungEpoch(ScopeId id) {
#define CASE(scope) \
case Scope::scope: \
return true;
switch (id) {
TRACER_YOUNG_EPOCH_SCOPES(CASE)
default:
return false;
}
#undef CASE
UNREACHABLE();
}
constexpr int GCTracer::Scope::IncrementalOffset(ScopeId id) { constexpr int GCTracer::Scope::IncrementalOffset(ScopeId id) {
DCHECK_LE(FIRST_INCREMENTAL_SCOPE, id); DCHECK_LE(FIRST_INCREMENTAL_SCOPE, id);
DCHECK_GE(LAST_INCREMENTAL_SCOPE, id); DCHECK_GE(LAST_INCREMENTAL_SCOPE, id);
......
...@@ -58,6 +58,33 @@ void GCTracer::Scope::AssertMainThread() { ...@@ -58,6 +58,33 @@ void GCTracer::Scope::AssertMainThread() {
} }
#endif // DEBUG #endif // DEBUG
const char* GCTracer::Scope::Name(ScopeId id) {
#define CASE(scope) \
case Scope::scope: \
return "V8.GC_" #scope;
switch (id) {
TRACER_SCOPES(CASE)
TRACER_BACKGROUND_SCOPES(CASE)
case Scope::NUMBER_OF_SCOPES:
break;
}
#undef CASE
UNREACHABLE();
}
bool GCTracer::Scope::NeedsYoungEpoch(ScopeId id) {
#define CASE(scope) \
case Scope::scope: \
return true;
switch (id) {
TRACER_YOUNG_EPOCH_SCOPES(CASE)
default:
return false;
}
#undef CASE
UNREACHABLE();
}
GCTracer::Event::Event(Type type, State state, GCTracer::Event::Event(Type type, State state,
GarbageCollectionReason gc_reason, GarbageCollectionReason gc_reason,
const char* collector_reason) const char* collector_reason)
......
...@@ -97,9 +97,9 @@ class V8_EXPORT_PRIVATE GCTracer { ...@@ -97,9 +97,9 @@ class V8_EXPORT_PRIVATE GCTracer {
V8_INLINE ~Scope(); V8_INLINE ~Scope();
Scope(const Scope&) = delete; Scope(const Scope&) = delete;
Scope& operator=(const Scope&) = delete; Scope& operator=(const Scope&) = delete;
static constexpr const char* Name(ScopeId id); static const char* Name(ScopeId id);
static constexpr bool NeedsYoungEpoch(ScopeId id); static bool NeedsYoungEpoch(ScopeId id);
static constexpr int IncrementalOffset(ScopeId id); V8_INLINE static constexpr int IncrementalOffset(ScopeId id);
private: private:
#if DEBUG #if DEBUG
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment