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 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
485 | 485 |
486 int write_barrier_counter() { | 486 int write_barrier_counter() { |
487 return static_cast<int>(write_barrier_counter_); | 487 return static_cast<int>(write_barrier_counter_); |
488 } | 488 } |
489 | 489 |
490 void set_write_barrier_counter(int counter) { | 490 void set_write_barrier_counter(int counter) { |
491 write_barrier_counter_ = counter; | 491 write_barrier_counter_ = counter; |
492 } | 492 } |
493 | 493 |
494 int progress_bar() { | 494 int progress_bar() { |
495 DCHECK(IsFlagSet(HAS_PROGRESS_BAR)); | 495 DCHECK(IsFlagSet(HAS_PROGRESS_BAR)); |
ulan
2015/05/04 10:43:49
Can we remove the rest of "progress_bar" code?
Hannes Payer (out of office)
2015/05/04 12:43:13
No, we still need it to incrementally mark large o
| |
496 return progress_bar_; | 496 return progress_bar_; |
497 } | 497 } |
498 | 498 |
499 void set_progress_bar(int progress_bar) { | 499 void set_progress_bar(int progress_bar) { |
500 DCHECK(IsFlagSet(HAS_PROGRESS_BAR)); | 500 DCHECK(IsFlagSet(HAS_PROGRESS_BAR)); |
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 |