| // Copyright 2019 the V8 project authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| #ifndef V8_CODEGEN_TICK_COUNTER_H_ |
| #define V8_CODEGEN_TICK_COUNTER_H_ |
| // This method generates a tick. Also makes the current thread to enter a |
| // safepoint iff it was required to do so. The tick is used as a deterministic |
| // correlate of time to detect performance or divergence bugs in Turbofan. |
| // TickAndMaybeEnterSafepoint() should be called frequently thoughout the |
| void TickAndMaybeEnterSafepoint(); |
| void AttachLocalHeap(LocalHeap* local_heap); |
| size_t CurrentTicks() const { return ticks_; } |
| LocalHeap* local_heap_ = nullptr; |
| #endif // V8_CODEGEN_TICK_COUNTER_H_ |