diff options
Diffstat (limited to 'deps/v8/src/heap/gc-idle-time-handler.h')
-rw-r--r-- | deps/v8/src/heap/gc-idle-time-handler.h | 61 |
1 files changed, 5 insertions, 56 deletions
diff --git a/deps/v8/src/heap/gc-idle-time-handler.h b/deps/v8/src/heap/gc-idle-time-handler.h index 722710e11a..5781f44d87 100644 --- a/deps/v8/src/heap/gc-idle-time-handler.h +++ b/deps/v8/src/heap/gc-idle-time-handler.h @@ -10,51 +10,12 @@ namespace v8 { namespace internal { -enum GCIdleTimeActionType { - DONE, - DO_NOTHING, - DO_INCREMENTAL_STEP, - DO_FULL_GC, +enum class GCIdleTimeAction : uint8_t { + kDone, + kIncrementalStep, + kFullGC, }; - -class GCIdleTimeAction { - public: - static GCIdleTimeAction Done() { - GCIdleTimeAction result; - result.type = DONE; - result.additional_work = false; - return result; - } - - static GCIdleTimeAction Nothing() { - GCIdleTimeAction result; - result.type = DO_NOTHING; - result.additional_work = false; - return result; - } - - static GCIdleTimeAction IncrementalStep() { - GCIdleTimeAction result; - result.type = DO_INCREMENTAL_STEP; - result.additional_work = false; - return result; - } - - static GCIdleTimeAction FullGC() { - GCIdleTimeAction result; - result.type = DO_FULL_GC; - result.additional_work = false; - return result; - } - - void Print(); - - GCIdleTimeActionType type; - bool additional_work; -}; - - class GCIdleTimeHeapState { public: void Print(); @@ -117,20 +78,13 @@ class V8_EXPORT_PRIVATE GCIdleTimeHandler { static const size_t kMinTimeForOverApproximatingWeakClosureInMs; - // Number of times we will return a Nothing action in the current mode - // despite having idle time available before we returning a Done action to - // ensure we don't keep scheduling idle tasks and making no progress. - static const int kMaxNoProgressIdleTimes = 10; - - GCIdleTimeHandler() : idle_times_which_made_no_progress_(0) {} + GCIdleTimeHandler() = default; GCIdleTimeAction Compute(double idle_time_in_ms, GCIdleTimeHeapState heap_state); bool Enabled(); - void ResetNoProgressCounter() { idle_times_which_made_no_progress_ = 0; } - static size_t EstimateMarkingStepSize(double idle_time_in_ms, double marking_speed_in_bytes_per_ms); @@ -148,11 +102,6 @@ class V8_EXPORT_PRIVATE GCIdleTimeHandler { static bool ShouldDoOverApproximateWeakClosure(double idle_time_in_ms); private: - GCIdleTimeAction NothingOrDone(double idle_time_in_ms); - - // Idle notifications with no progress. - int idle_times_which_made_no_progress_; - DISALLOW_COPY_AND_ASSIGN(GCIdleTimeHandler); }; |