| 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 1746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1757 // The allocation top address. | 1757 // The allocation top address. |
| 1758 Address* allocation_top_address() { | 1758 Address* allocation_top_address() { |
| 1759 return allocation_info_.top_address(); | 1759 return allocation_info_.top_address(); |
| 1760 } | 1760 } |
| 1761 | 1761 |
| 1762 // The allocation limit address. | 1762 // The allocation limit address. |
| 1763 Address* allocation_limit_address() { | 1763 Address* allocation_limit_address() { |
| 1764 return allocation_info_.limit_address(); | 1764 return allocation_info_.limit_address(); |
| 1765 } | 1765 } |
| 1766 | 1766 |
| 1767 enum AllocationType { | |
| 1768 NEW_OBJECT, | |
| 1769 MOVE_OBJECT | |
| 1770 }; | |
| 1771 | |
| 1772 // Allocate the requested number of bytes in the space if possible, return a | 1767 // Allocate the requested number of bytes in the space if possible, return a |
| 1773 // failure object if not. | 1768 // failure object if not. |
| 1774 MUST_USE_RESULT inline MaybeObject* AllocateRaw( | 1769 MUST_USE_RESULT inline MaybeObject* AllocateRaw(int size_in_bytes); |
| 1775 int size_in_bytes, | |
| 1776 AllocationType event = NEW_OBJECT); | |
| 1777 | 1770 |
| 1778 virtual bool ReserveSpace(int bytes); | 1771 virtual bool ReserveSpace(int bytes); |
| 1779 | 1772 |
| 1780 // Give a block of memory to the space's free list. It might be added to | 1773 // Give a block of memory to the space's free list. It might be added to |
| 1781 // the free list or accounted as waste. | 1774 // the free list or accounted as waste. |
| 1782 // If add_to_freelist is false then just accounting stats are updated and | 1775 // If add_to_freelist is false then just accounting stats are updated and |
| 1783 // no attempt to add area to free list is made. | 1776 // no attempt to add area to free list is made. |
| 1784 int Free(Address start, int size_in_bytes) { | 1777 int Free(Address start, int size_in_bytes) { |
| 1785 int wasted = free_list_.Free(start, size_in_bytes); | 1778 int wasted = free_list_.Free(start, size_in_bytes); |
| 1786 accounting_stats_.DeallocateBytes(size_in_bytes - wasted); | 1779 accounting_stats_.DeallocateBytes(size_in_bytes - wasted); |
| (...skipping 1196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2983 } | 2976 } |
| 2984 // Must be small, since an iteration is used for lookup. | 2977 // Must be small, since an iteration is used for lookup. |
| 2985 static const int kMaxComments = 64; | 2978 static const int kMaxComments = 64; |
| 2986 }; | 2979 }; |
| 2987 #endif | 2980 #endif |
| 2988 | 2981 |
| 2989 | 2982 |
| 2990 } } // namespace v8::internal | 2983 } } // namespace v8::internal |
| 2991 | 2984 |
| 2992 #endif // V8_SPACES_H_ | 2985 #endif // V8_SPACES_H_ |
| OLD | NEW |