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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 (map_obj->has_code_cache()) { | 189 if (map_obj->has_code_cache()) { |
190 FixedArray* cache = FixedArray::cast(map_obj->code_cache()); | 190 FixedArray* cache = map_obj->code_cache(); |
191 heap->object_stats_->RecordFixedArraySubTypeStats(MAP_CODE_CACHE_SUB_TYPE, | 191 heap->object_stats_->RecordFixedArraySubTypeStats(MAP_CODE_CACHE_SUB_TYPE, |
192 cache->Size()); | 192 cache->Size()); |
193 } | 193 } |
194 VisitBase(kVisitMap, map, obj); | 194 VisitBase(kVisitMap, map, obj); |
195 } | 195 } |
196 | 196 |
197 | 197 |
198 template <> | 198 template <> |
199 void ObjectStatsVisitor::Visit<ObjectStatsVisitor::kVisitCode>( | 199 void ObjectStatsVisitor::Visit<ObjectStatsVisitor::kVisitCode>( |
200 Map* map, HeapObject* obj) { | 200 Map* map, HeapObject* obj) { |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 // Copy the original visitor table to make call-through possible. After we | 238 // Copy the original visitor table to make call-through possible. After we |
239 // preserved a copy locally, we patch the original table to call us. | 239 // preserved a copy locally, we patch the original table to call us. |
240 table_.CopyFrom(original); | 240 table_.CopyFrom(original); |
241 #define COUNT_FUNCTION(id) original->Register(kVisit##id, Visit<kVisit##id>); | 241 #define COUNT_FUNCTION(id) original->Register(kVisit##id, Visit<kVisit##id>); |
242 VISITOR_ID_LIST(COUNT_FUNCTION) | 242 VISITOR_ID_LIST(COUNT_FUNCTION) |
243 #undef COUNT_FUNCTION | 243 #undef COUNT_FUNCTION |
244 } | 244 } |
245 | 245 |
246 } // namespace internal | 246 } // namespace internal |
247 } // namespace v8 | 247 } // namespace v8 |
OLD | NEW |