| 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 1680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1691 accounting_stats_.AllocateBytes(bytes); | 1691 accounting_stats_.AllocateBytes(bytes); |
| 1692 } | 1692 } |
| 1693 | 1693 |
| 1694 void IncreaseCapacity(int size) { | 1694 void IncreaseCapacity(int size) { |
| 1695 accounting_stats_.ExpandSpace(size); | 1695 accounting_stats_.ExpandSpace(size); |
| 1696 } | 1696 } |
| 1697 | 1697 |
| 1698 // Releases an unused page and shrinks the space. | 1698 // Releases an unused page and shrinks the space. |
| 1699 void ReleasePage(Page* page); | 1699 void ReleasePage(Page* page); |
| 1700 | 1700 |
| 1701 // Releases all of the unused pages. | |
| 1702 void ReleaseAllUnusedPages(); | |
| 1703 | |
| 1704 // The dummy page that anchors the linked list of pages. | 1701 // The dummy page that anchors the linked list of pages. |
| 1705 Page* anchor() { return &anchor_; } | 1702 Page* anchor() { return &anchor_; } |
| 1706 | 1703 |
| 1707 #ifdef VERIFY_HEAP | 1704 #ifdef VERIFY_HEAP |
| 1708 // Verify integrity of this space. | 1705 // Verify integrity of this space. |
| 1709 virtual void Verify(ObjectVisitor* visitor); | 1706 virtual void Verify(ObjectVisitor* visitor); |
| 1710 | 1707 |
| 1711 // Overridden by subclasses to verify space-specific object | 1708 // Overridden by subclasses to verify space-specific object |
| 1712 // properties (e.g., only maps or free-list nodes are in map space). | 1709 // properties (e.g., only maps or free-list nodes are in map space). |
| 1713 virtual void VerifyObject(HeapObject* obj) {} | 1710 virtual void VerifyObject(HeapObject* obj) {} |
| (...skipping 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2821 } | 2818 } |
| 2822 // Must be small, since an iteration is used for lookup. | 2819 // Must be small, since an iteration is used for lookup. |
| 2823 static const int kMaxComments = 64; | 2820 static const int kMaxComments = 64; |
| 2824 }; | 2821 }; |
| 2825 #endif | 2822 #endif |
| 2826 | 2823 |
| 2827 | 2824 |
| 2828 } } // namespace v8::internal | 2825 } } // namespace v8::internal |
| 2829 | 2826 |
| 2830 #endif // V8_SPACES_H_ | 2827 #endif // V8_SPACES_H_ |
| OLD | NEW |