Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 62 int Heap::old_gen_promotion_limit_ = kMinimumPromotionLimit; | 62 int Heap::old_gen_promotion_limit_ = kMinimumPromotionLimit; |
| 63 int Heap::old_gen_allocation_limit_ = kMinimumAllocationLimit; | 63 int Heap::old_gen_allocation_limit_ = kMinimumAllocationLimit; |
| 64 | 64 |
| 65 int Heap::old_gen_exhausted_ = false; | 65 int Heap::old_gen_exhausted_ = false; |
| 66 | 66 |
| 67 int Heap::amount_of_external_allocated_memory_ = 0; | 67 int Heap::amount_of_external_allocated_memory_ = 0; |
| 68 int Heap::amount_of_external_allocated_memory_at_last_global_gc_ = 0; | 68 int Heap::amount_of_external_allocated_memory_at_last_global_gc_ = 0; |
| 69 | 69 |
| 70 // semispace_size_ should be a power of 2 and old_generation_size_ should be | 70 // semispace_size_ should be a power of 2 and old_generation_size_ should be |
| 71 // a multiple of Page::kPageSize. | 71 // a multiple of Page::kPageSize. |
| 72 #if V8_TARGET_ARCH_ARM | 72 #if defined(ANDROID) |
| 73 int Heap::semispace_size_ = 512*KB; | 73 int Heap::semispace_size_ = 512*KB; |
| 74 int Heap::old_generation_size_ = 128*MB; | 74 int Heap::old_generation_size_ = 128*MB; |
| 75 int Heap::initial_semispace_size_ = 128*KB; | 75 int Heap::initial_semispace_size_ = 128*KB; |
| 76 #else | 76 #else |
| 77 int Heap::semispace_size_ = 8*MB; | 77 int Heap::semispace_size_ = 8*MB; |
| 78 int Heap::old_generation_size_ = 512*MB; | 78 int Heap::old_generation_size_ = 512*MB; |
| 79 int Heap::initial_semispace_size_ = 512*KB; | 79 int Heap::initial_semispace_size_ = 512*KB; |
| 80 #endif | 80 #endif |
| 81 | 81 |
| 82 GCCallback Heap::global_gc_prologue_callback_ = NULL; | 82 GCCallback Heap::global_gc_prologue_callback_ = NULL; |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 216 Heap::new_space_.Size(), new_space_.Available()); | 216 Heap::new_space_.Size(), new_space_.Available()); |
| 217 PrintF("Old pointers, used: %8d, available: %8d\n", | 217 PrintF("Old pointers, used: %8d, available: %8d\n", |
| 218 old_pointer_space_->Size(), old_pointer_space_->Available()); | 218 old_pointer_space_->Size(), old_pointer_space_->Available()); |
| 219 PrintF("Old data space, used: %8d, available: %8d\n", | 219 PrintF("Old data space, used: %8d, available: %8d\n", |
| 220 old_data_space_->Size(), old_data_space_->Available()); | 220 old_data_space_->Size(), old_data_space_->Available()); |
| 221 PrintF("Code space, used: %8d, available: %8d\n", | 221 PrintF("Code space, used: %8d, available: %8d\n", |
| 222 code_space_->Size(), code_space_->Available()); | 222 code_space_->Size(), code_space_->Available()); |
| 223 PrintF("Map space, used: %8d, available: %8d\n", | 223 PrintF("Map space, used: %8d, available: %8d\n", |
| 224 map_space_->Size(), map_space_->Available()); | 224 map_space_->Size(), map_space_->Available()); |
| 225 PrintF("Large object space, used: %8d, avaialble: %8d\n", | 225 PrintF("Large object space, used: %8d, avaialble: %8d\n", |
| 226 map_space_->Size(), map_space_->Available()); | 226 lo_space_->Size(), lo_space_->Available()); |
|
Mads Ager (chromium)
2009/07/14 22:36:50
Good catch, I should have caught that in the origi
| |
| 227 } | 227 } |
| 228 #endif | 228 #endif |
| 229 | 229 |
| 230 | 230 |
| 231 // TODO(1238405): Combine the infrastructure for --heap-stats and | 231 // TODO(1238405): Combine the infrastructure for --heap-stats and |
| 232 // --log-gc to avoid the complicated preprocessor and flag testing. | 232 // --log-gc to avoid the complicated preprocessor and flag testing. |
| 233 void Heap::ReportStatisticsAfterGC() { | 233 void Heap::ReportStatisticsAfterGC() { |
| 234 // Similar to the before GC, we use some complicated logic to ensure that | 234 // Similar to the before GC, we use some complicated logic to ensure that |
| 235 // NewSpace statistics are logged exactly once when --log-gc is turned on. | 235 // NewSpace statistics are logged exactly once when --log-gc is turned on. |
| 236 #if defined(DEBUG) && defined(ENABLE_LOGGING_AND_PROFILING) | 236 #if defined(DEBUG) && defined(ENABLE_LOGGING_AND_PROFILING) |
| (...skipping 3478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3715 #ifdef DEBUG | 3715 #ifdef DEBUG |
| 3716 bool Heap::GarbageCollectionGreedyCheck() { | 3716 bool Heap::GarbageCollectionGreedyCheck() { |
| 3717 ASSERT(FLAG_gc_greedy); | 3717 ASSERT(FLAG_gc_greedy); |
| 3718 if (Bootstrapper::IsActive()) return true; | 3718 if (Bootstrapper::IsActive()) return true; |
| 3719 if (disallow_allocation_failure()) return true; | 3719 if (disallow_allocation_failure()) return true; |
| 3720 return CollectGarbage(0, NEW_SPACE); | 3720 return CollectGarbage(0, NEW_SPACE); |
| 3721 } | 3721 } |
| 3722 #endif | 3722 #endif |
| 3723 | 3723 |
| 3724 } } // namespace v8::internal | 3724 } } // namespace v8::internal |
| OLD | NEW |