OLD | NEW |
---|---|
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1744 | 1744 |
1745 void IncrementUnsweptFreeBytes(int by) { | 1745 void IncrementUnsweptFreeBytes(int by) { |
1746 unswept_free_bytes_ += by; | 1746 unswept_free_bytes_ += by; |
1747 } | 1747 } |
1748 | 1748 |
1749 void IncreaseUnsweptFreeBytes(Page* p) { | 1749 void IncreaseUnsweptFreeBytes(Page* p) { |
1750 ASSERT(ShouldBeSweptLazily(p)); | 1750 ASSERT(ShouldBeSweptLazily(p)); |
1751 unswept_free_bytes_ += (p->area_size() - p->LiveBytes()); | 1751 unswept_free_bytes_ += (p->area_size() - p->LiveBytes()); |
1752 } | 1752 } |
1753 | 1753 |
1754 void DecreaseUnsweptFreeBytes(int by) { | |
Michael Starzinger
2013/02/28 13:09:52
Let's rename this to DecrementUnsweptFreeBytes() w
Hannes Payer (out of office)
2013/02/28 14:42:34
Done.
| |
1755 unswept_free_bytes_ -= by; | |
1756 } | |
1757 | |
1754 void DecreaseUnsweptFreeBytes(Page* p) { | 1758 void DecreaseUnsweptFreeBytes(Page* p) { |
1755 ASSERT(ShouldBeSweptLazily(p)); | 1759 ASSERT(ShouldBeSweptLazily(p)); |
1756 unswept_free_bytes_ -= (p->area_size() - p->LiveBytes()); | 1760 unswept_free_bytes_ -= (p->area_size() - p->LiveBytes()); |
1757 } | 1761 } |
1758 | 1762 |
1763 void ResetUnsweptFreeBytes() { | |
1764 unswept_free_bytes_ = 0; | |
1765 } | |
1766 | |
1759 bool AdvanceSweeper(intptr_t bytes_to_sweep); | 1767 bool AdvanceSweeper(intptr_t bytes_to_sweep); |
1760 | 1768 |
1761 // When parallel sweeper threads are active this function waits | 1769 // When parallel sweeper threads are active this function waits |
1762 // for them to complete, otherwise AdvanceSweeper with size_in_bytes | 1770 // for them to complete, otherwise AdvanceSweeper with size_in_bytes |
1763 // is called. | 1771 // is called. |
1764 bool EnsureSweeperProgress(intptr_t size_in_bytes); | 1772 bool EnsureSweeperProgress(intptr_t size_in_bytes); |
1765 | 1773 |
1766 bool IsSweepingComplete() { | 1774 bool IsSweepingComplete() { |
1767 return !first_unswept_page_->is_valid(); | 1775 return !first_unswept_page_->is_valid(); |
1768 } | 1776 } |
(...skipping 1051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2820 } | 2828 } |
2821 // Must be small, since an iteration is used for lookup. | 2829 // Must be small, since an iteration is used for lookup. |
2822 static const int kMaxComments = 64; | 2830 static const int kMaxComments = 64; |
2823 }; | 2831 }; |
2824 #endif | 2832 #endif |
2825 | 2833 |
2826 | 2834 |
2827 } } // namespace v8::internal | 2835 } } // namespace v8::internal |
2828 | 2836 |
2829 #endif // V8_SPACES_H_ | 2837 #endif // V8_SPACES_H_ |
OLD | NEW |