| 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/base/atomicops.h" | 9 #include "src/base/atomicops.h" |
| 10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
| (...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 progress_bar_ = progress_bar; | 501 progress_bar_ = progress_bar; |
| 502 } | 502 } |
| 503 | 503 |
| 504 void ResetProgressBar() { | 504 void ResetProgressBar() { |
| 505 if (IsFlagSet(MemoryChunk::HAS_PROGRESS_BAR)) { | 505 if (IsFlagSet(MemoryChunk::HAS_PROGRESS_BAR)) { |
| 506 set_progress_bar(0); | 506 set_progress_bar(0); |
| 507 ClearFlag(MemoryChunk::HAS_PROGRESS_BAR); | 507 ClearFlag(MemoryChunk::HAS_PROGRESS_BAR); |
| 508 } | 508 } |
| 509 } | 509 } |
| 510 | 510 |
| 511 bool IsLeftOfProgressBar(Object** slot) { | |
| 512 Address slot_address = reinterpret_cast<Address>(slot); | |
| 513 DCHECK(slot_address > this->address()); | |
| 514 return (slot_address - (this->address() + kObjectStartOffset)) < | |
| 515 progress_bar(); | |
| 516 } | |
| 517 | |
| 518 static void IncrementLiveBytesFromGC(Address address, int by) { | 511 static void IncrementLiveBytesFromGC(Address address, int by) { |
| 519 MemoryChunk::FromAddress(address)->IncrementLiveBytes(by); | 512 MemoryChunk::FromAddress(address)->IncrementLiveBytes(by); |
| 520 } | 513 } |
| 521 | 514 |
| 522 static void IncrementLiveBytesFromMutator(Address address, int by); | 515 static void IncrementLiveBytesFromMutator(Address address, int by); |
| 523 | 516 |
| 524 static const intptr_t kAlignment = | 517 static const intptr_t kAlignment = |
| 525 (static_cast<uintptr_t>(1) << kPageSizeBits); | 518 (static_cast<uintptr_t>(1) << kPageSizeBits); |
| 526 | 519 |
| 527 static const intptr_t kAlignmentMask = kAlignment - 1; | 520 static const intptr_t kAlignmentMask = kAlignment - 1; |
| (...skipping 2332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2860 count = 0; | 2853 count = 0; |
| 2861 } | 2854 } |
| 2862 // Must be small, since an iteration is used for lookup. | 2855 // Must be small, since an iteration is used for lookup. |
| 2863 static const int kMaxComments = 64; | 2856 static const int kMaxComments = 64; |
| 2864 }; | 2857 }; |
| 2865 #endif | 2858 #endif |
| 2866 } | 2859 } |
| 2867 } // namespace v8::internal | 2860 } // namespace v8::internal |
| 2868 | 2861 |
| 2869 #endif // V8_HEAP_SPACES_H_ | 2862 #endif // V8_HEAP_SPACES_H_ |
| OLD | NEW |