Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(250)

Unified Diff: src/heap/heap.h

Issue 492763002: Move idle notification handling to GCIdleTimeHandler. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Undo more changes Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/heap/heap.h
diff --git a/src/heap/heap.h b/src/heap/heap.h
index ef947c95f780bcbd5a552f0c84565ae3b2a06236..0ba9ffdd0a01d9dad35d8cd51fe390638274695f 100644
--- a/src/heap/heap.h
+++ b/src/heap/heap.h
@@ -11,6 +11,7 @@
#include "src/assert-scope.h"
#include "src/counters.h"
#include "src/globals.h"
+#include "src/heap/gc-idle-time-handler.h"
#include "src/heap/gc-tracer.h"
#include "src/heap/incremental-marking.h"
#include "src/heap/mark-compact.h"
@@ -1928,30 +1929,7 @@ class Heap {
void SelectScavengingVisitorsTable();
- void StartIdleRound() { mark_sweeps_since_idle_round_started_ = 0; }
-
- void FinishIdleRound() {
- mark_sweeps_since_idle_round_started_ = kMaxMarkSweepsInIdleRound;
- scavenges_since_last_idle_round_ = 0;
- }
-
- bool EnoughGarbageSinceLastIdleRound() {
- return (scavenges_since_last_idle_round_ >= kIdleScavengeThreshold);
- }
-
- // Estimates how many milliseconds a Mark-Sweep would take to complete.
- // In idle notification handler we assume that this function will return:
- // - a number less than 10 for small heaps, which are less than 8Mb.
- // - a number greater than 10 for large heaps, which are greater than 32Mb.
- int TimeMarkSweepWouldTakeInMs() {
- // Rough estimate of how many megabytes of heap can be processed in 1 ms.
- static const int kMbPerMs = 2;
-
- int heap_size_mb = static_cast<int>(SizeOfObjects() / MB);
- return heap_size_mb / kMbPerMs;
- }
-
- void AdvanceIdleIncrementalMarking(int idle_time_in_ms);
+ void AdvanceIdleIncrementalMarking(intptr_t step_size);
void ClearObjectStats(bool clear_last_time_stats = false);
@@ -2004,13 +1982,8 @@ class Heap {
IncrementalMarking incremental_marking_;
- int number_idle_notifications_;
- unsigned int last_idle_notification_gc_count_;
- bool last_idle_notification_gc_count_init_;
-
- int mark_sweeps_since_idle_round_started_;
+ GCIdleTimeHandler gc_idle_time_handler_;
unsigned int gc_count_at_last_idle_gc_;
- int scavenges_since_last_idle_round_;
// These two counters are monotomically increasing and never reset.
size_t full_codegen_bytes_generated_;

Powered by Google App Engine
This is Rietveld 408576698