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

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

Issue 2393153002: [heap] ObjectStats: Handle empty deoptimization input data (Closed)
Patch Set: Created 4 years, 2 months 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 | « no previous file | no next file » | 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 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 BYTECODE_ARRAY_HANDLER_TABLE_SUB_TYPE, 0); 502 BYTECODE_ARRAY_HANDLER_TABLE_SUB_TYPE, 0);
503 } 503 }
504 504
505 void ObjectStatsCollector::RecordCodeDetails(Code* code) { 505 void ObjectStatsCollector::RecordCodeDetails(Code* code) {
506 stats_->RecordCodeSubTypeStats(code->kind(), code->GetAge(), code->Size()); 506 stats_->RecordCodeSubTypeStats(code->kind(), code->GetAge(), code->Size());
507 RecordFixedArrayHelper(code, code->deoptimization_data(), 507 RecordFixedArrayHelper(code, code->deoptimization_data(),
508 DEOPTIMIZATION_DATA_SUB_TYPE, 0); 508 DEOPTIMIZATION_DATA_SUB_TYPE, 0);
509 if (code->kind() == Code::Kind::OPTIMIZED_FUNCTION) { 509 if (code->kind() == Code::Kind::OPTIMIZED_FUNCTION) {
510 DeoptimizationInputData* input_data = 510 DeoptimizationInputData* input_data =
511 DeoptimizationInputData::cast(code->deoptimization_data()); 511 DeoptimizationInputData::cast(code->deoptimization_data());
512 RecordFixedArrayHelper(code->deoptimization_data(), 512 if (input_data->length() > 0) {
513 input_data->LiteralArray(), 513 RecordFixedArrayHelper(code->deoptimization_data(),
514 OPTIMIZED_CODE_LITERALS_SUB_TYPE, 0); 514 input_data->LiteralArray(),
515 OPTIMIZED_CODE_LITERALS_SUB_TYPE, 0);
516 }
515 } 517 }
516 RecordFixedArrayHelper(code, code->handler_table(), HANDLER_TABLE_SUB_TYPE, 518 RecordFixedArrayHelper(code, code->handler_table(), HANDLER_TABLE_SUB_TYPE,
517 0); 519 0);
518 int const mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); 520 int const mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT);
519 for (RelocIterator it(code, mode_mask); !it.done(); it.next()) { 521 for (RelocIterator it(code, mode_mask); !it.done(); it.next()) {
520 RelocInfo::Mode mode = it.rinfo()->rmode(); 522 RelocInfo::Mode mode = it.rinfo()->rmode();
521 if (mode == RelocInfo::EMBEDDED_OBJECT) { 523 if (mode == RelocInfo::EMBEDDED_OBJECT) {
522 Object* target = it.rinfo()->target_object(); 524 Object* target = it.rinfo()->target_object();
523 if (target->IsFixedArray()) { 525 if (target->IsFixedArray()) {
524 RecursivelyRecordFixedArrayHelper(code, FixedArray::cast(target), 526 RecursivelyRecordFixedArrayHelper(code, FixedArray::cast(target),
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
595 SLOW_TEMPLATE_INSTANTIATIONS_CACHE_SUB_TYPE); 597 SLOW_TEMPLATE_INSTANTIATIONS_CACHE_SUB_TYPE);
596 FixedArray* fast_cache = native_ctx->fast_template_instantiations_cache(); 598 FixedArray* fast_cache = native_ctx->fast_template_instantiations_cache();
597 stats_->RecordFixedArraySubTypeStats( 599 stats_->RecordFixedArraySubTypeStats(
598 fast_cache, FAST_TEMPLATE_INSTANTIATIONS_CACHE_SUB_TYPE, 600 fast_cache, FAST_TEMPLATE_INSTANTIATIONS_CACHE_SUB_TYPE,
599 fast_cache->Size(), 0); 601 fast_cache->Size(), 0);
600 } 602 }
601 } 603 }
602 604
603 } // namespace internal 605 } // namespace internal
604 } // namespace v8 606 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698