Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(158)

Side by Side Diff: src/heap/object-stats.cc

Issue 2504153002: [TypeFeedbackVector] Root literal arrays in function literals slots (Closed)
Patch Set: REBASE. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/full-codegen/full-codegen.cc ('k') | src/ia32/interface-descriptors-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 if (!feedback_metadata->is_empty()) { 544 if (!feedback_metadata->is_empty()) {
545 RecordFixedArrayHelper(sfi, feedback_metadata, 545 RecordFixedArrayHelper(sfi, feedback_metadata,
546 TYPE_FEEDBACK_METADATA_SUB_TYPE, 0); 546 TYPE_FEEDBACK_METADATA_SUB_TYPE, 0);
547 } 547 }
548 548
549 if (!sfi->OptimizedCodeMapIsCleared()) { 549 if (!sfi->OptimizedCodeMapIsCleared()) {
550 FixedArray* optimized_code_map = sfi->optimized_code_map(); 550 FixedArray* optimized_code_map = sfi->optimized_code_map();
551 RecordFixedArrayHelper(sfi, optimized_code_map, OPTIMIZED_CODE_MAP_SUB_TYPE, 551 RecordFixedArrayHelper(sfi, optimized_code_map, OPTIMIZED_CODE_MAP_SUB_TYPE,
552 0); 552 0);
553 // Optimized code map should be small, so skip accounting. 553 // Optimized code map should be small, so skip accounting.
554 int len = optimized_code_map->length();
555 for (int i = SharedFunctionInfo::kEntriesStart; i < len;
556 i += SharedFunctionInfo::kEntryLength) {
557 Object* slot =
558 optimized_code_map->get(i + SharedFunctionInfo::kLiteralsOffset);
559 LiteralsArray* literals = nullptr;
560 if (slot->IsWeakCell()) {
561 WeakCell* cell = WeakCell::cast(slot);
562 if (!cell->cleared()) {
563 literals = LiteralsArray::cast(cell->value());
564 }
565 } else {
566 literals = LiteralsArray::cast(slot);
567 }
568 if (literals != nullptr) {
569 RecordFixedArrayHelper(sfi, literals, LITERALS_ARRAY_SUB_TYPE, 0);
570 RecordFixedArrayHelper(sfi, literals->feedback_vector(),
571 TYPE_FEEDBACK_VECTOR_SUB_TYPE, 0);
572 }
573 }
574 } 554 }
575 } 555 }
576 556
577 void ObjectStatsCollector::RecordJSFunctionDetails(JSFunction* function) { 557 void ObjectStatsCollector::RecordJSFunctionDetails(JSFunction* function) {
578 LiteralsArray* literals = function->literals(); 558 LiteralsArray* literals = function->literals();
579 RecordFixedArrayHelper(function, literals, LITERALS_ARRAY_SUB_TYPE, 0); 559 RecordFixedArrayHelper(function, literals, LITERALS_ARRAY_SUB_TYPE, 0);
580 RecordFixedArrayHelper(function, literals->feedback_vector(), 560 RecordFixedArrayHelper(function, literals->feedback_vector(),
581 TYPE_FEEDBACK_VECTOR_SUB_TYPE, 0); 561 TYPE_FEEDBACK_VECTOR_SUB_TYPE, 0);
582 } 562 }
583 563
(...skipping 12 matching lines...) Expand all
596 SLOW_TEMPLATE_INSTANTIATIONS_CACHE_SUB_TYPE); 576 SLOW_TEMPLATE_INSTANTIATIONS_CACHE_SUB_TYPE);
597 FixedArray* fast_cache = native_ctx->fast_template_instantiations_cache(); 577 FixedArray* fast_cache = native_ctx->fast_template_instantiations_cache();
598 stats_->RecordFixedArraySubTypeStats( 578 stats_->RecordFixedArraySubTypeStats(
599 fast_cache, FAST_TEMPLATE_INSTANTIATIONS_CACHE_SUB_TYPE, 579 fast_cache, FAST_TEMPLATE_INSTANTIATIONS_CACHE_SUB_TYPE,
600 fast_cache->Size(), 0); 580 fast_cache->Size(), 0);
601 } 581 }
602 } 582 }
603 583
604 } // namespace internal 584 } // namespace internal
605 } // namespace v8 585 } // namespace v8
OLDNEW
« no previous file with comments | « src/full-codegen/full-codegen.cc ('k') | src/ia32/interface-descriptors-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698