OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/base/once.h" | 9 #include "src/base/once.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 new_space_(this), | 72 new_space_(this), |
73 old_pointer_space_(NULL), | 73 old_pointer_space_(NULL), |
74 old_data_space_(NULL), | 74 old_data_space_(NULL), |
75 code_space_(NULL), | 75 code_space_(NULL), |
76 map_space_(NULL), | 76 map_space_(NULL), |
77 cell_space_(NULL), | 77 cell_space_(NULL), |
78 property_cell_space_(NULL), | 78 property_cell_space_(NULL), |
79 lo_space_(NULL), | 79 lo_space_(NULL), |
80 gc_state_(NOT_IN_GC), | 80 gc_state_(NOT_IN_GC), |
81 gc_post_processing_depth_(0), | 81 gc_post_processing_depth_(0), |
| 82 allocations_count_(0), |
| 83 raw_allocations_hash_(0), |
| 84 dump_allocations_hash_countdown_(FLAG_dump_allocations_digest_at_alloc), |
82 ms_count_(0), | 85 ms_count_(0), |
83 gc_count_(0), | 86 gc_count_(0), |
84 remembered_unmapped_pages_index_(0), | 87 remembered_unmapped_pages_index_(0), |
85 unflattened_strings_length_(0), | 88 unflattened_strings_length_(0), |
86 #ifdef DEBUG | 89 #ifdef DEBUG |
87 allocation_timeout_(0), | 90 allocation_timeout_(0), |
88 #endif // DEBUG | 91 #endif // DEBUG |
89 old_generation_allocation_limit_(kMinimumOldGenerationAllocationLimit), | 92 old_generation_allocation_limit_(kMinimumOldGenerationAllocationLimit), |
90 size_of_old_gen_at_last_old_space_gc_(0), | 93 size_of_old_gen_at_last_old_space_gc_(0), |
91 old_gen_exhausted_(false), | 94 old_gen_exhausted_(false), |
(...skipping 3239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3331 } | 3334 } |
3332 | 3335 |
3333 object->set_map(MapForFixedTypedArray(array_type)); | 3336 object->set_map(MapForFixedTypedArray(array_type)); |
3334 FixedTypedArrayBase* elements = FixedTypedArrayBase::cast(object); | 3337 FixedTypedArrayBase* elements = FixedTypedArrayBase::cast(object); |
3335 elements->set_length(length); | 3338 elements->set_length(length); |
3336 memset(elements->DataPtr(), 0, elements->DataSize()); | 3339 memset(elements->DataPtr(), 0, elements->DataSize()); |
3337 return elements; | 3340 return elements; |
3338 } | 3341 } |
3339 | 3342 |
3340 | 3343 |
3341 AllocationResult Heap::AllocateCode(int object_size, | 3344 AllocationResult Heap::AllocateCode(int object_size, bool immovable) { |
3342 bool immovable) { | |
3343 ASSERT(IsAligned(static_cast<intptr_t>(object_size), kCodeAlignment)); | 3345 ASSERT(IsAligned(static_cast<intptr_t>(object_size), kCodeAlignment)); |
3344 AllocationResult allocation; | 3346 AllocationResult allocation; |
3345 // Large code objects and code objects which should stay at a fixed address | 3347 // Large code objects and code objects which should stay at a fixed address |
3346 // are allocated in large object space. | 3348 // are allocated in large object space. |
3347 HeapObject* result; | 3349 HeapObject* result; |
3348 bool force_lo_space = object_size > code_space()->AreaSize(); | 3350 bool force_lo_space = object_size > code_space()->AreaSize(); |
3349 if (force_lo_space) { | 3351 if (force_lo_space) { |
3350 allocation = lo_space_->AllocateRaw(object_size, EXECUTABLE); | 3352 allocation = lo_space_->AllocateRaw(object_size, EXECUTABLE); |
3351 } else { | 3353 } else { |
3352 allocation = AllocateRaw(object_size, CODE_SPACE, CODE_SPACE); | 3354 allocation = AllocateRaw(object_size, CODE_SPACE, CODE_SPACE); |
(...skipping 1957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5310 map_space_->MaximumCommittedMemory()); | 5312 map_space_->MaximumCommittedMemory()); |
5311 PrintF("maximum_committed_by_cell_space=%" V8_PTR_PREFIX "d ", | 5313 PrintF("maximum_committed_by_cell_space=%" V8_PTR_PREFIX "d ", |
5312 cell_space_->MaximumCommittedMemory()); | 5314 cell_space_->MaximumCommittedMemory()); |
5313 PrintF("maximum_committed_by_property_space=%" V8_PTR_PREFIX "d ", | 5315 PrintF("maximum_committed_by_property_space=%" V8_PTR_PREFIX "d ", |
5314 property_cell_space_->MaximumCommittedMemory()); | 5316 property_cell_space_->MaximumCommittedMemory()); |
5315 PrintF("maximum_committed_by_lo_space=%" V8_PTR_PREFIX "d ", | 5317 PrintF("maximum_committed_by_lo_space=%" V8_PTR_PREFIX "d ", |
5316 lo_space_->MaximumCommittedMemory()); | 5318 lo_space_->MaximumCommittedMemory()); |
5317 PrintF("\n\n"); | 5319 PrintF("\n\n"); |
5318 } | 5320 } |
5319 | 5321 |
| 5322 if (FLAG_allocations_digest) { |
| 5323 PrintAlloctionsHash(); |
| 5324 } |
| 5325 |
5320 TearDownArrayBuffers(); | 5326 TearDownArrayBuffers(); |
5321 | 5327 |
5322 isolate_->global_handles()->TearDown(); | 5328 isolate_->global_handles()->TearDown(); |
5323 | 5329 |
5324 external_string_table_.TearDown(); | 5330 external_string_table_.TearDown(); |
5325 | 5331 |
5326 mark_compact_collector()->TearDown(); | 5332 mark_compact_collector()->TearDown(); |
5327 | 5333 |
5328 new_space_.TearDown(); | 5334 new_space_.TearDown(); |
5329 | 5335 |
(...skipping 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6430 static_cast<int>(object_sizes_last_time_[index])); | 6436 static_cast<int>(object_sizes_last_time_[index])); |
6431 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 6437 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
6432 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 6438 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
6433 | 6439 |
6434 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 6440 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
6435 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 6441 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
6436 ClearObjectStats(); | 6442 ClearObjectStats(); |
6437 } | 6443 } |
6438 | 6444 |
6439 } } // namespace v8::internal | 6445 } } // namespace v8::internal |
OLD | NEW |