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 1645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1656 | 1656 |
1657 // Wasted bytes in this space. These are just the bytes that were thrown away | 1657 // Wasted bytes in this space. These are just the bytes that were thrown away |
1658 // due to being too small to use for allocation. They do not include the | 1658 // due to being too small to use for allocation. They do not include the |
1659 // free bytes that were not found at all due to lazy sweeping. | 1659 // free bytes that were not found at all due to lazy sweeping. |
1660 virtual intptr_t Waste() { return accounting_stats_.Waste(); } | 1660 virtual intptr_t Waste() { return accounting_stats_.Waste(); } |
1661 | 1661 |
1662 // Returns the allocation pointer in this space. | 1662 // Returns the allocation pointer in this space. |
1663 Address top() { return allocation_info_.top; } | 1663 Address top() { return allocation_info_.top; } |
1664 Address limit() { return allocation_info_.limit; } | 1664 Address limit() { return allocation_info_.limit; } |
1665 | 1665 |
| 1666 // The allocation top and limit addresses. |
| 1667 Address* allocation_top_address() { return &allocation_info_.top; } |
| 1668 Address* allocation_limit_address() { return &allocation_info_.limit; } |
| 1669 |
1666 // Allocate the requested number of bytes in the space if possible, return a | 1670 // Allocate the requested number of bytes in the space if possible, return a |
1667 // failure object if not. | 1671 // failure object if not. |
1668 MUST_USE_RESULT inline MaybeObject* AllocateRaw(int size_in_bytes); | 1672 MUST_USE_RESULT inline MaybeObject* AllocateRaw(int size_in_bytes); |
1669 | 1673 |
1670 virtual bool ReserveSpace(int bytes); | 1674 virtual bool ReserveSpace(int bytes); |
1671 | 1675 |
1672 // Give a block of memory to the space's free list. It might be added to | 1676 // Give a block of memory to the space's free list. It might be added to |
1673 // the free list or accounted as waste. | 1677 // the free list or accounted as waste. |
1674 // If add_to_freelist is false then just accounting stats are updated and | 1678 // If add_to_freelist is false then just accounting stats are updated and |
1675 // no attempt to add area to free list is made. | 1679 // no attempt to add area to free list is made. |
(...skipping 1151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2827 } | 2831 } |
2828 // Must be small, since an iteration is used for lookup. | 2832 // Must be small, since an iteration is used for lookup. |
2829 static const int kMaxComments = 64; | 2833 static const int kMaxComments = 64; |
2830 }; | 2834 }; |
2831 #endif | 2835 #endif |
2832 | 2836 |
2833 | 2837 |
2834 } } // namespace v8::internal | 2838 } } // namespace v8::internal |
2835 | 2839 |
2836 #endif // V8_SPACES_H_ | 2840 #endif // V8_SPACES_H_ |
OLD | NEW |