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 } |
189 if (map_obj->has_code_cache()) { | 195 if (map_obj->has_code_cache()) { |
190 CodeCache* cache = CodeCache::cast(map_obj->code_cache()); | 196 CodeCache* cache = CodeCache::cast(map_obj->code_cache()); |
191 heap->object_stats_->RecordFixedArraySubTypeStats( | 197 heap->object_stats_->RecordFixedArraySubTypeStats( |
192 MAP_CODE_CACHE_SUB_TYPE, cache->default_cache()->Size()); | 198 MAP_CODE_CACHE_SUB_TYPE, cache->default_cache()->Size()); |
193 if (!cache->normal_type_cache()->IsUndefined()) { | 199 if (!cache->normal_type_cache()->IsUndefined()) { |
194 heap->object_stats_->RecordFixedArraySubTypeStats( | 200 heap->object_stats_->RecordFixedArraySubTypeStats( |
195 MAP_CODE_CACHE_SUB_TYPE, | 201 MAP_CODE_CACHE_SUB_TYPE, |
196 FixedArray::cast(cache->normal_type_cache())->Size()); | 202 FixedArray::cast(cache->normal_type_cache())->Size()); |
197 } | 203 } |
198 } | 204 } |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 // Copy the original visitor table to make call-through possible. After we | 249 // Copy the original visitor table to make call-through possible. After we |
244 // preserved a copy locally, we patch the original table to call us. | 250 // preserved a copy locally, we patch the original table to call us. |
245 table_.CopyFrom(original); | 251 table_.CopyFrom(original); |
246 #define COUNT_FUNCTION(id) original->Register(kVisit##id, Visit<kVisit##id>); | 252 #define COUNT_FUNCTION(id) original->Register(kVisit##id, Visit<kVisit##id>); |
247 VISITOR_ID_LIST(COUNT_FUNCTION) | 253 VISITOR_ID_LIST(COUNT_FUNCTION) |
248 #undef COUNT_FUNCTION | 254 #undef COUNT_FUNCTION |
249 } | 255 } |
250 | 256 |
251 } // namespace internal | 257 } // namespace internal |
252 } // namespace v8 | 258 } // namespace v8 |
OLD | NEW |