| 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/compilation-cache.h" | 7 #include "src/compilation-cache.h" |
| 8 #include "src/counters.h" | 8 #include "src/counters.h" |
| 9 #include "src/heap/heap-inl.h" | 9 #include "src/heap/heap-inl.h" |
| 10 #include "src/isolate.h" | 10 #include "src/isolate.h" |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 RecordFixedArrayHelper(nullptr, FixedArray::cast(JSMap::cast(obj)->table()), | 434 RecordFixedArrayHelper(nullptr, FixedArray::cast(JSMap::cast(obj)->table()), |
| 435 JS_COLLECTION_SUB_TYPE, 0); | 435 JS_COLLECTION_SUB_TYPE, 0); |
| 436 } | 436 } |
| 437 if (obj->IsJSSet()) { | 437 if (obj->IsJSSet()) { |
| 438 RecordFixedArrayHelper(nullptr, FixedArray::cast(JSSet::cast(obj)->table()), | 438 RecordFixedArrayHelper(nullptr, FixedArray::cast(JSSet::cast(obj)->table()), |
| 439 JS_COLLECTION_SUB_TYPE, 0); | 439 JS_COLLECTION_SUB_TYPE, 0); |
| 440 } | 440 } |
| 441 } | 441 } |
| 442 | 442 |
| 443 void ObjectStatsCollector::RecordScriptDetails(Script* obj) { | 443 void ObjectStatsCollector::RecordScriptDetails(Script* obj) { |
| 444 Object* infos = WeakFixedArray::cast(obj->shared_function_infos()); | 444 FixedArray* infos = FixedArray::cast(obj->shared_function_infos()); |
| 445 if (infos->IsWeakFixedArray()) | 445 RecordFixedArrayHelper(obj, infos, SHARED_FUNCTION_INFOS_SUB_TYPE, 0); |
| 446 RecordFixedArrayHelper(obj, WeakFixedArray::cast(infos), | |
| 447 SHARED_FUNCTION_INFOS_SUB_TYPE, 0); | |
| 448 } | 446 } |
| 449 | 447 |
| 450 void ObjectStatsCollector::RecordMapDetails(Map* map_obj) { | 448 void ObjectStatsCollector::RecordMapDetails(Map* map_obj) { |
| 451 DescriptorArray* array = map_obj->instance_descriptors(); | 449 DescriptorArray* array = map_obj->instance_descriptors(); |
| 452 if (map_obj->owns_descriptors() && array != heap_->empty_descriptor_array() && | 450 if (map_obj->owns_descriptors() && array != heap_->empty_descriptor_array() && |
| 453 SameLiveness(map_obj, array)) { | 451 SameLiveness(map_obj, array)) { |
| 454 RecordFixedArrayHelper(map_obj, array, DESCRIPTOR_ARRAY_SUB_TYPE, 0); | 452 RecordFixedArrayHelper(map_obj, array, DESCRIPTOR_ARRAY_SUB_TYPE, 0); |
| 455 if (array->HasEnumCache()) { | 453 if (array->HasEnumCache()) { |
| 456 RecordFixedArrayHelper(array, array->GetEnumCache(), ENUM_CACHE_SUB_TYPE, | 454 RecordFixedArrayHelper(array, array->GetEnumCache(), ENUM_CACHE_SUB_TYPE, |
| 457 0); | 455 0); |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 SLOW_TEMPLATE_INSTANTIATIONS_CACHE_SUB_TYPE); | 596 SLOW_TEMPLATE_INSTANTIATIONS_CACHE_SUB_TYPE); |
| 599 FixedArray* fast_cache = native_ctx->fast_template_instantiations_cache(); | 597 FixedArray* fast_cache = native_ctx->fast_template_instantiations_cache(); |
| 600 stats_->RecordFixedArraySubTypeStats( | 598 stats_->RecordFixedArraySubTypeStats( |
| 601 fast_cache, FAST_TEMPLATE_INSTANTIATIONS_CACHE_SUB_TYPE, | 599 fast_cache, FAST_TEMPLATE_INSTANTIATIONS_CACHE_SUB_TYPE, |
| 602 fast_cache->Size(), 0); | 600 fast_cache->Size(), 0); |
| 603 } | 601 } |
| 604 } | 602 } |
| 605 | 603 |
| 606 } // namespace internal | 604 } // namespace internal |
| 607 } // namespace v8 | 605 } // namespace v8 |
| OLD | NEW |