OLD | NEW |
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 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
605 live_byte_count_ += by; | 605 live_byte_count_ += by; |
606 DCHECK_GE(live_byte_count_, 0); | 606 DCHECK_GE(live_byte_count_, 0); |
607 DCHECK_LE(static_cast<unsigned>(live_byte_count_), size_); | 607 DCHECK_LE(static_cast<unsigned>(live_byte_count_), size_); |
608 } | 608 } |
609 | 609 |
610 int LiveBytes() { | 610 int LiveBytes() { |
611 DCHECK_LE(static_cast<unsigned>(live_byte_count_), size_); | 611 DCHECK_LE(static_cast<unsigned>(live_byte_count_), size_); |
612 return live_byte_count_; | 612 return live_byte_count_; |
613 } | 613 } |
614 | 614 |
| 615 void SetLiveBytes(int live_bytes) { |
| 616 DCHECK_GE(live_bytes, 0); |
| 617 DCHECK_LE(static_cast<unsigned>(live_bytes), size_); |
| 618 live_byte_count_ = live_bytes; |
| 619 } |
| 620 |
615 int write_barrier_counter() { | 621 int write_barrier_counter() { |
616 return static_cast<int>(write_barrier_counter_); | 622 return static_cast<int>(write_barrier_counter_); |
617 } | 623 } |
618 | 624 |
619 void set_write_barrier_counter(int counter) { | 625 void set_write_barrier_counter(int counter) { |
620 write_barrier_counter_ = counter; | 626 write_barrier_counter_ = counter; |
621 } | 627 } |
622 | 628 |
623 int progress_bar() { | 629 int progress_bar() { |
624 DCHECK(IsFlagSet(HAS_PROGRESS_BAR)); | 630 DCHECK(IsFlagSet(HAS_PROGRESS_BAR)); |
(...skipping 2598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3223 count = 0; | 3229 count = 0; |
3224 } | 3230 } |
3225 // Must be small, since an iteration is used for lookup. | 3231 // Must be small, since an iteration is used for lookup. |
3226 static const int kMaxComments = 64; | 3232 static const int kMaxComments = 64; |
3227 }; | 3233 }; |
3228 #endif | 3234 #endif |
3229 } // namespace internal | 3235 } // namespace internal |
3230 } // namespace v8 | 3236 } // namespace v8 |
3231 | 3237 |
3232 #endif // V8_HEAP_SPACES_H_ | 3238 #endif // V8_HEAP_SPACES_H_ |
OLD | NEW |