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 2357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2885 count = 0; | 2878 count = 0; |
2886 } | 2879 } |
2887 // Must be small, since an iteration is used for lookup. | 2880 // Must be small, since an iteration is used for lookup. |
2888 static const int kMaxComments = 64; | 2881 static const int kMaxComments = 64; |
2889 }; | 2882 }; |
2890 #endif | 2883 #endif |
2891 } | 2884 } |
2892 } // namespace v8::internal | 2885 } // namespace v8::internal |
2893 | 2886 |
2894 #endif // V8_HEAP_SPACES_H_ | 2887 #endif // V8_HEAP_SPACES_H_ |
OLD | NEW |