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

Side by Side Diff: src/heap.cc

Issue 11365146: Add GCTracer metrics for a scavenger GC for DOM wrappers (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Comments addressed Created 8 years 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
« no previous file with comments | « src/heap.h ('k') | no next file » | 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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 947 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 isolate_->counters()->objs_since_last_young()->Set(0); 958 isolate_->counters()->objs_since_last_young()->Set(0);
959 959
960 // Callbacks that fire after this point might trigger nested GCs and 960 // Callbacks that fire after this point might trigger nested GCs and
961 // restart incremental marking, the assertion can't be moved down. 961 // restart incremental marking, the assertion can't be moved down.
962 ASSERT(collector == SCAVENGER || incremental_marking()->IsStopped()); 962 ASSERT(collector == SCAVENGER || incremental_marking()->IsStopped());
963 963
964 gc_post_processing_depth_++; 964 gc_post_processing_depth_++;
965 { DisableAssertNoAllocation allow_allocation; 965 { DisableAssertNoAllocation allow_allocation;
966 GCTracer::Scope scope(tracer, GCTracer::Scope::EXTERNAL); 966 GCTracer::Scope scope(tracer, GCTracer::Scope::EXTERNAL);
967 next_gc_likely_to_collect_more = 967 next_gc_likely_to_collect_more =
968 isolate_->global_handles()->PostGarbageCollectionProcessing(collector); 968 isolate_->global_handles()->PostGarbageCollectionProcessing(
969 collector, tracer);
969 } 970 }
970 gc_post_processing_depth_--; 971 gc_post_processing_depth_--;
971 972
972 // Update relocatables. 973 // Update relocatables.
973 Relocatable::PostGarbageCollectionProcessing(); 974 Relocatable::PostGarbageCollectionProcessing();
974 975
975 if (collector == MARK_COMPACTOR) { 976 if (collector == MARK_COMPACTOR) {
976 // Register the amount of external allocated memory. 977 // Register the amount of external allocated memory.
977 amount_of_external_allocated_memory_at_last_global_gc_ = 978 amount_of_external_allocated_memory_at_last_global_gc_ =
978 amount_of_external_allocated_memory_; 979 amount_of_external_allocated_memory_;
(...skipping 5878 matching lines...) Expand 10 before | Expand all | Expand 10 after
6857 const char* gc_reason, 6858 const char* gc_reason,
6858 const char* collector_reason) 6859 const char* collector_reason)
6859 : start_time_(0.0), 6860 : start_time_(0.0),
6860 start_object_size_(0), 6861 start_object_size_(0),
6861 start_memory_size_(0), 6862 start_memory_size_(0),
6862 gc_count_(0), 6863 gc_count_(0),
6863 full_gc_count_(0), 6864 full_gc_count_(0),
6864 allocated_since_last_gc_(0), 6865 allocated_since_last_gc_(0),
6865 spent_in_mutator_(0), 6866 spent_in_mutator_(0),
6866 promoted_objects_size_(0), 6867 promoted_objects_size_(0),
6868 nodes_died_in_new_space_(0),
6869 nodes_copied_in_new_space_(0),
6870 nodes_promoted_(0),
6867 heap_(heap), 6871 heap_(heap),
6868 gc_reason_(gc_reason), 6872 gc_reason_(gc_reason),
6869 collector_reason_(collector_reason) { 6873 collector_reason_(collector_reason) {
6870 if (!FLAG_trace_gc && !FLAG_print_cumulative_gc_stat) return; 6874 if (!FLAG_trace_gc && !FLAG_print_cumulative_gc_stat) return;
6871 start_time_ = OS::TimeCurrentMillis(); 6875 start_time_ = OS::TimeCurrentMillis();
6872 start_object_size_ = heap_->SizeOfObjects(); 6876 start_object_size_ = heap_->SizeOfObjects();
6873 start_memory_size_ = heap_->isolate()->memory_allocator()->Size(); 6877 start_memory_size_ = heap_->isolate()->memory_allocator()->Size();
6874 6878
6875 for (int i = 0; i < Scope::kNumberOfScopes; i++) { 6879 for (int i = 0; i < Scope::kNumberOfScopes; i++) {
6876 scopes_[i] = 0; 6880 scopes_[i] = 0;
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
6997 static_cast<int>(scopes_[Scope::MC_UPDATE_MISC_POINTERS])); 7001 static_cast<int>(scopes_[Scope::MC_UPDATE_MISC_POINTERS]));
6998 7002
6999 PrintF("total_size_before=%" V8_PTR_PREFIX "d ", start_object_size_); 7003 PrintF("total_size_before=%" V8_PTR_PREFIX "d ", start_object_size_);
7000 PrintF("total_size_after=%" V8_PTR_PREFIX "d ", heap_->SizeOfObjects()); 7004 PrintF("total_size_after=%" V8_PTR_PREFIX "d ", heap_->SizeOfObjects());
7001 PrintF("holes_size_before=%" V8_PTR_PREFIX "d ", 7005 PrintF("holes_size_before=%" V8_PTR_PREFIX "d ",
7002 in_free_list_or_wasted_before_gc_); 7006 in_free_list_or_wasted_before_gc_);
7003 PrintF("holes_size_after=%" V8_PTR_PREFIX "d ", CountTotalHolesSize()); 7007 PrintF("holes_size_after=%" V8_PTR_PREFIX "d ", CountTotalHolesSize());
7004 7008
7005 PrintF("allocated=%" V8_PTR_PREFIX "d ", allocated_since_last_gc_); 7009 PrintF("allocated=%" V8_PTR_PREFIX "d ", allocated_since_last_gc_);
7006 PrintF("promoted=%" V8_PTR_PREFIX "d ", promoted_objects_size_); 7010 PrintF("promoted=%" V8_PTR_PREFIX "d ", promoted_objects_size_);
7011 PrintF("nodes_died_in_new=%d ", nodes_died_in_new_space_);
7012 PrintF("nodes_copied_in_new=%d ", nodes_copied_in_new_space_);
7013 PrintF("nodes_promoted=%d ", nodes_promoted_);
7007 7014
7008 if (collector_ == SCAVENGER) { 7015 if (collector_ == SCAVENGER) {
7009 PrintF("stepscount=%d ", steps_count_since_last_gc_); 7016 PrintF("stepscount=%d ", steps_count_since_last_gc_);
7010 PrintF("stepstook=%d ", static_cast<int>(steps_took_since_last_gc_)); 7017 PrintF("stepstook=%d ", static_cast<int>(steps_took_since_last_gc_));
7011 } else { 7018 } else {
7012 PrintF("stepscount=%d ", steps_count_); 7019 PrintF("stepscount=%d ", steps_count_);
7013 PrintF("stepstook=%d ", static_cast<int>(steps_took_)); 7020 PrintF("stepstook=%d ", static_cast<int>(steps_took_));
7014 PrintF("longeststep=%.f ", longest_step_); 7021 PrintF("longeststep=%.f ", longest_step_);
7015 } 7022 }
7016 7023
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
7286 static_cast<int>(object_sizes_last_time_[index])); 7293 static_cast<int>(object_sizes_last_time_[index]));
7287 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT) 7294 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT)
7288 #undef ADJUST_LAST_TIME_OBJECT_COUNT 7295 #undef ADJUST_LAST_TIME_OBJECT_COUNT
7289 7296
7290 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 7297 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
7291 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 7298 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
7292 ClearObjectStats(); 7299 ClearObjectStats();
7293 } 7300 }
7294 7301
7295 } } // namespace v8::internal 7302 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698