Commit ca9d53e3 authored by Camillo's avatar Camillo Committed by V8 LUCI CQ

[compiler] Make TickCounter::TickAndMaybeEnterSafepoint() inlineable

This is likely just an issue in non-PGO builds, but it might skew
the results locally. JetStream2 seems to profit from this CL.

Change-Id: Id70030074dbabf2669fd42fb5fd9399e8692bed6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3716475
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Auto-Submit: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81278}
parent a4d17470
......@@ -11,17 +11,6 @@
namespace v8 {
namespace internal {
void TickCounter::TickAndMaybeEnterSafepoint() {
++ticks_;
// Magical number to detect performance bugs or compiler divergence.
// Selected as being roughly 10x of what's needed frequently.
constexpr size_t kMaxTicks = 100000000;
USE(kMaxTicks);
DCHECK_LT(ticks_, kMaxTicks);
if (local_heap_) local_heap_->Safepoint();
}
void TickCounter::AttachLocalHeap(LocalHeap* local_heap) {
DCHECK_NULL(local_heap_);
local_heap_ = local_heap;
......
......@@ -7,6 +7,9 @@
#include <cstddef>
#include "src/base/macros.h"
#include "src/heap/local-heap.h"
namespace v8 {
namespace internal {
......@@ -19,7 +22,16 @@ class LocalHeap;
// compilation.
class TickCounter {
public:
void TickAndMaybeEnterSafepoint();
void TickAndMaybeEnterSafepoint() {
++ticks_;
// Magical number to detect performance bugs or compiler divergence.
// Selected as being roughly 10x of what's needed frequently.
constexpr size_t kMaxTicks = 100000000;
USE(kMaxTicks);
DCHECK_LT(ticks_, kMaxTicks);
if (local_heap_) local_heap_->Safepoint();
}
void AttachLocalHeap(LocalHeap* local_heap);
void DetachLocalHeap();
size_t CurrentTicks() const { return ticks_; }
......
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