| 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 // Returns the allocation pointer in this space. | 1691 // Returns the allocation pointer in this space. |
| 1692 Address top() { return allocation_info_.top; } | 1692 Address top() { return allocation_info_.top; } |
| 1693 Address limit() { return allocation_info_.limit; } | 1693 Address limit() { return allocation_info_.limit; } |
| 1694 | 1694 |
| 1695 // The allocation top and limit addresses. | 1695 // The allocation top and limit addresses. |
| 1696 Address* allocation_top_address() { return &allocation_info_.top; } | 1696 Address* allocation_top_address() { return &allocation_info_.top; } |
| 1697 Address* allocation_limit_address() { return &allocation_info_.limit; } | 1697 Address* allocation_limit_address() { return &allocation_info_.limit; } |
| 1698 | 1698 |
| 1699 // Allocate the requested number of bytes in the space if possible, return a | 1699 // Allocate the requested number of bytes in the space if possible, return a |
| 1700 // failure object if not. | 1700 // failure object if not. |
| 1701 inline HeapObject* AllocateRawHelper(int size_in_bytes); |
| 1701 MUST_USE_RESULT inline MaybeObject* AllocateRaw(int size_in_bytes); | 1702 MUST_USE_RESULT inline MaybeObject* AllocateRaw(int size_in_bytes); |
| 1703 MUST_USE_RESULT inline MaybeObject* AllocateRawSilently(int size_in_bytes); |
| 1702 | 1704 |
| 1703 virtual bool ReserveSpace(int bytes); | 1705 virtual bool ReserveSpace(int bytes); |
| 1704 | 1706 |
| 1705 // Give a block of memory to the space's free list. It might be added to | 1707 // Give a block of memory to the space's free list. It might be added to |
| 1706 // the free list or accounted as waste. | 1708 // the free list or accounted as waste. |
| 1707 // If add_to_freelist is false then just accounting stats are updated and | 1709 // If add_to_freelist is false then just accounting stats are updated and |
| 1708 // no attempt to add area to free list is made. | 1710 // no attempt to add area to free list is made. |
| 1709 int Free(Address start, int size_in_bytes) { | 1711 int Free(Address start, int size_in_bytes) { |
| 1710 int wasted = free_list_.Free(start, size_in_bytes); | 1712 int wasted = free_list_.Free(start, size_in_bytes); |
| 1711 accounting_stats_.DeallocateBytes(size_in_bytes - wasted); | 1713 accounting_stats_.DeallocateBytes(size_in_bytes - wasted); |
| (...skipping 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2878 } | 2880 } |
| 2879 // Must be small, since an iteration is used for lookup. | 2881 // Must be small, since an iteration is used for lookup. |
| 2880 static const int kMaxComments = 64; | 2882 static const int kMaxComments = 64; |
| 2881 }; | 2883 }; |
| 2882 #endif | 2884 #endif |
| 2883 | 2885 |
| 2884 | 2886 |
| 2885 } } // namespace v8::internal | 2887 } } // namespace v8::internal |
| 2886 | 2888 |
| 2887 #endif // V8_SPACES_H_ | 2889 #endif // V8_SPACES_H_ |
| OLD | NEW |