OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_HEAP_SPACES_H_ | 5 #ifndef V8_HEAP_SPACES_H_ |
6 #define V8_HEAP_SPACES_H_ | 6 #define V8_HEAP_SPACES_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/base/atomicops.h" | 9 #include "src/base/atomicops.h" |
10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
(...skipping 1645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1656 // subsequently torn down. | 1656 // subsequently torn down. |
1657 bool HasBeenSetUp(); | 1657 bool HasBeenSetUp(); |
1658 | 1658 |
1659 // Cleans up the space, frees all pages in this space except those belonging | 1659 // Cleans up the space, frees all pages in this space except those belonging |
1660 // to the initial chunk, uncommits addresses in the initial chunk. | 1660 // to the initial chunk, uncommits addresses in the initial chunk. |
1661 void TearDown(); | 1661 void TearDown(); |
1662 | 1662 |
1663 // Checks whether an object/address is in this space. | 1663 // Checks whether an object/address is in this space. |
1664 inline bool Contains(Address a); | 1664 inline bool Contains(Address a); |
1665 bool Contains(HeapObject* o) { return Contains(o->address()); } | 1665 bool Contains(HeapObject* o) { return Contains(o->address()); } |
| 1666 // Unlike Contains() methods it is safe to call this one even for addresses |
| 1667 // of unmapped memory. |
| 1668 bool ContainsSafe(Address addr); |
1666 | 1669 |
1667 // Given an address occupied by a live object, return that object if it is | 1670 // Given an address occupied by a live object, return that object if it is |
1668 // in this space, or a Smi if it is not. The implementation iterates over | 1671 // in this space, or a Smi if it is not. The implementation iterates over |
1669 // objects in the page containing the address, the cost is linear in the | 1672 // objects in the page containing the address, the cost is linear in the |
1670 // number of objects in the page. It may be slow. | 1673 // number of objects in the page. It may be slow. |
1671 Object* FindObject(Address addr); | 1674 Object* FindObject(Address addr); |
1672 | 1675 |
1673 // During boot the free_space_map is created, and afterwards we may need | 1676 // During boot the free_space_map is created, and afterwards we may need |
1674 // to write it into the free list nodes that were already created. | 1677 // to write it into the free list nodes that were already created. |
1675 void RepairFreeListsAfterDeserialization(); | 1678 void RepairFreeListsAfterDeserialization(); |
(...skipping 1209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2885 count = 0; | 2888 count = 0; |
2886 } | 2889 } |
2887 // Must be small, since an iteration is used for lookup. | 2890 // Must be small, since an iteration is used for lookup. |
2888 static const int kMaxComments = 64; | 2891 static const int kMaxComments = 64; |
2889 }; | 2892 }; |
2890 #endif | 2893 #endif |
2891 } | 2894 } |
2892 } // namespace v8::internal | 2895 } // namespace v8::internal |
2893 | 2896 |
2894 #endif // V8_HEAP_SPACES_H_ | 2897 #endif // V8_HEAP_SPACES_H_ |
OLD | NEW |