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 3255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3266 heap_configured = true; | 3266 heap_configured = true; |
3267 return true; | 3267 return true; |
3268 } | 3268 } |
3269 | 3269 |
3270 | 3270 |
3271 bool Heap::ConfigureHeapDefault() { | 3271 bool Heap::ConfigureHeapDefault() { |
3272 return ConfigureHeap(FLAG_max_new_space_size / 2, FLAG_max_old_space_size); | 3272 return ConfigureHeap(FLAG_max_new_space_size / 2, FLAG_max_old_space_size); |
3273 } | 3273 } |
3274 | 3274 |
3275 | 3275 |
| 3276 void Heap::RecordStats(HeapStats* stats) { |
| 3277 stats->new_space_size = new_space_.Size(); |
| 3278 stats->new_space_capacity = new_space_.Capacity(); |
| 3279 stats->old_pointer_space_size = old_pointer_space_->Size(); |
| 3280 stats->old_pointer_space_capacity = old_pointer_space_->Capacity(); |
| 3281 stats->old_data_space_size = old_data_space_->Size(); |
| 3282 stats->old_data_space_capacity = old_data_space_->Capacity(); |
| 3283 stats->code_space_size = code_space_->Size(); |
| 3284 stats->code_space_capacity = code_space_->Capacity(); |
| 3285 stats->map_space_size = map_space_->Size(); |
| 3286 stats->map_space_capacity = map_space_->Capacity(); |
| 3287 stats->cell_space_size = cell_space_->Size(); |
| 3288 stats->cell_space_capacity = cell_space_->Capacity(); |
| 3289 stats->lo_space_size = lo_space_->Size(); |
| 3290 GlobalHandles::RecordStats(stats); |
| 3291 } |
| 3292 |
| 3293 |
3276 int Heap::PromotedSpaceSize() { | 3294 int Heap::PromotedSpaceSize() { |
3277 return old_pointer_space_->Size() | 3295 return old_pointer_space_->Size() |
3278 + old_data_space_->Size() | 3296 + old_data_space_->Size() |
3279 + code_space_->Size() | 3297 + code_space_->Size() |
3280 + map_space_->Size() | 3298 + map_space_->Size() |
3281 + cell_space_->Size() | 3299 + cell_space_->Size() |
3282 + lo_space_->Size(); | 3300 + lo_space_->Size(); |
3283 } | 3301 } |
3284 | 3302 |
3285 | 3303 |
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3965 for (int i = 0; i < kNumberOfCaches; i++) { | 3983 for (int i = 0; i < kNumberOfCaches; i++) { |
3966 if (caches_[i] != NULL) { | 3984 if (caches_[i] != NULL) { |
3967 delete caches_[i]; | 3985 delete caches_[i]; |
3968 caches_[i] = NULL; | 3986 caches_[i] = NULL; |
3969 } | 3987 } |
3970 } | 3988 } |
3971 } | 3989 } |
3972 | 3990 |
3973 | 3991 |
3974 } } // namespace v8::internal | 3992 } } // namespace v8::internal |
OLD | NEW |