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

Side by Side Diff: src/heap/spaces.h

Issue 1559873004: [heap] Buffer counter updates for new space evacuation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Switch AdjustLiveBytes to checking whether we are in a HeapIterator Created 4 years, 11 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 | « src/heap/mark-compact.cc ('k') | 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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 #ifndef V8_HEAP_SPACES_H_ 5 #ifndef V8_HEAP_SPACES_H_
6 #define V8_HEAP_SPACES_H_ 6 #define V8_HEAP_SPACES_H_
7 7
8 #include "src/allocation.h" 8 #include "src/allocation.h"
9 #include "src/atomic-utils.h" 9 #include "src/atomic-utils.h"
10 #include "src/base/atomicops.h" 10 #include "src/base/atomicops.h"
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after
588 588
589 // Manage live byte count (count of bytes known to be live, 589 // Manage live byte count (count of bytes known to be live,
590 // because they are marked black). 590 // because they are marked black).
591 void ResetLiveBytes() { 591 void ResetLiveBytes() {
592 if (FLAG_gc_verbose) { 592 if (FLAG_gc_verbose) {
593 PrintF("ResetLiveBytes:%p:%x->0\n", static_cast<void*>(this), 593 PrintF("ResetLiveBytes:%p:%x->0\n", static_cast<void*>(this),
594 live_byte_count_); 594 live_byte_count_);
595 } 595 }
596 live_byte_count_ = 0; 596 live_byte_count_ = 0;
597 } 597 }
598
598 void IncrementLiveBytes(int by) { 599 void IncrementLiveBytes(int by) {
599 if (FLAG_gc_verbose) { 600 if (FLAG_gc_verbose) {
600 printf("UpdateLiveBytes:%p:%x%c=%x->%x\n", static_cast<void*>(this), 601 printf("UpdateLiveBytes:%p:%x%c=%x->%x\n", static_cast<void*>(this),
601 live_byte_count_, ((by < 0) ? '-' : '+'), ((by < 0) ? -by : by), 602 live_byte_count_, ((by < 0) ? '-' : '+'), ((by < 0) ? -by : by),
602 live_byte_count_ + by); 603 live_byte_count_ + by);
603 } 604 }
604 live_byte_count_ += by; 605 live_byte_count_ += by;
606 DCHECK_GE(live_byte_count_, 0);
605 DCHECK_LE(static_cast<unsigned>(live_byte_count_), size_); 607 DCHECK_LE(static_cast<unsigned>(live_byte_count_), size_);
606 } 608 }
609
607 int LiveBytes() { 610 int LiveBytes() {
608 DCHECK(static_cast<unsigned>(live_byte_count_) <= size_); 611 DCHECK_LE(static_cast<unsigned>(live_byte_count_), size_);
609 return live_byte_count_; 612 return live_byte_count_;
610 } 613 }
611 614
612 int write_barrier_counter() { 615 int write_barrier_counter() {
613 return static_cast<int>(write_barrier_counter_); 616 return static_cast<int>(write_barrier_counter_);
614 } 617 }
615 618
616 void set_write_barrier_counter(int counter) { 619 void set_write_barrier_counter(int counter) {
617 write_barrier_counter_ = counter; 620 write_barrier_counter_ = counter;
618 } 621 }
(...skipping 2601 matching lines...) Expand 10 before | Expand all | Expand 10 after
3220 count = 0; 3223 count = 0;
3221 } 3224 }
3222 // Must be small, since an iteration is used for lookup. 3225 // Must be small, since an iteration is used for lookup.
3223 static const int kMaxComments = 64; 3226 static const int kMaxComments = 64;
3224 }; 3227 };
3225 #endif 3228 #endif
3226 } // namespace internal 3229 } // namespace internal
3227 } // namespace v8 3230 } // namespace v8
3228 3231
3229 #endif // V8_HEAP_SPACES_H_ 3232 #endif // V8_HEAP_SPACES_H_
OLDNEW
« no previous file with comments | « src/heap/mark-compact.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698