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

Side by Side Diff: src/heap/heap.cc

Issue 710603003: Perform context disposal garbage collections only if contexts disposals happen at a high rate. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/heap/gc-tracer.cc ('k') | test/unittests/heap/gc-idle-time-handler-unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/base/once.h" 10 #include "src/base/once.h"
(...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after
858 } 858 }
859 859
860 860
861 int Heap::NotifyContextDisposed() { 861 int Heap::NotifyContextDisposed() {
862 if (isolate()->concurrent_recompilation_enabled()) { 862 if (isolate()->concurrent_recompilation_enabled()) {
863 // Flush the queued recompilation tasks. 863 // Flush the queued recompilation tasks.
864 isolate()->optimizing_compiler_thread()->Flush(); 864 isolate()->optimizing_compiler_thread()->Flush();
865 } 865 }
866 flush_monomorphic_ics_ = true; 866 flush_monomorphic_ics_ = true;
867 AgeInlineCaches(); 867 AgeInlineCaches();
868 tracer()->AddContextDisposalTime(base::OS::TimeCurrentMillis());
868 return ++contexts_disposed_; 869 return ++contexts_disposed_;
869 } 870 }
870 871
871 872
872 void Heap::MoveElements(FixedArray* array, int dst_index, int src_index, 873 void Heap::MoveElements(FixedArray* array, int dst_index, int src_index,
873 int len) { 874 int len) {
874 if (len == 0) return; 875 if (len == 0) return;
875 876
876 DCHECK(array->map() != fixed_cow_array_map()); 877 DCHECK(array->map() != fixed_cow_array_map());
877 Object** dst_objects = array->data_start() + dst_index; 878 Object** dst_objects = array->data_start() + dst_index;
(...skipping 3478 matching lines...) Expand 10 before | Expand all | Expand 10 after
4356 if (!FLAG_incremental_marking) return true; 4357 if (!FLAG_incremental_marking) return true;
4357 base::ElapsedTimer timer; 4358 base::ElapsedTimer timer;
4358 timer.Start(); 4359 timer.Start();
4359 isolate()->counters()->gc_idle_time_allotted_in_ms()->AddSample( 4360 isolate()->counters()->gc_idle_time_allotted_in_ms()->AddSample(
4360 idle_time_in_ms); 4361 idle_time_in_ms);
4361 HistogramTimerScope idle_notification_scope( 4362 HistogramTimerScope idle_notification_scope(
4362 isolate_->counters()->gc_idle_notification()); 4363 isolate_->counters()->gc_idle_notification());
4363 4364
4364 GCIdleTimeHandler::HeapState heap_state; 4365 GCIdleTimeHandler::HeapState heap_state;
4365 heap_state.contexts_disposed = contexts_disposed_; 4366 heap_state.contexts_disposed = contexts_disposed_;
4367 heap_state.contexts_disposal_rate =
4368 tracer()->ContextDisposalRateInMilliseconds();
4366 heap_state.size_of_objects = static_cast<size_t>(SizeOfObjects()); 4369 heap_state.size_of_objects = static_cast<size_t>(SizeOfObjects());
4367 heap_state.incremental_marking_stopped = incremental_marking()->IsStopped(); 4370 heap_state.incremental_marking_stopped = incremental_marking()->IsStopped();
4368 // TODO(ulan): Start incremental marking only for large heaps. 4371 // TODO(ulan): Start incremental marking only for large heaps.
4369 heap_state.can_start_incremental_marking = 4372 heap_state.can_start_incremental_marking =
4370 incremental_marking()->ShouldActivate(); 4373 incremental_marking()->ShouldActivate();
4371 heap_state.sweeping_in_progress = 4374 heap_state.sweeping_in_progress =
4372 mark_compact_collector()->sweeping_in_progress(); 4375 mark_compact_collector()->sweeping_in_progress();
4373 heap_state.mark_compact_speed_in_bytes_per_ms = 4376 heap_state.mark_compact_speed_in_bytes_per_ms =
4374 static_cast<size_t>(tracer()->MarkCompactSpeedInBytesPerMillisecond()); 4377 static_cast<size_t>(tracer()->MarkCompactSpeedInBytesPerMillisecond());
4375 heap_state.incremental_marking_speed_in_bytes_per_ms = static_cast<size_t>( 4378 heap_state.incremental_marking_speed_in_bytes_per_ms = static_cast<size_t>(
(...skipping 1886 matching lines...) Expand 10 before | Expand all | Expand 10 after
6262 static_cast<int>(object_sizes_last_time_[index])); 6265 static_cast<int>(object_sizes_last_time_[index]));
6263 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) 6266 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT)
6264 #undef ADJUST_LAST_TIME_OBJECT_COUNT 6267 #undef ADJUST_LAST_TIME_OBJECT_COUNT
6265 6268
6266 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 6269 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
6267 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 6270 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
6268 ClearObjectStats(); 6271 ClearObjectStats();
6269 } 6272 }
6270 } 6273 }
6271 } // namespace v8::internal 6274 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap/gc-tracer.cc ('k') | test/unittests/heap/gc-idle-time-handler-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698