OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_OBJECTS_H_ | 5 #ifndef V8_OBJECTS_H_ |
6 #define V8_OBJECTS_H_ | 6 #define V8_OBJECTS_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/assert-scope.h" | 9 #include "src/assert-scope.h" |
10 #include "src/builtins.h" | 10 #include "src/builtins.h" |
(...skipping 1729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1740 | 1740 |
1741 // Iterates over all pointers contained in the object except the | 1741 // Iterates over all pointers contained in the object except the |
1742 // first map pointer. The object type is given in the first | 1742 // first map pointer. The object type is given in the first |
1743 // parameter. This function does not access the map pointer in the | 1743 // parameter. This function does not access the map pointer in the |
1744 // object, and so is safe to call while the map pointer is modified. | 1744 // object, and so is safe to call while the map pointer is modified. |
1745 void IterateBody(InstanceType type, int object_size, ObjectVisitor* v); | 1745 void IterateBody(InstanceType type, int object_size, ObjectVisitor* v); |
1746 | 1746 |
1747 // Returns the heap object's size in bytes | 1747 // Returns the heap object's size in bytes |
1748 inline int Size(); | 1748 inline int Size(); |
1749 | 1749 |
| 1750 // Returns true if this heap object contains only references to other |
| 1751 // heap objects. |
| 1752 inline bool ContainsPointers(); |
| 1753 |
1750 // Given a heap object's map pointer, returns the heap size in bytes | 1754 // Given a heap object's map pointer, returns the heap size in bytes |
1751 // Useful when the map pointer field is used for other purposes. | 1755 // Useful when the map pointer field is used for other purposes. |
1752 // GC internal. | 1756 // GC internal. |
1753 inline int SizeFromMap(Map* map); | 1757 inline int SizeFromMap(Map* map); |
1754 | 1758 |
1755 // Returns the field at offset in obj, as a read/write Object* reference. | 1759 // Returns the field at offset in obj, as a read/write Object* reference. |
1756 // Does no checking, and is safe to use during GC, while maps are invalid. | 1760 // Does no checking, and is safe to use during GC, while maps are invalid. |
1757 // Does not invoke write barrier, so should only be assigned to | 1761 // Does not invoke write barrier, so should only be assigned to |
1758 // during marking GC. | 1762 // during marking GC. |
1759 static inline Object** RawField(HeapObject* obj, int offset); | 1763 static inline Object** RawField(HeapObject* obj, int offset); |
(...skipping 9445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11205 } else { | 11209 } else { |
11206 value &= ~(1 << bit_position); | 11210 value &= ~(1 << bit_position); |
11207 } | 11211 } |
11208 return value; | 11212 return value; |
11209 } | 11213 } |
11210 }; | 11214 }; |
11211 | 11215 |
11212 } } // namespace v8::internal | 11216 } } // namespace v8::internal |
11213 | 11217 |
11214 #endif // V8_OBJECTS_H_ | 11218 #endif // V8_OBJECTS_H_ |
OLD | NEW |