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

Side by Side Diff: src/heap/gc-tracer.cc

Issue 2490523003: [heap] Use size_t for heap and space counters. (Closed)
Patch Set: more fixes Created 4 years, 1 month 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/extensions/statistics-extension.cc ('k') | src/heap/heap.h » ('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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/gc-tracer.h" 5 #include "src/heap/gc-tracer.h"
6 6
7 #include "src/counters.h" 7 #include "src/counters.h"
8 #include "src/heap/heap-inl.h" 8 #include "src/heap/heap-inl.h"
9 #include "src/isolate.h" 9 #include "src/isolate.h"
10 10
11 namespace v8 { 11 namespace v8 {
12 namespace internal { 12 namespace internal {
13 13
14 static size_t CountTotalHolesSize(Heap* heap) { 14 static size_t CountTotalHolesSize(Heap* heap) {
15 size_t holes_size = 0; 15 size_t holes_size = 0;
16 OldSpaces spaces(heap); 16 OldSpaces spaces(heap);
17 for (OldSpace* space = spaces.next(); space != NULL; space = spaces.next()) { 17 for (OldSpace* space = spaces.next(); space != NULL; space = spaces.next()) {
18 DCHECK_GE(space->Waste(), 0);
19 DCHECK_GE(space->Available(), 0);
20 DCHECK_GE(holes_size + space->Waste() + space->Available(), holes_size); 18 DCHECK_GE(holes_size + space->Waste() + space->Available(), holes_size);
21 holes_size += static_cast<size_t>(space->Waste() + space->Available()); 19 holes_size += space->Waste() + space->Available();
22 } 20 }
23 return holes_size; 21 return holes_size;
24 } 22 }
25 23
26 24
27 GCTracer::Scope::Scope(GCTracer* tracer, ScopeId scope) 25 GCTracer::Scope::Scope(GCTracer* tracer, ScopeId scope)
28 : tracer_(tracer), scope_(scope) { 26 : tracer_(tracer), scope_(scope) {
29 // All accesses to incremental_marking_scope assume that incremental marking 27 // All accesses to incremental_marking_scope assume that incremental marking
30 // scopes come first. 28 // scopes come first.
31 STATIC_ASSERT(FIRST_INCREMENTAL_SCOPE == 0); 29 STATIC_ASSERT(FIRST_INCREMENTAL_SCOPE == 0);
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 "total_size_before=%" PRIuS 460 "total_size_before=%" PRIuS
463 " " 461 " "
464 "total_size_after=%" PRIuS 462 "total_size_after=%" PRIuS
465 " " 463 " "
466 "holes_size_before=%" PRIuS 464 "holes_size_before=%" PRIuS
467 " " 465 " "
468 "holes_size_after=%" PRIuS 466 "holes_size_after=%" PRIuS
469 " " 467 " "
470 "allocated=%" PRIuS 468 "allocated=%" PRIuS
471 " " 469 " "
472 "promoted=%" V8PRIdPTR 470 "promoted=%" PRIuS
473 " " 471 " "
474 "semi_space_copied=%" V8PRIdPTR 472 "semi_space_copied=%" PRIuS
475 " " 473 " "
476 "nodes_died_in_new=%d " 474 "nodes_died_in_new=%d "
477 "nodes_copied_in_new=%d " 475 "nodes_copied_in_new=%d "
478 "nodes_promoted=%d " 476 "nodes_promoted=%d "
479 "promotion_ratio=%.1f%% " 477 "promotion_ratio=%.1f%% "
480 "average_survival_ratio=%.1f%% " 478 "average_survival_ratio=%.1f%% "
481 "promotion_rate=%.1f%% " 479 "promotion_rate=%.1f%% "
482 "semi_space_copy_rate=%.1f%% " 480 "semi_space_copy_rate=%.1f%% "
483 "new_space_allocation_throughput=%.1f " 481 "new_space_allocation_throughput=%.1f "
484 "context_disposal_rate=%.1f\n", 482 "context_disposal_rate=%.1f\n",
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 "total_size_before=%" PRIuS 582 "total_size_before=%" PRIuS
585 " " 583 " "
586 "total_size_after=%" PRIuS 584 "total_size_after=%" PRIuS
587 " " 585 " "
588 "holes_size_before=%" PRIuS 586 "holes_size_before=%" PRIuS
589 " " 587 " "
590 "holes_size_after=%" PRIuS 588 "holes_size_after=%" PRIuS
591 " " 589 " "
592 "allocated=%" PRIuS 590 "allocated=%" PRIuS
593 " " 591 " "
594 "promoted=%" V8PRIdPTR 592 "promoted=%" PRIuS
595 " " 593 " "
596 "semi_space_copied=%" V8PRIdPTR 594 "semi_space_copied=%" PRIuS
597 " " 595 " "
598 "nodes_died_in_new=%d " 596 "nodes_died_in_new=%d "
599 "nodes_copied_in_new=%d " 597 "nodes_copied_in_new=%d "
600 "nodes_promoted=%d " 598 "nodes_promoted=%d "
601 "promotion_ratio=%.1f%% " 599 "promotion_ratio=%.1f%% "
602 "average_survival_ratio=%.1f%% " 600 "average_survival_ratio=%.1f%% "
603 "promotion_rate=%.1f%% " 601 "promotion_rate=%.1f%% "
604 "semi_space_copy_rate=%.1f%% " 602 "semi_space_copy_rate=%.1f%% "
605 "new_space_allocation_throughput=%.1f " 603 "new_space_allocation_throughput=%.1f "
606 "context_disposal_rate=%.1f " 604 "context_disposal_rate=%.1f "
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
828 } 826 }
829 827
830 void GCTracer::ResetSurvivalEvents() { recorded_survival_ratios_.Reset(); } 828 void GCTracer::ResetSurvivalEvents() { recorded_survival_ratios_.Reset(); }
831 829
832 void GCTracer::NotifyIncrementalMarkingStart() { 830 void GCTracer::NotifyIncrementalMarkingStart() {
833 incremental_marking_start_time_ = heap_->MonotonicallyIncreasingTimeInMs(); 831 incremental_marking_start_time_ = heap_->MonotonicallyIncreasingTimeInMs();
834 } 832 }
835 833
836 } // namespace internal 834 } // namespace internal
837 } // namespace v8 835 } // namespace v8
OLDNEW
« no previous file with comments | « src/extensions/statistics-extension.cc ('k') | src/heap/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698