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

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: Created 8 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
« src/heap.h ('K') | « 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 943 matching lines...) Expand 10 before | Expand all | Expand 10 after
954 new_space_.Capacity() > new_space_.InitialCapacity()) { 954 new_space_.Capacity() > new_space_.InitialCapacity()) {
955 new_space_.Shrink(); 955 new_space_.Shrink();
956 } 956 }
957 957
958 isolate_->counters()->objs_since_last_young()->Set(0); 958 isolate_->counters()->objs_since_last_young()->Set(0);
959 959
960 gc_post_processing_depth_++; 960 gc_post_processing_depth_++;
961 { DisableAssertNoAllocation allow_allocation; 961 { DisableAssertNoAllocation allow_allocation;
962 GCTracer::Scope scope(tracer, GCTracer::Scope::EXTERNAL); 962 GCTracer::Scope scope(tracer, GCTracer::Scope::EXTERNAL);
963 next_gc_likely_to_collect_more = 963 next_gc_likely_to_collect_more =
964 isolate_->global_handles()->PostGarbageCollectionProcessing(collector); 964 isolate_->global_handles()->PostGarbageCollectionProcessing(
965 collector, tracer);
965 } 966 }
966 gc_post_processing_depth_--; 967 gc_post_processing_depth_--;
967 968
968 // Update relocatables. 969 // Update relocatables.
969 Relocatable::PostGarbageCollectionProcessing(); 970 Relocatable::PostGarbageCollectionProcessing();
970 971
971 if (collector == MARK_COMPACTOR) { 972 if (collector == MARK_COMPACTOR) {
972 // Register the amount of external allocated memory. 973 // Register the amount of external allocated memory.
973 amount_of_external_allocated_memory_at_last_global_gc_ = 974 amount_of_external_allocated_memory_at_last_global_gc_ =
974 amount_of_external_allocated_memory_; 975 amount_of_external_allocated_memory_;
(...skipping 6070 matching lines...) Expand 10 before | Expand all | Expand 10 after
7045 const char* gc_reason, 7046 const char* gc_reason,
7046 const char* collector_reason) 7047 const char* collector_reason)
7047 : start_time_(0.0), 7048 : start_time_(0.0),
7048 start_object_size_(0), 7049 start_object_size_(0),
7049 start_memory_size_(0), 7050 start_memory_size_(0),
7050 gc_count_(0), 7051 gc_count_(0),
7051 full_gc_count_(0), 7052 full_gc_count_(0),
7052 allocated_since_last_gc_(0), 7053 allocated_since_last_gc_(0),
7053 spent_in_mutator_(0), 7054 spent_in_mutator_(0),
7054 promoted_objects_size_(0), 7055 promoted_objects_size_(0),
7056 died_nodes_in_new_space_(0),
7057 copied_nodes_in_new_space_(0),
7058 promoted_nodes_(0),
7055 heap_(heap), 7059 heap_(heap),
7056 gc_reason_(gc_reason), 7060 gc_reason_(gc_reason),
7057 collector_reason_(collector_reason) { 7061 collector_reason_(collector_reason) {
7058 if (!FLAG_trace_gc && !FLAG_print_cumulative_gc_stat) return; 7062 if (!FLAG_trace_gc && !FLAG_print_cumulative_gc_stat) return;
7059 start_time_ = OS::TimeCurrentMillis(); 7063 start_time_ = OS::TimeCurrentMillis();
7060 start_object_size_ = heap_->SizeOfObjects(); 7064 start_object_size_ = heap_->SizeOfObjects();
7061 start_memory_size_ = heap_->isolate()->memory_allocator()->Size(); 7065 start_memory_size_ = heap_->isolate()->memory_allocator()->Size();
7062 7066
7063 for (int i = 0; i < Scope::kNumberOfScopes; i++) { 7067 for (int i = 0; i < Scope::kNumberOfScopes; i++) {
7064 scopes_[i] = 0; 7068 scopes_[i] = 0;
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
7185 static_cast<int>(scopes_[Scope::MC_UPDATE_MISC_POINTERS])); 7189 static_cast<int>(scopes_[Scope::MC_UPDATE_MISC_POINTERS]));
7186 7190
7187 PrintF("total_size_before=%" V8_PTR_PREFIX "d ", start_object_size_); 7191 PrintF("total_size_before=%" V8_PTR_PREFIX "d ", start_object_size_);
7188 PrintF("total_size_after=%" V8_PTR_PREFIX "d ", heap_->SizeOfObjects()); 7192 PrintF("total_size_after=%" V8_PTR_PREFIX "d ", heap_->SizeOfObjects());
7189 PrintF("holes_size_before=%" V8_PTR_PREFIX "d ", 7193 PrintF("holes_size_before=%" V8_PTR_PREFIX "d ",
7190 in_free_list_or_wasted_before_gc_); 7194 in_free_list_or_wasted_before_gc_);
7191 PrintF("holes_size_after=%" V8_PTR_PREFIX "d ", CountTotalHolesSize()); 7195 PrintF("holes_size_after=%" V8_PTR_PREFIX "d ", CountTotalHolesSize());
7192 7196
7193 PrintF("allocated=%" V8_PTR_PREFIX "d ", allocated_since_last_gc_); 7197 PrintF("allocated=%" V8_PTR_PREFIX "d ", allocated_since_last_gc_);
7194 PrintF("promoted=%" V8_PTR_PREFIX "d ", promoted_objects_size_); 7198 PrintF("promoted=%" V8_PTR_PREFIX "d ", promoted_objects_size_);
7199 PrintF("died_nodes_in_new=%" V8_PTR_PREFIX "d ", died_nodes_in_new_space_);
7200 PrintF("copied_nodes_in_new=%" V8_PTR_PREFIX "d ", copied_nodes_in_new_space _);
Michael Starzinger 2012/12/05 14:26:14 More than 80 characters.
haraken 2012/12/06 11:08:15 Done.
7201 PrintF("promoted_nodes=%" V8_PTR_PREFIX "d ", promoted_nodes_);
7195 7202
7196 if (collector_ == SCAVENGER) { 7203 if (collector_ == SCAVENGER) {
7197 PrintF("stepscount=%d ", steps_count_since_last_gc_); 7204 PrintF("stepscount=%d ", steps_count_since_last_gc_);
7198 PrintF("stepstook=%d ", static_cast<int>(steps_took_since_last_gc_)); 7205 PrintF("stepstook=%d ", static_cast<int>(steps_took_since_last_gc_));
7199 } else { 7206 } else {
7200 PrintF("stepscount=%d ", steps_count_); 7207 PrintF("stepscount=%d ", steps_count_);
7201 PrintF("stepstook=%d ", static_cast<int>(steps_took_)); 7208 PrintF("stepstook=%d ", static_cast<int>(steps_took_));
7202 } 7209 }
7203 7210
7204 PrintF("\n"); 7211 PrintF("\n");
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
7473 static_cast<int>(object_sizes_last_time_[index])); 7480 static_cast<int>(object_sizes_last_time_[index]));
7474 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT) 7481 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT)
7475 #undef ADJUST_LAST_TIME_OBJECT_COUNT 7482 #undef ADJUST_LAST_TIME_OBJECT_COUNT
7476 7483
7477 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 7484 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
7478 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 7485 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
7479 ClearObjectStats(); 7486 ClearObjectStats();
7480 } 7487 }
7481 7488
7482 } } // namespace v8::internal 7489 } } // namespace v8::internal
OLDNEW
« src/heap.h ('K') | « src/heap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698