| OLD | NEW |
| 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 ms_count_(0), | 111 ms_count_(0), |
| 112 gc_count_(0), | 112 gc_count_(0), |
| 113 remembered_unmapped_pages_index_(0), | 113 remembered_unmapped_pages_index_(0), |
| 114 unflattened_strings_length_(0), | 114 unflattened_strings_length_(0), |
| 115 #ifdef DEBUG | 115 #ifdef DEBUG |
| 116 allocation_allowed_(true), | 116 allocation_allowed_(true), |
| 117 allocation_timeout_(0), | 117 allocation_timeout_(0), |
| 118 disallow_allocation_failure_(false), | 118 disallow_allocation_failure_(false), |
| 119 #endif // DEBUG | 119 #endif // DEBUG |
| 120 new_space_high_promotion_mode_active_(false), | 120 new_space_high_promotion_mode_active_(false), |
| 121 old_gen_promotion_limit_(kMinimumPromotionLimit), | 121 old_generation_allocation_limit_(kMinimumOldGenerationAllocationLimit), |
| 122 old_gen_allocation_limit_(kMinimumAllocationLimit), | |
| 123 size_of_old_gen_at_last_old_space_gc_(0), | 122 size_of_old_gen_at_last_old_space_gc_(0), |
| 124 external_allocation_limit_(0), | 123 external_allocation_limit_(0), |
| 125 amount_of_external_allocated_memory_(0), | 124 amount_of_external_allocated_memory_(0), |
| 126 amount_of_external_allocated_memory_at_last_global_gc_(0), | 125 amount_of_external_allocated_memory_at_last_global_gc_(0), |
| 127 old_gen_exhausted_(false), | 126 old_gen_exhausted_(false), |
| 128 store_buffer_rebuilder_(store_buffer()), | 127 store_buffer_rebuilder_(store_buffer()), |
| 129 hidden_string_(NULL), | 128 hidden_string_(NULL), |
| 130 global_gc_prologue_callback_(NULL), | 129 global_gc_prologue_callback_(NULL), |
| 131 global_gc_epilogue_callback_(NULL), | 130 global_gc_epilogue_callback_(NULL), |
| 132 gc_safe_size_of_old_object_(NULL), | 131 gc_safe_size_of_old_object_(NULL), |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 *reason = "GC in old space requested"; | 274 *reason = "GC in old space requested"; |
| 276 return MARK_COMPACTOR; | 275 return MARK_COMPACTOR; |
| 277 } | 276 } |
| 278 | 277 |
| 279 if (FLAG_gc_global || (FLAG_stress_compaction && (gc_count_ & 1) != 0)) { | 278 if (FLAG_gc_global || (FLAG_stress_compaction && (gc_count_ & 1) != 0)) { |
| 280 *reason = "GC in old space forced by flags"; | 279 *reason = "GC in old space forced by flags"; |
| 281 return MARK_COMPACTOR; | 280 return MARK_COMPACTOR; |
| 282 } | 281 } |
| 283 | 282 |
| 284 // Is enough data promoted to justify a global GC? | 283 // Is enough data promoted to justify a global GC? |
| 285 if (OldGenerationPromotionLimitReached()) { | 284 if (OldGenerationAllocationLimitReached()) { |
| 286 isolate_->counters()->gc_compactor_caused_by_promoted_data()->Increment(); | 285 isolate_->counters()->gc_compactor_caused_by_promoted_data()->Increment(); |
| 287 *reason = "promotion limit reached"; | 286 *reason = "promotion limit reached"; |
| 288 return MARK_COMPACTOR; | 287 return MARK_COMPACTOR; |
| 289 } | 288 } |
| 290 | 289 |
| 291 // Have allocation in OLD and LO failed? | 290 // Have allocation in OLD and LO failed? |
| 292 if (old_gen_exhausted_) { | 291 if (old_gen_exhausted_) { |
| 293 isolate_->counters()-> | 292 isolate_->counters()-> |
| 294 gc_compactor_caused_by_oldspace_exhaustion()->Increment(); | 293 gc_compactor_caused_by_oldspace_exhaustion()->Increment(); |
| 295 *reason = "old generations exhausted"; | 294 *reason = "old generations exhausted"; |
| (...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 909 | 908 |
| 910 if (collector == MARK_COMPACTOR) { | 909 if (collector == MARK_COMPACTOR) { |
| 911 // Perform mark-sweep with optional compaction. | 910 // Perform mark-sweep with optional compaction. |
| 912 MarkCompact(tracer); | 911 MarkCompact(tracer); |
| 913 sweep_generation_++; | 912 sweep_generation_++; |
| 914 | 913 |
| 915 UpdateSurvivalRateTrend(start_new_space_size); | 914 UpdateSurvivalRateTrend(start_new_space_size); |
| 916 | 915 |
| 917 size_of_old_gen_at_last_old_space_gc_ = PromotedSpaceSizeOfObjects(); | 916 size_of_old_gen_at_last_old_space_gc_ = PromotedSpaceSizeOfObjects(); |
| 918 | 917 |
| 919 old_gen_promotion_limit_ = | 918 old_generation_allocation_limit_ = |
| 920 OldGenPromotionLimit(size_of_old_gen_at_last_old_space_gc_); | 919 OldGenerationAllocationLimit(size_of_old_gen_at_last_old_space_gc_); |
| 921 old_gen_allocation_limit_ = | |
| 922 OldGenAllocationLimit(size_of_old_gen_at_last_old_space_gc_); | |
| 923 | 920 |
| 924 old_gen_exhausted_ = false; | 921 old_gen_exhausted_ = false; |
| 925 } else { | 922 } else { |
| 926 tracer_ = tracer; | 923 tracer_ = tracer; |
| 927 Scavenge(); | 924 Scavenge(); |
| 928 tracer_ = NULL; | 925 tracer_ = NULL; |
| 929 | 926 |
| 930 UpdateSurvivalRateTrend(start_new_space_size); | 927 UpdateSurvivalRateTrend(start_new_space_size); |
| 931 } | 928 } |
| 932 | 929 |
| (...skipping 4935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5868 } | 5865 } |
| 5869 | 5866 |
| 5870 | 5867 |
| 5871 // This function expects that NewSpace's allocated objects histogram is | 5868 // This function expects that NewSpace's allocated objects histogram is |
| 5872 // populated (via a call to CollectStatistics or else as a side effect of a | 5869 // populated (via a call to CollectStatistics or else as a side effect of a |
| 5873 // just-completed scavenge collection). | 5870 // just-completed scavenge collection). |
| 5874 void Heap::ReportHeapStatistics(const char* title) { | 5871 void Heap::ReportHeapStatistics(const char* title) { |
| 5875 USE(title); | 5872 USE(title); |
| 5876 PrintF(">>>>>> =============== %s (%d) =============== >>>>>>\n", | 5873 PrintF(">>>>>> =============== %s (%d) =============== >>>>>>\n", |
| 5877 title, gc_count_); | 5874 title, gc_count_); |
| 5878 PrintF("old_gen_promotion_limit_ %" V8_PTR_PREFIX "d\n", | 5875 PrintF("old_generation_allocation_limit_ %" V8_PTR_PREFIX "d\n", |
| 5879 old_gen_promotion_limit_); | 5876 old_generation_allocation_limit_); |
| 5880 PrintF("old_gen_allocation_limit_ %" V8_PTR_PREFIX "d\n", | |
| 5881 old_gen_allocation_limit_); | |
| 5882 | 5877 |
| 5883 PrintF("\n"); | 5878 PrintF("\n"); |
| 5884 PrintF("Number of handles : %d\n", HandleScope::NumberOfHandles(isolate_)); | 5879 PrintF("Number of handles : %d\n", HandleScope::NumberOfHandles(isolate_)); |
| 5885 isolate_->global_handles()->PrintStats(); | 5880 isolate_->global_handles()->PrintStats(); |
| 5886 PrintF("\n"); | 5881 PrintF("\n"); |
| 5887 | 5882 |
| 5888 PrintF("Heap statistics : "); | 5883 PrintF("Heap statistics : "); |
| 5889 isolate_->memory_allocator()->ReportStatistics(); | 5884 isolate_->memory_allocator()->ReportStatistics(); |
| 5890 PrintF("To space : "); | 5885 PrintF("To space : "); |
| 5891 new_space_.ReportStatistics(); | 5886 new_space_.ReportStatistics(); |
| (...skipping 1967 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7859 if (FLAG_parallel_recompilation) { | 7854 if (FLAG_parallel_recompilation) { |
| 7860 heap_->relocation_mutex_->Lock(); | 7855 heap_->relocation_mutex_->Lock(); |
| 7861 #ifdef DEBUG | 7856 #ifdef DEBUG |
| 7862 heap_->relocation_mutex_locked_by_optimizer_thread_ = | 7857 heap_->relocation_mutex_locked_by_optimizer_thread_ = |
| 7863 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); | 7858 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); |
| 7864 #endif // DEBUG | 7859 #endif // DEBUG |
| 7865 } | 7860 } |
| 7866 } | 7861 } |
| 7867 | 7862 |
| 7868 } } // namespace v8::internal | 7863 } } // namespace v8::internal |
| OLD | NEW |