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 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 } | 539 } |
540 | 540 |
541 void ObjectStatsCollector::RecordSharedFunctionInfoDetails( | 541 void ObjectStatsCollector::RecordSharedFunctionInfoDetails( |
542 SharedFunctionInfo* sfi) { | 542 SharedFunctionInfo* sfi) { |
543 FixedArray* scope_info = sfi->scope_info(); | 543 FixedArray* scope_info = sfi->scope_info(); |
544 RecordFixedArrayHelper(sfi, scope_info, SCOPE_INFO_SUB_TYPE, 0); | 544 RecordFixedArrayHelper(sfi, scope_info, SCOPE_INFO_SUB_TYPE, 0); |
545 TypeFeedbackMetadata* feedback_metadata = sfi->feedback_metadata(); | 545 TypeFeedbackMetadata* feedback_metadata = sfi->feedback_metadata(); |
546 if (!feedback_metadata->is_empty()) { | 546 if (!feedback_metadata->is_empty()) { |
547 RecordFixedArrayHelper(sfi, feedback_metadata, | 547 RecordFixedArrayHelper(sfi, feedback_metadata, |
548 TYPE_FEEDBACK_METADATA_SUB_TYPE, 0); | 548 TYPE_FEEDBACK_METADATA_SUB_TYPE, 0); |
549 Object* names = | |
550 feedback_metadata->get(TypeFeedbackMetadata::kNamesTableIndex); | |
551 if (!names->IsSmi()) { | |
552 UnseededNumberDictionary* names = UnseededNumberDictionary::cast( | |
553 feedback_metadata->get(TypeFeedbackMetadata::kNamesTableIndex)); | |
554 RecordHashTableHelper(sfi, names, TYPE_FEEDBACK_METADATA_SUB_TYPE); | |
555 } | |
556 } | 549 } |
557 | 550 |
558 if (!sfi->OptimizedCodeMapIsCleared()) { | 551 if (!sfi->OptimizedCodeMapIsCleared()) { |
559 FixedArray* optimized_code_map = sfi->optimized_code_map(); | 552 FixedArray* optimized_code_map = sfi->optimized_code_map(); |
560 RecordFixedArrayHelper(sfi, optimized_code_map, OPTIMIZED_CODE_MAP_SUB_TYPE, | 553 RecordFixedArrayHelper(sfi, optimized_code_map, OPTIMIZED_CODE_MAP_SUB_TYPE, |
561 0); | 554 0); |
562 // Optimized code map should be small, so skip accounting. | 555 // Optimized code map should be small, so skip accounting. |
563 int len = optimized_code_map->length(); | 556 int len = optimized_code_map->length(); |
564 for (int i = SharedFunctionInfo::kEntriesStart; i < len; | 557 for (int i = SharedFunctionInfo::kEntriesStart; i < len; |
565 i += SharedFunctionInfo::kEntryLength) { | 558 i += SharedFunctionInfo::kEntryLength) { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
605 SLOW_TEMPLATE_INSTANTIATIONS_CACHE_SUB_TYPE); | 598 SLOW_TEMPLATE_INSTANTIATIONS_CACHE_SUB_TYPE); |
606 FixedArray* fast_cache = native_ctx->fast_template_instantiations_cache(); | 599 FixedArray* fast_cache = native_ctx->fast_template_instantiations_cache(); |
607 stats_->RecordFixedArraySubTypeStats( | 600 stats_->RecordFixedArraySubTypeStats( |
608 fast_cache, FAST_TEMPLATE_INSTANTIATIONS_CACHE_SUB_TYPE, | 601 fast_cache, FAST_TEMPLATE_INSTANTIATIONS_CACHE_SUB_TYPE, |
609 fast_cache->Size(), 0); | 602 fast_cache->Size(), 0); |
610 } | 603 } |
611 } | 604 } |
612 | 605 |
613 } // namespace internal | 606 } // namespace internal |
614 } // namespace v8 | 607 } // namespace v8 |
OLD | NEW |