Revision: 23314
Author:   [email protected]
Date:     Fri Aug 22 13:02:11 2014 UTC
Log:      Remove dependency on GCTrace from GCIdleTimeHandler.

This makes testing GCIdleTimeHandler easier.

BUG=
[email protected]

Review URL: https://codereview.chromium.org/496253002
https://code.google.com/p/v8/source/detail?r=23314

Modified:
 /branches/bleeding_edge/src/heap/gc-idle-time-handler.cc
 /branches/bleeding_edge/src/heap/gc-idle-time-handler.h
 /branches/bleeding_edge/src/heap/heap.cc

=======================================
--- /branches/bleeding_edge/src/heap/gc-idle-time-handler.cc Fri Aug 22 12:32:12 2014 UTC +++ /branches/bleeding_edge/src/heap/gc-idle-time-handler.cc Fri Aug 22 13:02:11 2014 UTC
@@ -46,8 +46,7 @@


 GCIdleTimeAction GCIdleTimeHandler::Compute(size_t idle_time_in_ms,
-                                            HeapState heap_state,
-                                            GCTracer* gc_tracer) {
+                                            HeapState heap_state) {
   if (IsIdleRoundFinished()) {
if (EnoughGarbageSinceLastIdleRound() || heap_state.contexts_disposed
0) {
       StartIdleRound();
@@ -56,10 +55,9 @@
     }
   }
   if (heap_state.incremental_marking_stopped) {
-    size_t speed =
- static_cast<size_t>(gc_tracer->MarkCompactSpeedInBytesPerMillisecond());
-    if (idle_time_in_ms >=
-        EstimateMarkCompactTime(heap_state.size_of_objects, speed)) {
+    if (idle_time_in_ms >= EstimateMarkCompactTime(
+                               heap_state.size_of_objects,
+ heap_state.mark_compact_speed_in_bytes_per_ms)) { // If there are no more than two GCs left in this idle round and we are // allowed to do a full GC, then make those GCs full in order to compact
       // the code space.
@@ -82,9 +80,8 @@
     return GCIdleTimeAction::FinalizeSweeping();
   }

- intptr_t speed = gc_tracer->IncrementalMarkingSpeedInBytesPerMillisecond();
-  size_t step_size =
-      static_cast<size_t>(EstimateMarkingStepSize(idle_time_in_ms, speed));
+  size_t step_size = EstimateMarkingStepSize(
+ idle_time_in_ms, heap_state.incremental_marking_speed_in_bytes_per_ms);
   return GCIdleTimeAction::IncrementalMarking(step_size);
 }
 }
=======================================
--- /branches/bleeding_edge/src/heap/gc-idle-time-handler.h Fri Aug 22 12:32:12 2014 UTC +++ /branches/bleeding_edge/src/heap/gc-idle-time-handler.h Fri Aug 22 13:02:11 2014 UTC
@@ -95,14 +95,15 @@
     bool incremental_marking_stopped;
     bool can_start_incremental_marking;
     bool sweeping_in_progress;
+    size_t mark_compact_speed_in_bytes_per_ms;
+    size_t incremental_marking_speed_in_bytes_per_ms;
   };

   GCIdleTimeHandler()
       : mark_compacts_since_idle_round_started_(0),
         scavenges_since_last_idle_round_(0) {}

-  GCIdleTimeAction Compute(size_t idle_time_in_ms, HeapState heap_state,
-                           GCTracer* gc_tracer);
+  GCIdleTimeAction Compute(size_t idle_time_in_ms, HeapState heap_state);

   void NotifyIdleMarkCompact() {
if (mark_compacts_since_idle_round_started_ < kMaxMarkCompactsInIdleRound) {
=======================================
--- /branches/bleeding_edge/src/heap/heap.cc    Fri Aug 22 12:32:12 2014 UTC
+++ /branches/bleeding_edge/src/heap/heap.cc    Fri Aug 22 13:02:11 2014 UTC
@@ -4298,9 +4298,13 @@
   heap_state.can_start_incremental_marking = true;
   heap_state.sweeping_in_progress =
       mark_compact_collector()->sweeping_in_progress();
+  heap_state.mark_compact_speed_in_bytes_per_ms =
+ static_cast<size_t>(tracer()->MarkCompactSpeedInBytesPerMillisecond()); + heap_state.incremental_marking_speed_in_bytes_per_ms = static_cast<size_t>(
+      tracer()->IncrementalMarkingSpeedInBytesPerMillisecond());

   GCIdleTimeAction action =
-      gc_idle_time_handler_.Compute(idle_time_in_ms, heap_state, tracer());
+      gc_idle_time_handler_.Compute(idle_time_in_ms, heap_state);

   contexts_disposed_ = 0;
   bool result = false;

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to