| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/heap/object-stats.h" | 5 #include "src/heap/object-stats.h" |
| 6 | 6 |
| 7 #include "src/counters.h" | 7 #include "src/counters.h" |
| 8 #include "src/heap/heap-inl.h" | 8 #include "src/heap/heap-inl.h" |
| 9 #include "src/isolate.h" | 9 #include "src/isolate.h" |
| 10 #include "src/utils.h" | 10 #include "src/utils.h" |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 HeapObject* obj) { | 179 HeapObject* obj) { |
| 180 Heap* heap = map->GetHeap(); | 180 Heap* heap = map->GetHeap(); |
| 181 Map* map_obj = Map::cast(obj); | 181 Map* map_obj = Map::cast(obj); |
| 182 DCHECK(map->instance_type() == MAP_TYPE); | 182 DCHECK(map->instance_type() == MAP_TYPE); |
| 183 DescriptorArray* array = map_obj->instance_descriptors(); | 183 DescriptorArray* array = map_obj->instance_descriptors(); |
| 184 if (map_obj->owns_descriptors() && array != heap->empty_descriptor_array()) { | 184 if (map_obj->owns_descriptors() && array != heap->empty_descriptor_array()) { |
| 185 int fixed_array_size = array->Size(); | 185 int fixed_array_size = array->Size(); |
| 186 heap->object_stats_->RecordFixedArraySubTypeStats(DESCRIPTOR_ARRAY_SUB_TYPE, | 186 heap->object_stats_->RecordFixedArraySubTypeStats(DESCRIPTOR_ARRAY_SUB_TYPE, |
| 187 fixed_array_size); | 187 fixed_array_size); |
| 188 } | 188 } |
| 189 if (TransitionArray::IsFullTransitionArray(map_obj->raw_transitions())) { | |
| 190 int fixed_array_size = | |
| 191 TransitionArray::cast(map_obj->raw_transitions())->Size(); | |
| 192 heap->object_stats_->RecordFixedArraySubTypeStats(TRANSITION_ARRAY_SUB_TYPE, | |
| 193 fixed_array_size); | |
| 194 } | |
| 195 if (map_obj->has_code_cache()) { | 189 if (map_obj->has_code_cache()) { |
| 196 CodeCache* cache = CodeCache::cast(map_obj->code_cache()); | 190 CodeCache* cache = CodeCache::cast(map_obj->code_cache()); |
| 197 heap->object_stats_->RecordFixedArraySubTypeStats( | 191 heap->object_stats_->RecordFixedArraySubTypeStats( |
| 198 MAP_CODE_CACHE_SUB_TYPE, cache->default_cache()->Size()); | 192 MAP_CODE_CACHE_SUB_TYPE, cache->default_cache()->Size()); |
| 199 if (!cache->normal_type_cache()->IsUndefined()) { | 193 if (!cache->normal_type_cache()->IsUndefined()) { |
| 200 heap->object_stats_->RecordFixedArraySubTypeStats( | 194 heap->object_stats_->RecordFixedArraySubTypeStats( |
| 201 MAP_CODE_CACHE_SUB_TYPE, | 195 MAP_CODE_CACHE_SUB_TYPE, |
| 202 FixedArray::cast(cache->normal_type_cache())->Size()); | 196 FixedArray::cast(cache->normal_type_cache())->Size()); |
| 203 } | 197 } |
| 204 } | 198 } |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 // Copy the original visitor table to make call-through possible. After we | 243 // Copy the original visitor table to make call-through possible. After we |
| 250 // preserved a copy locally, we patch the original table to call us. | 244 // preserved a copy locally, we patch the original table to call us. |
| 251 table_.CopyFrom(original); | 245 table_.CopyFrom(original); |
| 252 #define COUNT_FUNCTION(id) original->Register(kVisit##id, Visit<kVisit##id>); | 246 #define COUNT_FUNCTION(id) original->Register(kVisit##id, Visit<kVisit##id>); |
| 253 VISITOR_ID_LIST(COUNT_FUNCTION) | 247 VISITOR_ID_LIST(COUNT_FUNCTION) |
| 254 #undef COUNT_FUNCTION | 248 #undef COUNT_FUNCTION |
| 255 } | 249 } |
| 256 | 250 |
| 257 } // namespace internal | 251 } // namespace internal |
| 258 } // namespace v8 | 252 } // namespace v8 |
| OLD | NEW |