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/assembler-inl.h" | 7 #include "src/assembler-inl.h" |
8 #include "src/compilation-cache.h" | 8 #include "src/compilation-cache.h" |
9 #include "src/counters.h" | 9 #include "src/counters.h" |
10 #include "src/heap/heap-inl.h" | 10 #include "src/heap/heap-inl.h" |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 if (obj->IsJSWeakCollection()) { | 264 if (obj->IsJSWeakCollection()) { |
265 RecordJSWeakCollectionDetails(JSWeakCollection::cast(obj)); | 265 RecordJSWeakCollectionDetails(JSWeakCollection::cast(obj)); |
266 } | 266 } |
267 if (obj->IsJSCollection()) { | 267 if (obj->IsJSCollection()) { |
268 RecordJSCollectionDetails(JSObject::cast(obj)); | 268 RecordJSCollectionDetails(JSObject::cast(obj)); |
269 } | 269 } |
270 if (obj->IsJSFunction()) RecordJSFunctionDetails(JSFunction::cast(obj)); | 270 if (obj->IsJSFunction()) RecordJSFunctionDetails(JSFunction::cast(obj)); |
271 if (obj->IsScript()) RecordScriptDetails(Script::cast(obj)); | 271 if (obj->IsScript()) RecordScriptDetails(Script::cast(obj)); |
272 } | 272 } |
273 | 273 |
274 class ObjectStatsCollector::CompilationCacheTableVisitor | 274 class ObjectStatsCollector::CompilationCacheTableVisitor : public RootVisitor { |
275 : public ObjectVisitor { | |
276 public: | 275 public: |
277 explicit CompilationCacheTableVisitor(ObjectStatsCollector* parent) | 276 explicit CompilationCacheTableVisitor(ObjectStatsCollector* parent) |
278 : parent_(parent) {} | 277 : parent_(parent) {} |
279 | 278 |
280 void VisitPointers(Object** start, Object** end) override { | 279 void VisitRootPointers(Root root, Object** start, Object** end) override { |
281 for (Object** current = start; current < end; current++) { | 280 for (Object** current = start; current < end; current++) { |
282 HeapObject* obj = HeapObject::cast(*current); | 281 HeapObject* obj = HeapObject::cast(*current); |
283 if (obj->IsUndefined(parent_->heap_->isolate())) continue; | 282 if (obj->IsUndefined(parent_->heap_->isolate())) continue; |
284 CHECK(obj->IsCompilationCacheTable()); | 283 CHECK(obj->IsCompilationCacheTable()); |
285 parent_->RecordHashTableHelper(nullptr, CompilationCacheTable::cast(obj), | 284 parent_->RecordHashTableHelper(nullptr, CompilationCacheTable::cast(obj), |
286 COMPILATION_CACHE_TABLE_SUB_TYPE); | 285 COMPILATION_CACHE_TABLE_SUB_TYPE); |
287 } | 286 } |
288 } | 287 } |
289 | 288 |
290 private: | 289 private: |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 SLOW_TEMPLATE_INSTANTIATIONS_CACHE_SUB_TYPE); | 579 SLOW_TEMPLATE_INSTANTIATIONS_CACHE_SUB_TYPE); |
581 FixedArray* fast_cache = native_ctx->fast_template_instantiations_cache(); | 580 FixedArray* fast_cache = native_ctx->fast_template_instantiations_cache(); |
582 stats_->RecordFixedArraySubTypeStats( | 581 stats_->RecordFixedArraySubTypeStats( |
583 fast_cache, FAST_TEMPLATE_INSTANTIATIONS_CACHE_SUB_TYPE, | 582 fast_cache, FAST_TEMPLATE_INSTANTIATIONS_CACHE_SUB_TYPE, |
584 fast_cache->Size(), 0); | 583 fast_cache->Size(), 0); |
585 } | 584 } |
586 } | 585 } |
587 | 586 |
588 } // namespace internal | 587 } // namespace internal |
589 } // namespace v8 | 588 } // namespace v8 |
OLD | NEW |